If you want to prank a co-workers’s Linux laptop, wait until they walk away without locking it, and add this quickie to their ~/.bashrc config file. Bonus: works on Mac’s too.
export PROMPT_COMMAND=”tput sc;tput cup 0 5;tput bold;tput blink;tput rev;printf %s ‘**** CODE 9 EMERGENCY EMERGENCY EMERGENCY CODE 9 ****’;tput rc”
It will activate the next time they open a command line terminal window.
If you want to know what it does, tput is a command to output terminal management codes. “tput sc” saves the current cursor position. It’s companion “tput rc” restores the cursor to the original saved location, and it also restores the original video mode (in other words, turns off bold font, blinking and reverse text). “tput cup row# column#” moves the cursor to row row# column column#. “printf %s ‘string'” is a fancy way to output a formatted string at the current cursor location. “tput bold”, “tput blink” and “tput rev” cause the video to use a bold font, blink on and off, and use reverse background/foreground colors.
The Bash command shell assumes the environment variable PROMPT_COMMAND contains a list of shell commands to run before displaying the shell prompt. Every time they press enter, it runs again, so they can’t easily clear or reset the terminal to get rid of the message.
Alternate messages to put up there include some form of “WARNING! SYSTEM COMPROMISED! Shut off your computer’s power ASAP, and contact your divisions Corporate Security Officer for further instructions before powering back on.”