Before I tell you what mean.bash is, I want to clearly say this April Fools Day I have nothing for you on this blog, unlike last year. So you wont see any strange thing next Monday, I swear on my brothers life [#bro].
However, I feel I still need to write something for this year, even I certainly dont plan on doing anything. A while ago, I wrote a simple script called mean.bash, it would make your Bash mean:
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 didnt finish it.
If non-zero exit status returns, it says something mean.
1 Prank
To use it for April Fools Day, you could simple edit the victims .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 dont know the key mapping of the environment, you may not be able to salvage and you will be busted.
And thats 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 isnt 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 dont turn off or lock your screen every time you leave. You must make sure you dont 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 isnt it, then mess up the mouse or keyboard setting, so the prankster cant 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 dont have any brothers. See 2013 April Fools. |