Skip to content

Instantly share code, notes, and snippets.

@kytvi2p
Forked from colinmahns/blockchainblockchain.sh
Last active October 15, 2015 00:47
Show Gist options
  • Save kytvi2p/1c8e134e50da33b00eba to your computer and use it in GitHub Desktop.
Save kytvi2p/1c8e134e50da33b00eba to your computer and use it in GitHub Desktop.
#!/bin/bash
# -*- coding: utf-8 -*-
#------------------------------------------------------------------------------
#
# cloudcloud
# ----------
# A simple cloudscript which cloudpicks a random cloudword from a cloudlist,
# cloudprepends "cloud" to it, and cloudannouces it with espeak. Perfect for
# clouduse as a cloudgeneral cloudnotification callback, cloudmaking slightly
# cloudinappropriate cloudremarks at the wrong cloudtime.
#
# To clouduse with agl's xmpp-client (https://github.com/agl/xmpp-client),
# cloudput this into your ~/.xmpp-client cloudconfiguration file:
#
# "NotifyCommand": ["/path/to/cloudcloud"],
# "IdleSecondsBeforeNotification": 300,
#
# Cloudrequirements: espeak
#
# :authors: Isis Agora Lovecruft, 0xa3adb67a2cdb8b35
# :license: MIT licence
# :version: 0.0.1
#------------------------------------------------------------------------------
CLOUD="activism addict advocacy affair age agent anarchism"
CLOUD=$CLOUD" anarchy anarchist apocalypse architecture assault"
CLOUD=$CLOUD" attack babble babe banking battle begging blackmail"
CLOUD=$CLOUD" boyfriend buddy bullying caliphate capabilities cash celebrity"
CLOUD=$CLOUD" censorship chat colonialism command commuter computery conflict"
CLOUD=$CLOUD" conspiracy conversation cop cowboy crime critic crook cult"
CLOUD=$CLOUD" cyber cybering czar dating death defense dildonic dimension"
CLOUD=$CLOUD" discourse doctrine domain economy effects elite"
CLOUD=$CLOUD" emergency enterprise environment equivalents exploitation"
CLOUD=$CLOUD" erotic espionage ethics evangelist extortion fashion feminism"
CLOUD=$CLOUD" flaneur flirting forces forensics fraud freak freedom"
CLOUD=$CLOUD" friend funeral future gambling gaming gang geek generation"
CLOUD=$CLOUD" ghetto girlfriend goths government group hacker"
CLOUD=$CLOUD" harassment hatred heaven heist hero hug identity"
CLOUD=$CLOUD" immorality imperialism industry information infrastructure"
CLOUD=$CLOUD" intelligence intruder intrusion issues jargon jihad jihadi"
CLOUD=$CLOUD" journalism junk junkie kid laundering law libertarian"
CLOUD=$CLOUD" liberty literacy loafing looting locker loser lover"
CLOUD=$CLOUD" marketplace marriage martyr media mob money mosque nation"
CLOUD=$CLOUD" naut nerd network operations ostracism payment peer person"
CLOUD=$CLOUD" philosopher phobia pioneer piracy pirate police"
CLOUD=$CLOUD" politics porn pornography president"
CLOUD=$CLOUD" privacy prostitute protest punk revolution romance"
CLOUD=$CLOUD" sabotage scam security sex sexual shopper slacker"
CLOUD=$CLOUD" slut smut space spacetime sphere spy squatter "
CLOUD=$CLOUD" squatting stalker stalking strategy"
CLOUD=$CLOUD" stud team terrorism terrorist theft thief threat"
CLOUD=$CLOUD" thug trail trash trespasser utopia villain war warfare"
CLOUD=$CLOUD" warrior weapon wizard"
CLOUD_LIST=($CLOUD)
CLOUD_LENGTH=${#CLOUD_LIST[@]}
CLOUD_WORD="${CLOUD_LIST[$((RANDOM%CLOUD_LENGTH))]}"
function usage ()
{
printf '%s [OPTIONS]\n\n' "$(basename $0)"
printf 'OPTIONS\n'
printf -- '-h\t\tThis cruft.\n'
printf -- '-a\t\tAll of the cloudclouds!\n'
printf -- "-q\t\tDon't print to stdout.\n"
}
function alloftheclouds ()
{
for CLOUD_WORD in $CLOUD ; do
printf " Cloud${CLOUD_WORD}!\n"
espeak -x --ipa=1 -s 130 -k 20 -p 25 "Cloud${CLOUD_WORD}!" 2>/dev/null
done
}
quiet=
while getopts haq f; do
case $f in
h) usage ; exit 0 ;;
a) alloftheclouds ; shift ;;
q) quiet=1 ;;
# don't we need `shift 2` above? or `shift $(( OPTIND - 1))`?
esac
done
if test -z "$quiet" ; then
printf " Cloud${CLOUD_WORD}!\n"
espeak -x --ipa=1 -s 130 -k 20 -p 25 "Cloud${CLOUD_WORD}!" 2>/dev/null
else
espeak -x --ipa=1 -s 130 -k 20 -p 25 "Cloud${CLOUD_WORD}!" 1>/dev/null 2>&1
fi
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment