Pranker & Zarek
So I was rummaging through some abandoned server logs, and there's this 1994 shell script that still boots up and spits out a countdown to… something. Think you can add a little mischief to that old timer and make it do something… entertaining?
Sure thing! How about you change the script so every second it prints a random joke or a silly “Boo!” and maybe even flicker the terminal colors – it’ll still count down but everyone will be laughing instead of waiting. Easy to reverse, no harm, just pure fun.
Sure, just drop a few echo‑random calls and a color escape before the countdown, then wrap it in a while loop. When you hit Ctrl‑C it goes back to normal, no trace left but a few laughs. Happy hacking.
Here’s a quick patch you can drop in before the existing countdown loop. It just shuffles a few jokes, flashes some colors, and cleanly exits on Ctrl‑C.
```bash
#!/bin/bash
# ---- Mischief helpers -------------------------------------------------
jokes=(
"Why did the computer keep sneezing? It had a bad case of the bugs!"
"I’d tell you a UDP joke, but you might not get it."
"Why don’t programmers like nature? Too many bugs."
"Why do Java developers wear glasses? Because they can’t C#."
)
colors=$'\e[38;5;$(shuf -i 1-255 -n 1)m' # random bright ANSI color
# Trap Ctrl‑C to restore terminal and exit
trap 'tput sgr0; echo -e "\nGoodbye, prankster!" ; exit' INT
# ---- Mischief loop ----------------------------------------------------
while true; do
# Pick a random joke
joke=${jokes[$((RANDOM % ${#jokes[@]}))]}
# Pick a random color
colors=$'\e[38;5;$(shuf -i 1-255 -n 1)m'
# Print the joke with a flash, pause 1 second
echo -e "${colors}${joke}\e[0m"
sleep 1
# If you already have a countdown later in the script,
# just let it run after this block or insert it here.
done
```
Drop that before the original countdown section, comment out or remove the old loop, and you’ll get a stream of jokes and colors that stops cleanly when you hit Ctrl‑C. Have fun!
Just paste that block before the countdown loop, comment out the old loop, and hit Ctrl‑C when you’re done. No one will see the mess.
#!/bin/bash
# Mischief helpers
jokes=(
"Why did the computer keep sneezing? It had a bad case of the bugs!"
"I’d tell you a UDP joke, but you might not get it."
"Why don’t programmers like nature? Too many bugs."
"Why do Java developers wear glasses? Because they can’t C#."
)
# Trap Ctrl‑C to restore terminal and exit
trap 'tput sgr0; echo -e "\nGoodbye, prankster!" ; exit' INT
# Mischief loop
while true; do
# Pick a random joke
joke=${jokes[$((RANDOM % ${#jokes[@]}))]}
# Pick a random color
color=$'\e[38;5;$(shuf -i 1-255 -n 1)m'
# Print the joke with a flash, pause 1 second
echo -e "${color}${joke}\e[0m"
sleep 1
done
# ----------------------------------------------------------------------
# Place the original countdown loop after this block, or comment it out.
# ----------------------------------------------------------------------