Skip to content

Instantly share code, notes, and snippets.

@jsoningram
Last active January 4, 2016 19:45
Show Gist options
  • Save jsoningram/1dc04f4ce9057858ff99 to your computer and use it in GitHub Desktop.
Save jsoningram/1dc04f4ce9057858ff99 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Create secure password at variable length
# Useage: `password <length>'
length=$1
env LC_CTYPE=C tr -dc "a-zA-Z0-9&*(){}_+?><~;\!@#$%^" < /dev/urandom | head -c $length > /tmp/password.txt
cat /tmp/password.txt | pbcopy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment