Bash fight on our very own server!!

Last night, I was having a discussion with my brother SIGTERMer about getting into Firefox local databases! In order to be able to poke with the history database, Firefox must be closed! You know, tens of tabs were open, so he was going through them to close Firefox! That’s when he reached the tab that made all of the this fight happen!

It was a my personal page on our server, I didn’t have time to play with it to have a good design for it, so I had back then only a few words that implies that I’ll work on that later!

The thing is, I had that page like that for more than a month now, it’s only because I forgot about it and that I am still busy!

So when my brother came across this page, he said some thing like “You know what I would like to see, this page changed!” I LOLed then said that I have forgotten about it, then I added “Hey, I does say next week! There will always be next week you know!” It’s true, next week never comes because when next week comes and you read it, it’s still next week! XD

Apparently, SIGTERMer was pissed off and wanted me to change it ASAP! I realized that when I saw him SSHing into our server, and accessing my directory! When we were configuring the server, I had both of our accounts in the sudoers file, so he had the ability of modifying my content! The first thing he added to my index.html was something like “I love ubuntu because it’s imitating Apple’s”! He was trying to piss me off! Yes, to be honest, seeing my data being changed by a non-anxious person pissed me off! So I let him do that while I, without him noticing, connected to the server using my Android phone and into the very same directory!

I launched nano and had a simple HTML code and saved it as file.txt, Then I acted like a nice guy, and without him having any clue of what I was doing, I `mv`ed the modified index.html and had mine instead and went like “Hey, can you show me my page one last time, I didn’t see it quite well”! He was a bit confused and opened a new tab and went to the URL! I laughed really hard when he saw what he wasn’t expecting! However, after a second or so, he said “Never underestimate a guy with an open text editor!” So he pressed Ctrl+O (save) and then switched to Firefox and refreshed! I was like :O “… I was acting decent and I backed up your file and that’s what you do to my file, overwrite it?!”

He was on a laptop and I was on a phone, so his actions were way faster than mine! So he also added an image to the index file, here’s the image!

Yes, I didn’t leave that pass me like that, I went and `rm *`ed the directory and said “refresh the page, will you?” He did and nothing was there! I laughed again! I was happy to see that he had exited nano (text editor), so re-saving it wasn’t a valid option! However, he laughed back at me; he had the code in his clipboard, he copied the code! And then he said “So this is how you want to play it? I wanna see how you’re gonna stop me now!” And started typing directly in bash!!

while [ 1 ]; do echo "
<img src="http://images7.cpcache.com/product/my+apple+mac-i+love+my+apple+mac-i+heart+my+apple+mac/88354767v2_225x225_Front.jpg" alt="" />
" > index.html; done &

Once he typed the word while, I kept silent because I knew the outcome of his command: regenerated files of the same content! So on my phone I inserted:

while [ 1 ]; do rm *; done &

and laughed even before he hits enter! He noticed “So you’re having it in a shorter interval!” He was being efficient; he had each loop sleep 1 second! But because he noticed what I’ve had prepared, he launched his without the sleep command! We both didn’t know who would win! He reloaded the web-page and it was his, then reloaded it again, but there was nothing! Again and again! Though it once didn’t display all the HTML code! The files we’re being generated and deleted so it wasn’t able to keep it up! XD

Then we realized that WE’RE ACTUALLY HAVING THIS FIGHT ON A SERVER!!! So we checked top processes and system load! The good thing is that the dual core server was handling them okay! It took something like 25%~30% of the processor! That made us a bit comfortable, the second after that, we were back on our fight!

Because of the top list, we were inspired to do something about the processes! I saw SIGTERMer typing again! He launched his command 11 times, so he had the upper hand! However, that wasn’t enough as another idea rushed into him! He was up to `renice -n 20`ing (giving priority to) his process to overcome my rm process so that the web-page of his code would show up 100%! I, on the other hand, because of android keyboard had to choose the simplest and shortest command that would cancel his evildoings! I spotted the process ID of his command, so I went for the killing! Pkill -9 PID, then said “I’m gonna kill it” and I hit enter! … Nothing happened! I was like “what?!”, then SIGTERMer replied with a LOL added by “you killed my session instead of the command!” I ROFLOLed and it was finally over! It turned out that I mistook the process ID with another one, but it did more than I needed! “The server needed to reboot anyways, reboot it!” “LOL, K”!

Although we we’re doing that on a SERVER, that was honestly the best and the funniest fight I ever had in my entire life! “Maybe we should do this some other time!” “… so we’re back to closing tabs and screwing with the databases!”

Advertisements

~ by AnxiousNut on December 2, 2010.

One Response to “Bash fight on our very own server!!”

  1. lol, that’s was hilarious, I was laughing the whole time XD

    now I want a server and a brother to fight over it :P

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: