Skip to content

Instantly share code, notes, and snippets.

@vrotaru
Created January 11, 2016 06:50
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 vrotaru/97209cc43599b26a5866 to your computer and use it in GitHub Desktop.
Save vrotaru/97209cc43599b26a5866 to your computer and use it in GitHub Desktop.
#! /bin/bash
SRC=/dev/urandom
len=${1-12}
i=1
while (( $i <= len )); do
if (( ($i + 1) % 3 == 0 )) ; then
cat $SRC | base64 | tr -dc aeiouy | head -c1
elif (( ($i - 1) % 6 == 0 )); then
cat $SRC | base64 | tr -dc QWTYPSDFGHJKLZXCVBNMY | head -c1
else
cat $SRC | base64 | tr -dc qwrtpsdfghjklzxcvbnm | head -c1
fi
(( $i > 0 )) && (($i < len)) && (( $i % 6 == 0 )) && echo -n "-"
i=$(( $i + 1 ))
done
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment