{"id":13427,"date":"2015-12-15T17:47:30","date_gmt":"2015-12-15T17:47:30","guid":{"rendered":"https:\/\/www.bartbusschots.ie\/s\/?p=13427"},"modified":"2015-12-15T17:47:30","modified_gmt":"2015-12-15T17:47:30","slug":"hsxkpasswd-without-sudo-with-perlbrew","status":"publish","type":"post","link":"https:\/\/www.bartbusschots.ie\/s\/2015\/12\/15\/hsxkpasswd-without-sudo-with-perlbrew\/","title":{"rendered":"<code>hsxkpasswd<\/code> Without <code>sudo<\/code> (with <code>perlbrew<\/code>)"},"content":{"rendered":"<p>While it&#8217;s very easy to install <code>hsxkpasswd<\/code> onto your system from CPAN &#8211; it&#8217;s literally just one command (see below) &#8211; it requires administrator access to the machine.<\/p>\n<pre class=\"crayon:false\">\r\nsudo cpan Crypt::HSXKPasswd\r\n<\/pre>\n<p>This is all well and good if you have administrator access and are sure you want the module installed system-wide. But, what if you don&#8217;t have admin access, or, what if you just want to experiment with the module in your own home directory? The answer is <code><a href=\"http:\/\/perlbrew.pl\" target=\"_blank\">perlbrew<\/a><\/code>, a system for running custom versions of Perl inside your home directory. No need for <code>sudo<\/code>, and what ever you install with <code>perlbrew<\/code> is entirely contained within your home directory. If you already have <code>perlbrew<\/code> installed and configured with a version of Perl greater than or equal to 5.16, you can skip to the final step. If not, you&#8217;ll need to make your way through all the steps.<\/p>\n<h2>Step 1 &#8211; Install <code>perlbrew<\/code> Into Your Home Dir<\/h2>\n<p>There are a few different ways of installing <code>perlbrew<\/code>, but I find the following method the simplest:<\/p>\n<pre class=\"crayon:false\">\r\ncurl -L http:\/\/install.perlbrew.pl | bash\r\n<\/pre>\n<p>That should install <code>perlbrew<\/code> into your home directory, and it should tell you to append some code to the end of your <code>~\/.bash_profile<\/code> file, which you can do with the following command:<\/p>\n<pre class=\"crayon:false\">\r\necho 'source ~\/perl5\/perlbrew\/etc\/bashrc' >> ~\/.bash_profile\r\n<\/pre>\n<p>Once that&#8217;s done, close your Terminal window and open a new one (this is to pick up the new environment variables defined in <code>~\/perl5\/perlbrew\/etc\/bashrc<\/code>). You&#8217;ll know the install has been successful if you can run the <code>perlbrew<\/code> command:<\/p>\n<pre class=\"crayon:false\">\r\nperlbrew version\r\n<\/pre>\n<h2>Step 2 &#8211; Install a Compatible Version of Perl into <code>perlbrew<\/code><\/h2>\n<p>The joy of <code>perlbrew<\/code> is that you can have as many versions of Perl installed at any one time as you like, and you can then switch between them with the <code>perlbrew<\/code> command.<\/p>\n<p>You can install <code>Crypt::HSXKpasswd<\/code>, and hence the <code>hsxkpasswd<\/code> terminal command, into any version of Perl greater than or equal to 5.16.<\/p>\n<p>The following command will install Perl 5.16 into <code>perlbrew<\/code>:<\/p>\n<pre class=\"crayon:false\">\r\nperlbrew install perl-5.16.0\r\n<\/pre>\n<p>Go off and make yourself a cup of your favourite beverage &#8211; this will take a while! \ud83d\ude42<\/p>\n<p>Once the install finally finishes, you can activate that version of perl (just on your account) with the command:<\/p>\n<pre class=\"crayon:false\">\r\nperlbrew switch perl-5.16.0\r\n<\/pre>\n<p>It&#8217;s important to note that if at any stage you want to disable <code>perlbrew<\/code> and get back to the default system version of perl, the command to do so is:<\/p>\n<pre class=\"crayon:false\">\r\nperlbrew off\r\n<\/pre>\n<h2>Step 3 &#8211; Enable the <code>perlbrew<\/code> CPAN Client<\/h2>\n<p>If you haven&#8217;t already done so, enable the <code>perlbrew<\/code> CPAN client <code>cpanm<\/code> with the command:<\/p>\n<pre class=\"crayon:false\">\r\nperlbrew install-cpanm\r\n<\/pre>\n<h2>Step 4 &#8211; Install <code>Crypt::HSXKPasswd<\/code><\/h2>\n<p>Once you have <code>perlbrew<\/code> installed and configured with a compatible version of perl, you can install <code>Crypt::HSXKPasswd<\/code> with the following simple command:<\/p>\n<pre class=\"crayon:false\">\r\ncpanm Crypt::HSXKPasswd\r\n<\/pre>\n<p>You&#8217;ll know it&#8217;s worked if you can run the <code>hsxkpasswd<\/code> terminal command:<\/p>\n<pre class=\"crayon:false\">\r\nhsxkpasswd --version\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>While it&#8217;s very easy to install hsxkpasswd onto your system from CPAN &#8211; it&#8217;s literally just one command (see below) &#8211; it requires administrator access to the machine. sudo cpan Crypt::HSXKPasswd This is all well and good if you have administrator access and are sure you want the module installed system-wide. But, what if you [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12,440,17,446],"tags":[410,267,542,458],"series":[],"class_list":["post-13427","post","type-post","status-publish","format-standard","hentry","category-computers-tech","category-tech-projects","category-security","category-sysadmin","tag-hsxkpasswd","tag-perl","tag-perlbrew","tag-tutorial"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7t9xK-3uz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/13427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/comments?post=13427"}],"version-history":[{"count":3,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/13427\/revisions"}],"predecessor-version":[{"id":13430,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/13427\/revisions\/13430"}],"wp:attachment":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/media?parent=13427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/categories?post=13427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/tags?post=13427"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/series?post=13427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}