This script will generate a random password by picking words from the provided word list. The pool of words comes from Oren Tirosh's mnemonic encoding project.
Just run the script and provide the number of words you'd like your password to be composed of:
$ ./genpass 4
undersnakeoctopusmentor
Shamelessly ripped from genhost.