Created
November 11, 2014 14:30
-
-
Save einarjh/d583a340798464199ab8 to your computer and use it in GitHub Desktop.
make temporary password in bash
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
# Explanation haiku: | |
# semi-random temp password | |
# easy to remember, type | |
# not very secure | |
function maketemppassword() { | |
part1="$(awk 'length==8' /usr/share/dict/words | grep -v '[^[:alpha:]]' | shuf -n 1 | tr '[:upper:]' '[:lower:]')" | |
part2="$(< /dev/urandom tr -dc 0-9 | head -c${1:-2};echo;)" | |
part3="$(< /dev/urandom tr -dc A-Z | head -c${1:-2};echo;)" | |
echo "${part1}-${part2}_${part3}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment