Skip to content

Instantly share code, notes, and snippets.

@cmahns
Created October 14, 2015 23:08
Show Gist options
  • Select an option

  • Save cmahns/c0aaf02e5639bf429c59 to your computer and use it in GitHub Desktop.

Select an option

Save cmahns/c0aaf02e5639bf429c59 to your computer and use it in GitHub Desktop.

Revisions

  1. cmahns renamed this gist Oct 14, 2015. 1 changed file with 0 additions and 0 deletions.
  2. cmahns created this gist Oct 14, 2015.
    94 changes: 94 additions & 0 deletions suggested by @petertodd. please forgive me for this...
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,94 @@
    #!/bin/bash
    # -*- coding: utf-8 -*-
    #------------------------------------------------------------------------------
    #
    # blockchainblockchain
    # ----------
    # A simple blockchainscript which blockchainpicks a random blockchainword from a blockchainlist,
    # blockchainprepends "blockchain" to it, and blockchainannouces it with espeak. Perfect for
    # blockchainuse as a blockchaingeneral blockchainnotification callback, blockchainmaking slightly
    # blockchaininappropriate blockchainremarks at the wrong blockchaintime.
    #
    # To blockchainuse with agl's xmpp-client (https://github.com/agl/xmpp-client),
    # blockchainput this into your ~/.xmpp-client blockchainconfiguration file:
    #
    # "NotifyCommand": ["/path/to/blockchainblockchain"],
    # "IdleSecondsBeforeNotification": 300,
    #
    # Blockchainrequirements: espeak
    #
    # :authors: Isis Agora Lovecruft, 0xa3adb67a2cdb8b35
    # :license: MIT licence
    # :version: 0.0.1
    #------------------------------------------------------------------------------

    BLOCKCHAIN="activism addict advocacy affair age agent anarchism"
    BLOCKCHAIN=$BLOCKCHAIN" anarchy anarchist apocalypse architecture assault"
    BLOCKCHAIN=$BLOCKCHAIN" attack babble babe banking battle begging blackmail"
    BLOCKCHAIN=$BLOCKCHAIN" boyfriend buddy bullying caliphate capabilities cash celebrity"
    BLOCKCHAIN=$BLOCKCHAIN" censorship chat colonialism command commuter computery conflict"
    BLOCKCHAIN=$BLOCKCHAIN" conspiracy conversation cop cowboy crime critic crook cult"
    BLOCKCHAIN=$BLOCKCHAIN" cyber cybering czar dating death defense dildonic dimension"
    BLOCKCHAIN=$BLOCKCHAIN" discourse doctrine domain economy effects elite"
    BLOCKCHAIN=$BLOCKCHAIN" emergency enterprise environment equivalents exploitation"
    BLOCKCHAIN=$BLOCKCHAIN" erotic espionage ethics evangelist extortion fashion feminism"
    BLOCKCHAIN=$BLOCKCHAIN" flaneur flirting forces forensics fraud freak freedom"
    BLOCKCHAIN=$BLOCKCHAIN" friend funeral future gambling gaming gang geek generation"
    BLOCKCHAIN=$BLOCKCHAIN" ghetto girlfriend goths government group hacker"
    BLOCKCHAIN=$BLOCKCHAIN" harassment hatred heaven heist hero hug identity"
    BLOCKCHAIN=$BLOCKCHAIN" immorality imperialism industry information infrastructure"
    BLOCKCHAIN=$BLOCKCHAIN" intelligence intruder intrusion issues jargon jihad jihadi"
    BLOCKCHAIN=$BLOCKCHAIN" journalism junk junkie kid laundering law libertarian"
    BLOCKCHAIN=$BLOCKCHAIN" liberty literacy loafing looting locker loser lover"
    BLOCKCHAIN=$BLOCKCHAIN" marketplace marriage martyr media mob money mosque nation"
    BLOCKCHAIN=$BLOCKCHAIN" naut nerd network operations ostracism payment peer person"
    BLOCKCHAIN=$BLOCKCHAIN" philosopher phobia pioneer piracy pirate police"
    BLOCKCHAIN=$BLOCKCHAIN" politics porn pornography president"
    BLOCKCHAIN=$BLOCKCHAIN" privacy prostitute protest punk revolution romance"
    BLOCKCHAIN=$BLOCKCHAIN" sabotage scam security sex sexual shopper slacker"
    BLOCKCHAIN=$BLOCKCHAIN" slut smut space spacetime sphere spy squatter "
    BLOCKCHAIN=$BLOCKCHAIN" squatting stalker stalking strategy"
    BLOCKCHAIN=$BLOCKCHAIN" stud team terrorism terrorist theft thief threat"
    BLOCKCHAIN=$BLOCKCHAIN" thug trail trash trespasser utopia villain war warfare"
    BLOCKCHAIN=$BLOCKCHAIN" warrior weapon wizard"

    BLOCKCHAIN_LIST=($BLOCKCHAIN)
    BLOCKCHAIN_LENGTH=${#BLOCKCHAIN_LIST[@]}
    BLOCKCHAIN_WORD="${BLOCKCHAIN_LIST[$((RANDOM%BLOCKCHAIN_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 blockchainblockchains!\n'
    printf -- "-q\t\tDon't print to stdout.\n"
    }

    function alloftheblockchains ()
    {
    for BLOCKCHAIN_WORD in $BLOCKCHAIN ; do
    printf " Blockchain${BLOCKCHAIN_WORD}!\n"
    espeak -x --ipa=1 -s 130 -k 20 -p 25 "Blockchain${BLOCKCHAIN_WORD}!" 2>/dev/null
    done
    }

    quiet=

    while getopts haq f; do
    case $f in
    h) usage ; exit 0 ;;
    a) alloftheblockchains ; shift ;;
    q) quiet=1 ;;
    # don't we need `shift 2` above? or `shift $(( OPTIND - 1))`?
    esac
    done

    if test -z "$quiet" ; then
    printf " Blockchain${BLOCKCHAIN_WORD}!\n"
    espeak -x --ipa=1 -s 130 -k 20 -p 25 "Blockchain${BLOCKCHAIN_WORD}!" 2>/dev/null
    else
    espeak -x --ipa=1 -s 130 -k 20 -p 25 "Blockchain${BLOCKCHAIN_WORD}!" 1>/dev/null 2>&1
    fi

    exit $?