Skip to content

Instantly share code, notes, and snippets.

@waywardone
Created October 7, 2019 17:11
Show Gist options
  • Save waywardone/8003a68001c29885716f85a8d6b52c98 to your computer and use it in GitHub Desktop.
Save waywardone/8003a68001c29885716f85a8d6b52c98 to your computer and use it in GitHub Desktop.

Generate random passwords on macOS

$ brew install pwgen

# In ~/.env.sh or ~/.zshenv
function genpasswd() { pwgen -1Bs $1 | pbcopy | pbpaste }

$ source ~/.zshrc
$ genpasswd 20
j4AXqWYyeCdPKtwjqmC9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment