Skip to content

Instantly share code, notes, and snippets.

@scashin133
Created January 6, 2011 22:25
Show Gist options
  • Save scashin133/768728 to your computer and use it in GitHub Desktop.
Save scashin133/768728 to your computer and use it in GitHub Desktop.
Used to generate a random alphanum string from command line without newlines.
# Linux
openssl rand -base64 1024 -out /dev/stdout | sed -r 's/[^a-zA-Z0-9]//g' | tr -d '\n'
# Mac OSX
openssl rand -base64 1024 -out /dev/stdout | sed 's/[^a-zA-Z0-9]//g' | tr -d '\n'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment