Monthly Archives: June 2010

Whenever I upgrade or reinstall my 64 bit Kubuntu PC, I always have issues with the flash player, and I end up copying libraries and plugins from one place or another. This time I found a cool site (http://blog.mattrudge.net) that has this precious bit of information:
Installing Flash Player on Ubuntu 10.04 64-bit.

 

It worked like a charm 🙂

 

This is something I found online, on a linux site I have since forgotten the name. (Ping me if you know it’s origin, so I can give proper credit to the author)
Anyway, I have it in my shell’s alias’ file:

nn='netstat -an | grep ESTABLISHED | awk '\''{print $5}'\'' | awk -F: '\''{print $1}'\'' | sort | uniq -c | awk '\''{ printf("%s\t%s\t",$2,$1); for (i = 0; i < $1; i++) {printf("*")}; print ""}'\'''

It’s rather useful, as I can quickly see a graphic representation of my TCP connections, in the ESTABLISHED state.
The output is something like this:

~$ nn
10.XXX.XX.XX    1       *
10.XXX.XX.XX    5       *****
10.XXX.XX.X     2       **
143.XXX.XXX.XX  1       *
192.XXX.X.XX    1       *
208.XX.XXX.XX   1       *
212.XXX.XXX.XX  1       *
213.XX.XXX.XX   1       *

For security reasons I mangled the IP addresses with X’s. This was taken on my work PC, but imagine running it on a webserver. It might just help you figure out who’s sucking up your connections (or not).
I recently had a problem with a webserver, and this little snippet led me to find out that a certain IP address had 250 established connections to each of the frontend servers of that particular service. One iptables command later, and we could breathe again…

I’ve recently installed virtualbox on my MacBook. Originally I wanted to be able to run a copy of IE so that I can fully access some of our corporate portals. Yes, they keep building stuff “optimized” for IE, but that’s another rant.
Installation was smooth and I soon had a working copy of Windows XP running in the virtualbox. That’s when it hit me. I could use this as a testbed for deploying applications that will be running on hardware with limited resources. We can limit the disk space, and also the memory that is made available to the client system. If our application can run successfully under these limits, then it is reasonably safe to deploy it to a VPS or another similar system. If it can’t perform under these strict limits, then we can start shopping for another VPS with more resources 🙂
The idea came to me because I was recently asked to help install a CMS system complete with a database and image resizing on a VPS that only has 256 MB of RAM. It can be done, but if it gets more than a few requests, it will surely crawl to a halt. Using this technique I should be able to see how the app will behave under such strict limits, and try some tweaks to reduce memory usage.