Skip to content

Instantly share code, notes, and snippets.

@tzkmx
Created December 8, 2021 20:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tzkmx/b481d72032840a495701fb815132e725 to your computer and use it in GitHub Desktop.
Save tzkmx/b481d72032840a495701fb815132e725 to your computer and use it in GitHub Desktop.
# Random string based on /dev/urandom
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-32};echo;
tr -cd '[:alnum:]' < /dev/urandom | fold -w30 | head -n1
dd if=/dev/urandom bs=1 count=32 2>/dev/null | base64 -w 0 | rev | cut -b 2- | rev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment