Skip to content

Instantly share code, notes, and snippets.

@weatheredwatcher
Last active June 21, 2019 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weatheredwatcher/0458fb0a53bf9531dd1c031e2c294935 to your computer and use it in GitHub Desktop.
Save weatheredwatcher/0458fb0a53bf9531dd1c031e2c294935 to your computer and use it in GitHub Desktop.
First pass at a Safari style password Generator
#! /bin/zsh
if ((! $+commands[pwgen] ));
then
echo "fail"
fi
i=0
while [ $i -lt 4 ]
do
((i++))
final_pass="$final_pass$(pwgen 8 1)"
if [[ $i != 4 ]]; then
final_pass="$final_pass-"
fi
done
echo $final_pass
echo $final_pass | pbcopy
echo "Password copied to clipboard"
@weatheredwatcher
Copy link
Author

This is a nifty little script that I have been messing around with. It loops through 4 times, generating a Safari style password.

It requires pwgen, ZSH and OS X.

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