You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
621 B
Python
21 lines
621 B
Python
#!/usr/bin/python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# Required parameters:
|
|
# @raycast.schemaVersion 1
|
|
# @raycast.title Generate CPE admin password
|
|
# @raycast.mode silent
|
|
# @raycast.packageName Developer Utilities
|
|
|
|
# Optional parameters:
|
|
# @raycast.icon 💻
|
|
|
|
import subprocess
|
|
from xkcdpass import xkcd_password as xp
|
|
wordfile = xp.locate_wordfile()
|
|
|
|
wordlist7 = xp.generate_wordlist( wordfile = wordfile, min_length = 5, max_length = 9 )
|
|
password = xp.generate_xkcdpassword( wordlist7, numwords = 4, delimiter = '-', case = 'lower' )
|
|
subprocess.run( [ "/usr/bin/pbcopy" ], input = password.encode( "utf-8" ) )
|
|
print( password )
|