This is mainly useful for passwords that you can store in a secure manner (like in an encrypted file) and copy/paste whenever you need them.
It uses the random(4) device by default because that is the non-blocking random device on FreeBSD. On Linux you might want to change that to /dev/urandom.
It has been ported to python 3, and the default password length has been increased from 8 to 16 characters.
Some examples of how to use it are shown below.
> genpw -h usage: genpw [-h] [-l LENGTH] [-r REPEAT] [-d DEVICE] [-v] Generate random passwords. optional arguments: -h, --help show this help message and exit -l LENGTH, --length LENGTH # of random character for password (default 16) -r REPEAT, --repeat REPEAT number of passwords to generate (default: 1) -d DEVICE, --device DEVICE random number device (default: /dev/random) -v, --version show program's version number and exit > genpw -r 5 s7s7lmr63EHNhUxQ roVtAghqlTSZVzoY PvRXPdhGgnmVVV84 lbiX9ID_NUKBYZre yfsDzgY_vj9pxejH > genpw -r 5 -l 32 zccMOjNkgnnYAGS2_KzH3LWExfsFkqiK 6O4OY6IWtybHGBeAgt6fcH8cPuw8GfOT IsCvfzzrmhsVjtqz_YAODvGjfovuXKWT COrtClfbpRNkZ8CY8cIushW0U9ABpI0C i19BvQARd2phLrOGVuqh37etk_QvBG71
The genpw.py script can be downloaded from github.