Skip to content

Instantly share code, notes, and snippets.

@delyee
Last active September 3, 2021 19:42
Show Gist options
  • Save delyee/3784638497a97ab5938e0248dc20e1f1 to your computer and use it in GitHub Desktop.
Save delyee/3784638497a97ab5938e0248dc20e1f1 to your computer and use it in GitHub Desktop.
Easy gen strong password in terminal

Add this alias to ~/.zshrc or ~/.bashrc

alias gen_password='python3 -c "print(\"\".join(__import__(\"random\").choices(__import__(\"string\").ascii_letters + __import__(\"string\").digits, k=64)))"'

Example output

➜  ~ gen_password
cZus9VFXTfQeUhWvPlrDiWuDdax7aFkMV2B9WSylL2eTdtQbZpYqe2lLJkpz994Q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment