文系プログラマによるTIPSブログ

文系プログラマ脳の私が開発現場で学んだ事やプログラミングのTIPSをまとめています。

echo-sdとcowsayによる煽りのススメ

皆さん煽ってますか?
f:id:treeapps:20160712004853p:plain
CI等でガンガンビルドエラーを出す人等がいてイライラしている方、彼らを煽ってみませんか?

今回紹介する煽りコマンドは「echo-sd」と「cowsay」の2つです。

echo-sd

>突然の死<ジェネレーター - 拡張 POSIX シェルスクリプト Advent Calendar 2013 - ダメ出し Blog

echo-sdは「突然の死ジェネレータ」のコマンド(シェルスクリプト)です。

インストールの仕方は↑のオフィシャルサイトをご覧下さい。

さて、ではまずはヘルプを見てみましょうか。

tree:~ tree$ echo-sd --help
_人人人人人人人人人人人人人人人人人人人人人人人人人人人人人人_
> _人人人人人人_                      <
> > 突然の死 < ジェネレーター              <
>  ̄Y^Y^Y^Y^Y^Y^ ̄                      <
> Usage: echo-sd [OPTIONS] [SCRIPT ...]           <
>                               <
> Options:                          <
>  --help                          <
>   Print this message                   <
>  -v, --vertical                      <
>   Print scripts vertically                <
>  -t, --tweet                        <
>   Tweet in Twitter                    <
>  -h, --header HEADER                    <
>  -f, --footer FOOTER                    <
>   Header and footer script(s)              <
>  -s, --read-stdin                     <
>   Read scripts from stdin                <
>  --stress                         <
>   "Stress" mode                     <
>  --tanzaku                         <
>   "Tanzaku" mode                     <
>  --stream                         <
>   Stream mode                      <
>  --center                         <
>   Center scripts (not implemented in vertical mode yet) <
>  -R, --no-round                      <
>   Do not round border                  <
>  --square                         <
>   Square border                     <
>  -p, --padding SIZE                    <
>  --pt, --padding-top SIZE                 <
>  --pb, --padding-bottom SIZE                <
>  --pl, --padding-left SIZE                 <
>  --pr, --padding-right SIZE                <
>   Padding size                      <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
tree:~ tree$

ヘルプが既に突然の死!

なんかオプションが結構充実してるので、順に見ていきましょうか。

通常の煽り

tree:~ tree$ echo-sd "@tree のコミットでビルドエラー!"
_人人人人人人人人人人人人人人人人人人_
> @tree のコミットでビルドエラー! <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄

垂直に煽る

tree:~ tree$ echo-sd -v "@tree のコミットでビルドエラー!" "どうするつもりだ"
_人人人人_
> ど @ <
> う t <
> す r <
> る e <
> つ e <
> も   <
> り の <
> だ コ <
>   ミ <
>   ッ <
>   ト <
>   で <
>   ビ <
>   ル <
>   ド <
>   エ <
>   ラ <
>   | <
>   ! <
 ̄Y^Y^Y^Y^ ̄

ヘッダー・フッター付きで煽る

tree:~ tree$ echo-sd -h "お前のせい" -f "早くなおせ" "@tree のコミットでビルドエラー!"
お前のせい
_人人人人人人人人人人人人人人人人人人_
> @tree のコミットでビルドエラー! <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄
早くなおせ

ストレスモードで煽る

tree:~ tree$ echo-sd --stress "@tree のコミットでビルドエラー!" "ぼくがおこる" "いらいらする" "あたりちらしたい" "うわああああ! https://youtube.com/watch?v=USUu40edeQ8"
@tree のコミットでビルドエラー!
    ↘
   ぼくがおこる
    ↙
いらいらする
    ↘
   あたりちらしたい
    ↙
_人人人人人人人人人人人人人人人人人人人人人人人人人人人人人_
> うわああああ! https://youtube.com/watch?v=USUu40edeQ8 <
 ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄

あまりの怒りにぼくはこうなっちゃいます↓
youtube.com

短冊で煽る

tree:~ tree$ echo-sd --tanzaku "@tree のビルドエラーが早く解消されますように"
┏-┷-┓
┃ @ ┃
┃ t ┃
┃ r ┃
┃ e ┃
┃ e ┃
┃  ┃
┃ の ┃
┃ ビ ┃
┃ ル ┃
┃ ド ┃
┃ エ ┃
┃ ラ ┃
┃ | ┃
┃ が ┃
┃ 早 ┃
┃ く ┃
┃ 解 ┃
┃ 消 ┃
┃ さ ┃
┃ れ ┃
┃ ま ┃
┃ す ┃
┃ よ ┃
┃ う ┃
┃ に ┃
┗━━┛

パディングして煽る

tree:~ tree$ echo-sd -p 3 "@tree のコミットでビルドエラー!"
  _人人人人人人人人人人人人人人人人人人_
 >                   <
 >                    <
>   @tree のコミットでビルドエラー!   <
 >                    <
 >                   <
   ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^ ̄


mentionで名指しで煽ると効果的ですよ!


くっ・・・こいつ・・・殴りてぇ・・・俺が起こしたビルドエラーだから強く言えない・・・!

cowsay

github.com

続いて皆大好きcowsayです。

こいつはですね・・・・かわいいアスキーアートのキャラに喋らせる事ができるコマンドなのです。

しかしですね・・・・

ちょっとこれ見て下さい。

f:id:treeapps:20160711235121p:plain

f:id:treeapps:20160711235656p:plain

f:id:treeapps:20160711235811p:plain


何がかわいいキャラだ!!この目は完全に煽ってるじゃねーか!!!しかもキャラがくっそ沢山用意されてるじゃねーか!!


よし、じゃあ数キャラ見てみようか

残念ながら2バイト文字が上手く扱えなくてずれてしまうので、英語で試してみます。

なお、cowsayには煽りキャラが46体も用意されているので、一部抜粋とします。どんなキャラが指定できるかは以下で確認する事ができます。

tree:~ tree$ cowsay -l
Cow files in /usr/local/Cellar/cowsay/3.03/share/cows:
beavis.zen bong bud-frogs bunny cheese cower daemon default dragon
dragon-and-cow elephant elephant-in-snake eyes flaming-sheep ghostbusters
head-in hellokitty kiss kitty koala kosh luke-koala meow milk moofasa moose
mutilated ren satanic sheep skeleton small sodomized stegosaurus stimpy
supermilker surgery telebears three-eyes turkey turtle tux udder vader
vader-koala www

beavis.zen で煽る

tree:~ tree$ cowsay -f beavis.zen "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
   \         __------~~-,
    \      ,'            ,
          /               \
         /                :
        |                  '
        |                  |
        |                  |
         |   _--           |
         _| =-.     .-.   ||
         o|/o/       _.   |
         /  ~          \ |
       (____@)  ___~    |
          |_===~~~.`    |
       _______.--~     |
       \________       |
                \      |
              __/-___-- -__
             /            _ \

bong で煽る

tree:~ tree$ cowsay -f bong "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
         \
          \
            ^__^
    _______/(oo)
/\/(       /(__)
   | W----|| |~|
   ||     || |~|  ~~
             |~|  ~
             |_| o
             |#|/
            _+#+_

bud-frogs で煽る

tree:~ tree$ cowsay -f bud-frogs "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
     \
      \
          oO)-.                       .-(Oo
         /__  _\                     /_  __\
         \  \(  |     ()~()         |  )/  /
          \__|\ |    (-___-)        | /|__/
          '  '--'    ==`-'==        '--'  '

bunny で煽る

tree:~ tree$ cowsay -f bunny "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
  \
   \   \
        \ /\
        ( )
      .( o ).

cheese で煽る

tree:~ tree$ cowsay -f cheese "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
   \
    \
      _____   _________
     /     \_/         |
    |                 ||
    |                 ||
   |    ###\  /###   | |
   |     0  \/  0    | |
  /|                 | |
 / |        <        |\ \
| /|                 | | |
| |     \_______/   |  | |
| |                 | / /
/||                 /|||
   ----------------|
        | |    | |
        ***    ***
       /___\  /___\

cower で煽る

tree:~ tree$ cowsay -f cower "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
     \
      \
        ,__, |    |
        (oo)\|    |___
        (__)\|    |   )\_
             |    |_w |  \
             |    |  ||   *

             Cower....

daemon で煽る

tree:~ tree$ cowsay -f daemon "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
   \         ,        ,
    \       /(        )`
     \      \ \___   / |
            /- _  `-/  '
           (/\/ \ \   /\
           / /   | `    \
           O O   ) /    |
           `-^--'`<     '
          (_.)  _  )   /
           `.___/`    /
             `-----' /
<----.     __ / __   \
<----|====O)))==) \) /====
<----'    `--' `.__,' \
             |        |
              \       /
        ______( (_  / \______
      ,'  ,-----'   |        \
      `--{__________)        \/

dragon で煽る

tree:~ tree$ cowsay -f dragon "@tree Holy shit"
 _________________
< @tree Holy shit >
 -----------------
      \                    / \  //\
       \    |\___/|      /   \//  \\
            /0  0  \__  /    //  | \ \
           /     /  \/_/    //   |  \  \
           @_^_@'/   \/_   //    |   \   \
           //_^_/     \/_ //     |    \    \
        ( //) |        \///      |     \     \
      ( / /) _|_ /   )  //       |      \     _\
    ( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.
  (( / / )) ,-{        _      `-.|.-~-.           .~         `.
 (( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \
 (( /// ))      `.   {            }                   /      \  \
  (( / ))     .----~-.\        \-'                 .~         \  `. \^-.
             ///.----..>        \             _ -~             `.  ^-`  ^-_
               ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~
                                                                  /.-~


なんでこう海外のキャラは可愛く無いんだろうな


どのキャラ見ても煽ってるようにしか見えないぞ!!どれもこれもぶん殴りたくなる顔してやがる


しかもこれが46キャラも用意されているなんて・・・作者はそこまでして煽りたかったのか

雑感

いかがでしたでしょうか。

日本語に対応しているecho-sdはなかなかオプションも豊富だし、突然の死は誰でも知っていると思うので、簡単に解りやすく煽る事ができると思います。

cowsayは実はansibleにも使われていて、cowsayがインストールされている状態でansibleを実行すると、以下のようにcowsayのキャラが煽りながら途中経過を表示してくれたりします。

tree:playbook tree$ ./playbook.sh
 ___________
< PLAY [db] >
 -----------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

 ______________
< TASK [setup] >
 --------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

fatal: [192.168.33.31]: UNREACHABLE! => {"changed": false, "msg": "timed out", "unreachable": true}
	to retry, use: --limit @playbook.retry
 ____________
< PLAY RECAP >
 ------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

192.168.33.31              : ok=0    changed=0    unreachable=1    failed=0

ちょっと行が無駄に増えて実用性が皆無だし、何より他人を煽るためのcowsayなのに、playbookを実行した本人が煽られるという許しがたい状況に陥るという致命的な欠陥があります。うっかりcowsay表示をオンにしてansibleのplaybookを実行してしまうとキレそうになるので注意して下さい。

なお、cowsayオプションはデフォルトで有効になっているという鬼畜仕様になっており、煽りをやめさせるには以下の環境変数で調整する必要があります。

# cowsayの煽りをやめさせる
export ANSIBLE_NOCOWS=1
# 煽るキャラを設定する
export ANSIBLE_COW_SELECTION=random

もしくはansible.cfgに以下を記述する事で煽りをやめさせる事ができます。

nocows=1

http://docs.ansible.com/ansible/intro_configuration.html#nocows

もしうっかりcowsayされてしまった場合は、以下を見て心を落ち着かせて下さい。
youtube.com