Skip to content

Instantly share code, notes, and snippets.

@alexlovelltroy
Created September 2, 2014 22:00
Show Gist options
  • Save alexlovelltroy/119c32a12f6aca28c3f3 to your computer and use it in GitHub Desktop.
Save alexlovelltroy/119c32a12f6aca28c3f3 to your computer and use it in GitHub Desktop.
This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
#!/usr/bin/env zsh
#
# This script uses the menemonic_wordlist from the mnemonic encoding project to generate a set of word pairs
# I use them for software release naming conventions and I like choices
# You can get it for yourself with curl
# curl -Lo menmonic_wordlist.txt http://web.archive.org/web/20091003023412/http://tothink.com/mnemonic/wordlist.txt
#
#
MNEMONIC_FILE="$HOME/Documents/mnemonic_wordlist.txt"
function random_word {
WORDLINE=$(( $(($RANDOM % $(wc -l $MNEMONIC_FILE|awk '{print $1}'))) + 1))
WORDCOL=$(( $(($RANDOM % 6)) + 1 ))
WORD=$(head -$WORDLINE $MNEMONIC_FILE | tail -1 | awk -v word=$WORDCOL '{print $word }')
echo -n $WORD
}
random_word
echo -n " "
random_word
echo " "
random_word
echo -n " "
random_word
echo " "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment