snippets
alphanumeric password generator
with the power of gum, this function accepts a number input and then uses it as the length for a randomly generated alphanumeric string.
this is kind of jank but if, like me, you find yourself in need of a quick password or something and are too lazy to hit the generate password button on your graphical password manager (please don’t tell me you’re not using one)… well, it’s just CTRL + ALT + T and you’re off.
# password generator. takes input for password length by number
function passgen() {
PASSLENGTH=$(gum input --placeholder "type a number")
date +%s | sha256sum | base64 | head -c $PASSLENGTH ; echo
}