Skip to content

Instantly share code, notes, and snippets.

@jmillerdesign
Created August 21, 2018 23:31
Show Gist options
  • Save jmillerdesign/75282c7a6f814c7d5f9b80efb3dacc3f to your computer and use it in GitHub Desktop.
Save jmillerdesign/75282c7a6f814c7d5f9b80efb3dacc3f to your computer and use it in GitHub Desktop.
Random password generator
#!/usr/bin/env bash
# Example: lKJjF7cP9V-6GcNOJQJX9
function pw() {
string=$(LC_ALL=C tr -dc "a-zA-Z0-9" < /dev/urandom | head -c 20)
echo ${string:0:10}-${string:10:10}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment