Skip to content

Instantly share code, notes, and snippets.

@krry krry/kamadhenu
Last active Feb 11, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.