Skip to content

Instantly share code, notes, and snippets.

@akash0x53
Created June 3, 2017 07:25
Show Gist options
  • Save akash0x53/b07fced1e5164cea9fdcb75e0d17d31b to your computer and use it in GitHub Desktop.
Save akash0x53/b07fced1e5164cea9fdcb75e0d17d31b to your computer and use it in GitHub Desktop.
Generate random password and copy to clipboard
genpass()
{
LEN=$1
shift
if [ "$LEN" == "" ];then
LEN=8
fi
head -c200 /dev/urandom |tr -cd [:alnum:]+[\!\@\#\$]|head -c $LEN|xclip -selection c
echo "Copied to clipboard"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment