Skip to content

Instantly share code, notes, and snippets.

@gallypette
Created February 19, 2021 14:58
Show Gist options
  • Save gallypette/15a0b2ed888b99176816921527205d23 to your computer and use it in GitHub Desktop.
Save gallypette/15a0b2ed888b99176816921527205d23 to your computer and use it in GitHub Desktop.
Galane VTC password generator
#!/usr/bin/env python3
import sys
import string
import secrets
alphabet = string.ascii_letters + string.digits
for arg in sys.argv:
with open(arg, "rt") as fin:
with open("{}.pwd".format(arg), "wt") as fout:
for line in fin:
password = ''.join(secrets.choice(alphabet) for i in range(8))
fout.write(line.replace('"password":""', '"password":"{}"'.format(password)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment