Skip to content

Instantly share code, notes, and snippets.

@Ryu1845
Created September 17, 2022 10:25
Show Gist options
  • Save Ryu1845/07e5d72275ec1eb97ef911825536b578 to your computer and use it in GitHub Desktop.
Save Ryu1845/07e5d72275ec1eb97ef911825536b578 to your computer and use it in GitHub Desktop.
gen-username() {
vowel() {
head /dev/urandom | tr -dc 'aeiueoy' | cut -c1
}
consonant() {
head /dev/urandom | tr -dc 'qwrtpsdfghjklzxcvbnm' | cut -c1
}
digit() {
head /dev/urandom | tr -dc '[:digit:]' | cut -c1
}
echo $(consonant | tr '[:lower:]' '[:upper:]')$(vowel)$(consonant)$(vowel)$(consonant)$(vowel)$(digit)$(digit)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment