dot

packages and services management
Log | Files | Refs | README

commit 2584f1678992dec2091241cd41334698006aae17
parent 4cf4edee0d16b44cb6f8bbfccdc130e43620a93b
Author: Josuah Demangeon <mail@josuah.net>
Date:   Wed, 26 Apr 2017 10:43:19 +0200

now with an argument

Diffstat:
Mbin/fun-psyche | 87++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------
Abin/fun-troll | 42++++++++++++++++++++++++++++++++++++++++++
Dbin/io-troll | 78------------------------------------------------------------------------------
3 files changed, 102 insertions(+), 105 deletions(-)

diff --git a/bin/fun-psyche b/bin/fun-psyche @@ -1,8 +1,15 @@ +set -- $( + printf '%s\n' "$*" | fold -w 1 | sed 's/[\t ]/_/; /^$/ s/^/_/' + seq 10 | sed 's/.*/_/' +) + b="$(printf '\033[31;1m')" e="$(printf '\033[0m')" r="$(printf '\033[7m')" -printf '\033[H\033[2J%s' ' +printf '\033[2J' + +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ @@ -22,7 +29,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ @@ -42,7 +49,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\'$b'\\o|||'$e'|//______/ \ \_____/ .__\_____:__ @@ -62,7 +69,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ '$b'/// '$e'/_____,(_X_) ____ \___ __/ __ '$b'\\\\\o||||//'$e'______/ \ \_____/ .__\_____:__ @@ -82,7 +89,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ '$b' _'$e' ___ ___,--._________ _/ __'$b'__\ ||/ /// /_____'$e',(_X_) ____ \___ __/ '$b'__ \\\\\'$e'o'$b'||||//______/'$e' \ \_____/ .__\_____:__ @@ -102,7 +109,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' '$b'_____'$e' _ '$b'___'$e' ___,--._________ '$b'_/ __'$e'__'$b'\'$e' ||/ '$b'/// /'$e'_____'$b','$e'(_X_) ____ \___ '$b'__/'$e' __ \'$b'\'$e'\\\o||||//___'$b'___/'$e' \ \_____/ .__\_____:__ @@ -122,7 +129,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ '$b'_'$e'/ ____\ ||/ /// /_____,(_'$b'X'$e'_) ____ \___ '$b'_'$e'_/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ @@ -142,7 +149,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ @@ -162,7 +169,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_'$b'X'$e'_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ @@ -182,7 +189,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___'$b',--._________'$e' _/ ____\ ||/ /// /_____,(_X_) ____ '$b'\___'$e' __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ @@ -202,7 +209,7 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ '$b'\___'$e' __/ __ \\\\\o||||//______/ \ \_____/ .__\_____'$b':'$e'__ @@ -222,13 +229,13 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:'$b'=:'$e'__ || || || || || ||'$r' '$e'|| || ||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:'$b'=:'$e'__ || || || || || ||'$r$6$e'|| || ||'$r$9$e'||'$r${10}$e'|| ::=:| |:'$b'=:'$e'__\ |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:'$b'=.'$e'_ \\_/--/--/--/--/--'$b'/'$e'--/--/--'$b'/'$e'--'$b'/'$e'--" ::=:| ___ |:'$b'=.'$e'_\ \___/ / / _/ / '$b'/'$e' / / / @@ -242,13 +249,13 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:'$b'__'$e' || || || || || ||'$r' '$e'|| || ||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:=:'$b'__'$e' || || || || || ||'$r$6$e'|| || ||'$r$9$e'||'$r${10}$e'|| ::=:| |:=:'$b'__'$e'\ |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:=.'$b'_ '$e'\\_/--/--/--/--/--/--'$b'/'$e'--'$b'/'$e'--/--/--" ::=:| ___ |:=.'$b'_\'$e' \___/ / / _/ / '$b'/ /'$e' / / @@ -262,13 +269,13 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:_'$b'_'$e' || || || || || ||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:=:_'$b'_'$e' || || || || || ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| ::=:| |:=:_'$b'_\'$e' |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:=._'$b' \\_/'$e'--'$b'/'$e'--/--/--/--/--'$b'/'$e'--'$b'/'$e'--/--/--" ::=:| ___ |:=._'$b'\ \___/'$e' / / _/ / / / / / @@ -282,13 +289,13 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r' '$e'||'$r' '$e'|| || || ||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'|| || || ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:=._ \\_'$b'/'$e'--'$b'/'$e'--/--/--/--/--/--/--/--/--" ::=:| ___ |:=._\ \___/ '$b'/'$e' / _/ / / / / / @@ -302,13 +309,13 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r' '$e'||'$r' '$e'|| || || ||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'|| || || ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:=._ \\_/--/--'$b'/'$e'--'$b'/'$e'--/--/--/--/--/--/--" ::=:| ___ |:=._\ \___/ '$b'/ / _/'$e' / / / / / @@ -322,13 +329,13 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'|| ||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'|| ||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:=._ \\_/--/--'$b'/'$e'--'$b'/'$e'--'$b'/'$e'--/--/--/--/--/--" ::=:| ___ |:=._\ \___/ / / '$b'_/'$e' / / / / / @@ -342,13 +349,13 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'||'$r$5$e'||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--'$b'/'$e'--/--/--/--/--" ::=:| ___ |:=._\ \___/ / / _/ / / / / / @@ -362,13 +369,38 @@ printf '\033[H\033[2J%s' ' sleep 0.05 -printf '\033[H\033[2J%s' ' +printf '\033[H%s' ' + _____ _ ___ ___,--._________ + _/ ____\ ||/ /// /_____,(_X_) ____ \___ + __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ + ___/ _|||||||||||||_ \________|___________|_________ + | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| + ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'||'$r$5$e'||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| + ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| + ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" + ::=:| ___ |:=._\ \___/ / / _/ / / / / / + ::=;| _____________ |:=._\\______/ / / __/ / / / / + _/ |_______________| \\________/ / / ___/ / / / + (_)__//|||||||\\\\\\_____ \_________/ / (_)___/ _/ _/ + |\__/ ||""""" |||\\____ \___________/ _______/ / + | |-|TTTT|//" \___ \______________/ ________/ + (_) `-|____|/_______\________________/ +' + +[ "$#" -gt 10 ] && sleep 1 + +while [ "$#" -gt 10 ] +do + shift + sleep 0.1 + + printf '\033[H%s' ' _____ _ ___ ___,--._________ _/ ____\ ||/ /// /_____,(_X_) ____ \___ __/ __ \\\\\o||||//______/ \ \_____/ .__\_____:__ ___/ _|||||||||||||_ \________|___________|_________ | _____________ | C22 |.-..-..-..-..-..-..-..-..-..-.| - ::=:| ___ |:=:__ ||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'||'$r' '$e'|| + ::=:| ___ |:=:__ ||'$r$1$e'||'$r$2$e'||'$r$3$e'||'$r$4$e'||'$r$5$e'||'$r$6$e'||'$r$7$e'||'$r$8$e'||'$r$9$e'||'$r${10}$e'|| ::=:| |:=:__\ |:=::=::=::=::=::=::=::=::=::=:| ::=:| P S Y C H E |:=._ \\_/--/--/--/--/--/--/--/--/--/--" ::=:| ___ |:=._\ \___/ / / _/ / / / / / @@ -379,3 +411,4 @@ printf '\033[H\033[2J%s' ' | |-|TTTT|//" \___ \______________/ ________/ (_) `-|____|/_______\________________/ ' +done diff --git a/bin/fun-troll b/bin/fun-troll @@ -0,0 +1,42 @@ +# troll + + +troll() +{ + printf '\033[%d;%dH' "$2" "$1" + + printf '\033[10C\v%s' ',--------.' + printf '\033[11D\v%s' '/ ,===-=== `.' + printf '\033[14D\v%s' '//__(*= (*-.\\' + printf '\033[16D\v%s' '(((,__` ,c-).~~))' + printf '\033[16D\v%s' '\ \ `------'\''||' + printf '\033[14D\v%s' '\ `-.______, |' + printf '\033[18D\v%s' ' `-._ ------ |' + printf '\033[9D\v%s' '`-.____/' +} + + +main() +{ + size="$(stty size)" + + hexdump -d /dev/random | + sed 's/[^ ]* *//; s/[0 ]\+/\n/g' | sed '/^$/ d' | + while read num + do + if [ -z "$row" ] + then + [ "$num" -lt "${size#* }" ] && row="$num" + + elif [ -z "$col" ] + then + [ "$num" -lt "${size% *}" ] && col="$num" + else + troll "$row" "$col" + row='' col='' + fi + done +} + + +main "$@" diff --git a/bin/io-troll b/bin/io-troll @@ -1,78 +0,0 @@ -# troll - - -troll() -{ - printf '\033[%d;%dH' "$2" "$1" - - printf '\033[10C\v%s' ',--------.' - printf '\033[11D\v%s' '/ ,===-=== `.' - printf '\033[14D\v%s' '//__(*= (*-.\\' - printf '\033[16D\v%s' '(((,__` ,c-).~~))' - printf '\033[16D\v%s' '\ \ `------'\''||' - printf '\033[14D\v%s' '\ `-.______, |' - printf '\033[18D\v%s' ' `-._ ------ |' - printf '\033[9D\v%s' '`-.____/' -} - - -roll() -{ - size="$(stty size)" - - hexdump -d /dev/random | - sed 's/[^ ]* *//; s/[0 ]\+/\n/g' | sed '/^$/ d' | - while read num - do - if [ -z "$row" ] - then - [ "$num" -lt "${size#* }" ] && row="$num" - - elif [ -z "$col" ] - then - [ "$num" -lt "${size% *}" ] && col="$num" - else - troll "$row" "$col" - row='' col='' - fi - done -} - - -main() -{ - iomenu -l 30 -p troll << EOF | grep troll && roll - holl ooll coll - troll - ,--------. troll - ^oll voll ^oll voll oll loll vroll - / ,===-=== \`. troll - /oll //^\\\\ \\oll - ///^\\\\\\\\\\ \\oll trall - ////^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\oll trod - /////^\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ - //////^\\\\\\\\\\\\\\\\\\\\loll\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ holl - //__(*= (*-.\\\\ troll troll - )))tr______(___)_________trill____________________oll - (((========)===(===================================== - ))) ( (( moll doll zoll coll ooll roll coll - (((,__\` ,c-).~~)) troll - / / / /trovovo / / \\ \\ \\ floll woll - \\ \\ \\ \\ \\ | \\ \\ / / / toll - / / / / trololo/ / \\ \\ \\ yoll roll - \\ \\ \`------'|| troll - trololo | | | | | doll woll poll - \\ \`-.______, | troll - moll ~~~trololo~ l ~~~ moll ioll - \`/ \`/_ \`\\tralala \`/ \`/{}_ _\\ _\\ - \`-._ ------ | troll - rolls _\\_\\_\\trilili\\ /_/_/_/_/_/_/ ~~~~~~~~~~~~\`\` - troll \`-.____/ - _.-' \\ \\-\\ oll trololo -/ \\ ~ -- / \\\\ roll troo moll trololo - troll -EOF -} - - -main "$@"