Change unix password oneliner
I tried using expect for changing passwords from a script, but expect sometimes works, sometimes not, at least in my case. So I came up with the following oneliner, as root do the following:
usermod -p `perl -e 'print crypt('mysupersecretpassword',rand(99));'` goofy
where mysupersecretpassword is the password you want to use and goofy is the user where you want to change the password for.