| genaccount - dotfiles - These are my dotfiles. There are many like it, but thes… | |
| git clone git://jay.scot/dotfiles | |
| Log | |
| Files | |
| Refs | |
| README | |
| --- | |
| genaccount (462B) | |
| --- | |
| 1 #!/bin/sh | |
| 2 | |
| 3 generate_username() { | |
| 4 file=$(find /usr/bin/ -type f -exec basename {} \; | shuf -n 1) | |
| 5 words=$(strings "/usr/bin/$file" | grep -Eo '\b[a-zA-Z]{5,}\b' |… | |
| 6 word1=$(echo "$words" | head -n 1) | |
| 7 word2=$(echo "$words" | tail -n 1) | |
| 8 printf "%s_%s" "$word1" "$word2" | |
| 9 } | |
| 10 | |
| 11 generate_password() { | |
| 12 openssl rand -base64 12 | |
| 13 } | |
| 14 | |
| 15 username=$(generate_username) | |
| 16 password=$(generate_password) | |
| 17 | |
| 18 printf "Username: %s\n" "$username" | |
| 19 printf "Password: %s\n" "$password" |