Skip to content

Instantly share code, notes, and snippets.

@krry
Last active February 11, 2019 10:53
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 krry/3c6bb744cf7b73181cbd6c797e00662b to your computer and use it in GitHub Desktop.
Save krry/3c6bb744cf7b73181cbd6c797e00662b to your computer and use it in GitHub Desktop.
kamadhenu - heed the wise old cow in your mac terminal
# Kamadhenu
# https://www.wikiwand.com/en/Kamadhenu
#
# the holy cow speaketh
#
# for OSX, possible to port to Linux
brew install figlet cowsay lolcat fortune
git clone https://github.com/krry/cowsay-files
cp cowsay-files/cows/*.cow /usr/local/share/cows/
# choose a random cow
function holycowsay() {
if hash shuf 2>/dev/null; then
cowfile="$(cowsay -l | sed "1 d" | tr ' ' '\n' | shuf -n 1)"
else
cowfiles=( $(cowsay -l | sed "1 d") );
cowfile=${cowfiles[$(($RANDOM % ${#cowfiles[*]}))]}
fi
cowsay -f "$cowfile"
}
fortune | figlet | holycowsay | lolcat
# or you can just do it from the command line
# fortune -s | figlet -f $(ls /usr/local/share/figlet/fonts/*.flf | shuf -n1) | cowsay -f $(ls cowsay-files/cows/*.cow | shuf -n1) -n | lolcat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment