Micro Tips
Sometimes I do something that seems like it would be useful, but doesn't rise to the level of creating its own article or blog post. I put those things here.
Generating Secure Passwords
There are three main circumstances where I need to generate a random password for an account: when I need to add a user, when I need to disable (but not delete) a user, and when a user forgets their password. When someone forgets their password and I reset it, I just make it the simplest possible password I can and then make them reset it to something I don't know before I hang up the phone. For the other two circumstances, I do something a little more secure.
If I need to create a password for a new account, I generate a passphrase using standard Unix tools
shuf /usr/share/dict/words | sed -n 1,4p | tr '\n' '-'
This takes the list of words from the system dictionary, shuffles them, reads the first four words in the resulting list, and changes the newlines into hyphens. You might have to run the command a few times to get something useable, the dictionary does contain things like apostrophes and profanity. And it leaves a hyphen at the end.
You get something like this: incarcerate-foist-servers-indefensibly-
If some account needs to be disabled and the password scrambled, I get a little more obnoxious.
head -c 128 /dev/urandom | env LC_CTYPE=C tr -dc [:graph:]
This grabs 128 bytes from the /dev/urandom and strips out everything that isn't printable (by deleting the complement of all printable characters).
You get something like this: <{Zmn!^*F]:h$wd-/GT>F9Z4%`[!VqB7y8/==mT"Lx'c}FzK[_Rh`5vb')7