PDA

View Full Version : A linux/unix script for Christmas (safe)



AMDave
12-24-2013, 09:22 PM
Thanks to Daniel on G+

install gawk if not already installed
open console / terminal in full screen
paste the following code

clear;while :;do echo $LINES $COLUMNS $(($RANDOM%$COLUMNS)) $(printf "\u2743\n");sleep 0.1;done|gawk '{a[$3]=0;for(x in a) {o=a[x];a[x]=a[x]+1;printf "\033[%s;%sH ",o,x;printf "\033[%s;%sH%s \033[0;0H",a[x],x,$4;}}'
hit enter
ctrl-C to stop


Merry Christmas :)

AMDave
12-24-2018, 09:56 PM
It appears the original credit goes to climagic in 2011
http://climagic.org/coolstuff/let-it-snow.html
still works
now has shorter versions using some nifty hacks.

AMDave
12-24-2018, 10:21 PM
$ sudo apt install cowsay

the cowfiles should be here (ymmv)
$ ls /usr/share/cowsay/cows
there is an open bug for xmas-tree file missing, but have a look at the simple 'cow' file format and you can easily get the kids to make their own cow files



$ cowsay -f daemon Merry Christmas
_________________
< Merry Christmas >
-----------------
\ , ,
\ /( )`
\ \ \___ / |
/- _ `-/ '
(/\/ \ \ /\
/ / | ` \
O O ) / |
`-^--'`< '
(_.) _ ) /
`.___/` /
`-----' /
<----. __ / __ \
<----|====O)))==) \) /====
<----' `--' `.__,' \
| |
\ /
______( (_ / \______
,' ,-----' | \
`--{__________) \/

$ cowsay -f dragon Merry Christmas
_________________
< Merry Christmas >
-----------------
\ / \ //\
\ |\___/| / \// \\
/0 0 \__ / // | \ \
/ / \/_/ // | \ \
@_^_@'/ \/_ // | \ \
//_^_/ \/_ // | \ \
( //) | \/// | \ \
( / /) _|_ / ) // | \ _\
( // /) '/,_ _ _/ ( ; -. | _ _\.-~ .-~~~^-.
(( / / )) ,-{ _ `-.|.-~-. .~ `.
(( // / )) '/\ / ~-. _ .-~ .-~^-. \
(( /// )) `. { } / \ \
(( / )) .----~-.\ \-' .~ \ `. \^-.
///.----..> \ _ -~ `. ^-` ^-_
///-._ _ _ _ _ _ _}^ - - - - ~ ~-- ,.-~
/.-~

AMDave
12-24-2018, 10:26 PM
Wow. It still works!

$ sudo apt install caca-utils

$ cacafire

maximize the window and feel the chilblains ebbing away