new method of generating a password; 5 random words from dict.

master
NunoSempere 10 months ago
parent 0553ef84f2
commit dd3297e81a

@ -64,14 +64,16 @@ cmd_append_append() {
else
ARGS="$@"
charstring1='"'
charstring2="\!#\$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
characters="$charstring1$charstring2"
length=25
read -r -n $length new_password < <(LC_ALL=C tr -dc "$characters" < /dev/urandom)
# old method of generating a password:
# charstring1='"'
# charstring2="\!#\$&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_\`abcdefghijklmnopqrstuvwxyz{|}~"
# characters="$charstring1$charstring2"
# length=25
# read -r -n $length new_password < <(LC_ALL=C tr -dc "$characters" < /dev/urandom)
# new method:
new_password=$(cat /usr/share/dict/words | sed "s|'s||g" | shuf -n6 | sed -z 's/\n/-/g;s/-$/\n/' | tr '[:upper:]' '[:lower:]')
printf "$new_password" | xclip -sel clip
echo "Copied new password to clipboard: "
echo "$new_password"

Loading…
Cancel
Save