Skip to content

Instantly share code, notes, and snippets.

@svicknesh
Last active May 28, 2017 05:51
Show Gist options
  • Save svicknesh/66346e6e5134f6b80f6f1edf359856a5 to your computer and use it in GitHub Desktop.
Save svicknesh/66346e6e5134f6b80f6f1edf359856a5 to your computer and use it in GitHub Desktop.
Generate passwords like OSX in Command Line
#!/bin/bash
string=$(openssl rand -base64 15 | sed -e ':a;N;$!ba;s/\n//g' -e 's/[^a-zA-Z0-9]//g' -e "s/ //g")
echo ${string:0:3}-${string:3:3}-${string:6:3}-${string:9:3}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment