{"id":6083,"date":"2021-11-06T12:48:55","date_gmt":"2021-11-06T12:48:55","guid":{"rendered":"https:\/\/really.zonky.org\/?p=6083"},"modified":"2021-11-06T13:00:25","modified_gmt":"2021-11-06T13:00:25","slug":"my-random-password-generator","status":"publish","type":"post","link":"https:\/\/really.zonky.org\/?p=6083","title":{"rendered":"My Random Password Generator"},"content":{"rendered":"\n<p>Someone asked me about this &#8211; a zsh function which I use to generate random passwords :-<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2713 mike@pica\u00bb rpass noise\noOg6vsM+V0It4he6US4Xk6DuZPja9okyOpQyUCfW6NQ=\n\u2713 mike@pica\u00bb rpass words\npatternmaker+meio+tubicolous+misbelievingly<\/code><\/pre>\n\n\n\n<p>It&#8217;s too small and simple for me to classify as &#8220;open source&#8221; but there&#8217;s no harm in sharing the function :-<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u2713 mike@pica\u00bb which rpass\nrpass () {\n\tcase \"$1\" in\n\t\t(\"noise\") dd if=\/dev\/random bs=1 count=32 status=none | base64 -i ;;\n\t\t(\"words\") punct=(\",\" \".\" \"&lt;\" \">\" \"\/\" \";\" \":\" \"-\" \"+\" \"=\") \n\t\t\tonep=${punct&#91;$(($RANDOM % ${#punct&#91;@]} + 1 ))]} \n\t\t\tw1=$(shuf -n 1 \/usr\/share\/dict\/words | sed -e \"s\/'.*$\/\/\") \n\t\t\tw2=$(shuf -n 1 \/usr\/share\/dict\/words | sed -e \"s\/'.*$\/\/\") \n\t\t\tw3=$(shuf -n 1 \/usr\/share\/dict\/words | sed -e \"s\/'.*$\/\/\") \n\t\t\tw4=$(shuf -n 1 \/usr\/share\/dict\/words | sed -e \"s\/'.*$\/\/\") \n\t\t\techo \"${w1}${onep}${w2}${onep}${w3}${onep}${w4}\" ;;\n\t\t(\"*\") echo $1 not understood ;;\n\tesac\n}<\/code><\/pre>\n\n\n\n<p>This is just a simple <em>zsh<\/em> function with all sorts of little &#8220;issues&#8221; &#8211; not least is that it could at least say &#8220;$1 not understood &#8211; try &#8216;words&#8217; or &#8216;noise'&#8221;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Someone asked me about this &#8211; a zsh function which I use to generate random passwords :- It&#8217;s too small and simple for me to classify as &#8220;open source&#8221; but there&#8217;s no harm in sharing the function :- This is just a simple zsh function with all sorts of little &#8220;issues&#8221; &#8211; not least is <a href='https:\/\/really.zonky.org\/?p=6083' class='excerpt-more'>[&#8230;]<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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},"jetpack_post_was_ever_published":false,"_share_on_mastodon":"0"},"categories":[4,209,489],"tags":[1503,1398,1212],"class_list":["post-6083","post","type-post","status-publish","format-standard","hentry","category-it","category-linux-it","category-security","tag-password","tag-random","tag-zsh","category-4-id","category-209-id","category-489-id","post-seq-1","post-parity-odd","meta-position-corners","fix"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p1f2KI-1A7","_links":{"self":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/6083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6083"}],"version-history":[{"count":2,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/6083\/revisions"}],"predecessor-version":[{"id":6086,"href":"https:\/\/really.zonky.org\/index.php?rest_route=\/wp\/v2\/posts\/6083\/revisions\/6086"}],"wp:attachment":[{"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/really.zonky.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}