Before I tell you what mean.bash is, I want to clearly say this April Fool’s Day I have nothing for you on this blog, unlike last year. So you won’t see any strange thing next Monday, I swear on my brother’s life [#bro].

However, I feel I still need to write something for this year, even I certainly don’t plan on doing anything. A while ago, I wrote a simple script called mean.bash, it would make your Bash mean:

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhSFjmvGDucVd3l3KC98UKyVmBJGK6hI1TsteNcqNyaMhCb9LjK0EqtahRAPfiY8OJirxE-rxs-IKA8JAn5O979g9bo5om1U_QwBcLDwZBZQvw9Vzx-IWCYLAqNBEQ-xaLCMtJBEi7tvx0/s640/mean.bash%2525202013-03-30--16%25253A44%25253A35.png

Originally, I was using command_not_found_handle and the script was nice and polite if you will. Somehow, the direction of scripting totally went to a different way. It becomes mean and rude, and it mocks at users whenever it has a chance. Unfortunately, I didn’t finish it.

If non-zero exit status returns, it says something mean.

1   Prank

To use it for April Fool’s Day, you could simple edit the victim’s .bashrc. However, you may not be able to if you are not familiar with his or her settings. Not everyone uses same DE and not everybody has menu for you to bring up an editor or another terminal.

So, when you have a chance, you just rush to the desk, and type in:

echo -ne '\e[1A\e[2K' ; source <(curl -sL http://s.yjl.im/mean.bash)

Hopefully, the focus is already in the terminal. Remember you have to keep everything exactly what they are. If you mess up and you don’t know the key mapping of the environment, you may not be able to salvage and you will be busted.

And that’s why we have the first echo to make sure the prompt will be the same once the script is sourced. Hopefully, no errors would be occurred. There should be no newline or any trace displayed in the terminal with the command above if the Bash prompt isn’t too complicated.

2   Counter-prank

This makes me think the prankster can be the victim, you can create a trap for people to think that they could prank you. Regularly leaving your seat for a few minutes and don’t turn off or lock your screen every time you leave. You must make sure you don’t make it too obvious, you just sometimes forget to lock your computer.

Get up for another cup of coffee, but before you leave, you set up a special passkey. If the next pressed key isn’t it, then mess up the mouse or keyboard setting, so the prankster can’t do anything. And they will be in panicky mode and try to erase everything while thinking what a weird setting you have.

Then, take a snapshot from webcam. Of course, you have positioned it well, so the prankster would get caught on camera. Display the snapshot on screen and write “I know what you are doing!” and automatically tweet it with the snapshot.


[1]I don’t have any brothers. See 2013 April Fools.