Skip to content

Instantly share code, notes, and snippets.

@techygrrrl
Last active October 23, 2022 18:19
Show Gist options
  • Save techygrrrl/87ee025fd05f930c4ec475734c11229c to your computer and use it in GitHub Desktop.
Save techygrrrl/87ee025fd05f930c4ec475734c11229c to your computer and use it in GitHub Desktop.
Generate random values in the command line. pbcopy and pbpaste are macOS commands and may not be available on other systems, so use the equivalent on yours
# Put these in your ~/.bash_profile or ~/.zshrc
alias randomhex="python -c 'import sys,uuid; sys.stdout.write(uuid.uuid4().hex)' | pbcopy && pbpaste && echo"
# => db2bfd6f438444fd8b9e9285ea761386
alias uuid="python -c 'import sys,uuid; sys.stdout.write(str(uuid.uuid4()))' | pbcopy && pbpaste && echo"
# => e2b6addd-d057-4ba4-8e57-9d60431bf5e6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment