Last active
August 29, 2015 14:05
-
-
Save ngsw/8bcd49432de6339dd721 to your computer and use it in GitHub Desktop.
"A random password generator" (via http://www.commandlinefu.com)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://www.commandlinefu.com/commands/view/13641/a-random-password-generator#comment | |
tr -dc '\x15-\x7e' < /dev/urandom| head -c 16 | paste | |
# | |
cat /dev/urandom | tr -dc A-Za-z0-9 | head -c 32 | |
# 便利:) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
passwdgen() | |
{ | |
n=${1} | |
cat /dev/urandom | | |
tr -dc A-Za-z0-9 | | |
head -c ${n:-8} | |
} | |
# passwdgen | |
#=> BpU2a8kM | |
# passwdgen | |
#=> uEv8HD8I | |
# passwdgen 32 | |
#=> 2IKd3tfogc01MjcNIus9dFJaR4yZ3BID | |
# passwdgen 1 | |
#=> H | |
# Very Yoi!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment