PSA: How to create a random password in the command line (something that also just learned to do today, so also a TIL entry):
```bash
randpass () { echo $(openssl rand -base64 "${1:-12}") }
```
The way this works is that you can type either `randpass`, and you will get a random password of 12 character (among those that are safe in the base64 representation; namely, lowercase and capital letters, decimal digits, plus `+` and `/`, and `= ` for padding).
Or, you can type `randpass 8` or `randpass 256`, for instance, to get a random password of the given characters long, to accommodate the needs from the service you need the password for.
On the Mac, you can do `randpass | pbcopy` and get it directly on your clipboard, so that you can paste it elsewhere, while keeping it hidden.
#PSA #PublicServiceAnnouncement #TIL #TodayILearned #CLI #CommandLineInterface #openssl #pbcopy #bash #zsh