Process state codes in Linux
0Ever wondered what the STAT column in your process list does? How to differentiate between S and Sl? This handy list given below helps you figure out the state of each process on your system. Here are the different values that the column header “STAT” or “S” will display to describe the current execution state of a process.
D Uninterruptible sleep (usually IO)
R Running or runnable (on run queue)
S Interruptible sleep (waiting for an event to complete)
T Stopped, either by a job control signal or because it is being traced.
W paging (not valid since the 2.6.xx kernel)
X dead (should never be seen)
Z Defunct ("zombie") process, terminated but not reaped by its parent.
For BSD formats and when the stat keyword is used, additional characters may be displayed: < high-priority (not nice to other users) N low-priority (nice to other users) L has pages locked into memory (for real-time and custom IO) s is a session leader l is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) + is in the foreground process group
Amazon Cloudformation!
0Just heard from Amazon that they are going to provide a new web-service called Cloudformation. Its similar to making an AMI, but for the entire cloud! A user makes his/her own template for the entire cloud, which contains a resource stack, and just launch it on the fly. You can also make your own formation, and specify the dependencies between the resources. Cloudformation will figure out the rest! We are going to use it soon, maybe as soon as next week! I am excited, and if you are reading this, I guess you are too
Stay tuned!
Your Own Personal Birthday Google Doodle
1So you think that Google Doodles are only for the rich, famous, and quirky? Think again. If your Google profile is filled with your details, including your birthday, then you will be shown a Google Birthday Doodle, when you log into Google. Another surprise awaits, when you click the Doodle! I think I am going to change my birthday, just to experience it.
Well, I changed the birthdate, and sure enough, I was “gifted” with confetti on the settings page itself! But I didn’t see any doodle, which I guess is for visitors to google.com. I unfortunately can only visit google.co.in.
Only google can throw a party, like google can!
How to change the default Tomcat port ?
0It seems there was a clash between Tomcat and another application which was using port 8080, which happens to be the default Tomcat port. Here is how I went about it:
Steps of changing the Tomcat Port
1) Locate server.xml in <Tomcat installation folder>\ conf \
2) Find the statement similar to this.
<!-- Define a non-SSL HTTP/1.1 Connector on port 8180 --> <Connector port="8080" maxHttpHeaderSize="8192" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" connectionTimeout="20000" disableUploadTimeout="true" />
or
<!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080--> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
3) About Tomcat’s server.xml file cites it’s runs on port 8080. Change the Connector port=”8080″ port to any other port number.
For example
<Connector port="42211" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
will instruct Tomcat to run itself on port 42211. The address will then change to
http://localhost:42211/foo
4) Save the server.xml file and restart Tomcat. It should start on the port you mentioned.
Running Two GWT Applications in Eclipse
0Sometime back, I wanted to run two applications concurrently. But the only way to do it, was to stop the running applications, and start the second. It was time consuming, not to mention boring.The two applciations were not related to each oter, just that code from the first application was needed in the second.
Here I will show you how to run two or more web-apps simultaneously.
First of all, you need to right click the Project, and highlight Run As. Click on Run configurations. Switch to the Arguments tab, and add two arguments as
-port f00 -codeServerPort b4r
Do this for the second application too. Make sure that all the four ports are different. Else you will face an error as
Port 127.0.0.1:9999 is already is use; you probably still have another session active
Now, the two apps run at different addresses as follows, without any clashes.
- http://127.0.0.1:9999/ProjectTwo.html?gwt.codesvr=127.0.0.1:9998
- http://127.0.0.1:8888/ProjectOne.html?gwt.codesvr=127.0.0.1:8887
That should do it. Just add the arguments to as many Run Configurations you want, and you should be able to run them concurrently.
Extracting The Most From Your BitTorrent
2Hmm, I can smell that you are fired up, egged on by configuring your Modems. And so, FOTW, I present to you, a guide on configuring your Torrent client. All Torrent clients have a window from which you can change various options. Open it by pointing your mouse to Options – Preferences. Or in most cases, press Ctrl – P. The most important options that we shall talk about are: Connection, Bandwith, Bittorrent, and Scheduling. Its a lot to read, but all points are important.
- Connection: You have to enable UPnP Port Mapping, NAT-PMP Port Mapping, and add to the windows firewall exception. Also you have to add an exception to your antivirus/firewall. The notable point here, is that the port number should be the same as you used while updating your iptables. Confused? Read this and this.
- Bandwith: This tab concerns with managing your bandwidth (speed, as many people call it). The maximum upload rate decides the upload rate of the client. If its the upload rate of individual torrents you want to change, right-click on the active torrent and do so from the properties. Same goes for the Maximum download rate. Global maximum number of connections mean the overall number of connections the client makes with other peers (connected computers). And maximum number of peers per torrent is also the same, except that its on a per torrent basis.
eg. Global peers is 150, max peers is 100, and you have 2 torrents active. So the client will try to connect to 200 peers (2 x 100) but will be limited by global limit of 150.
Remember that connecting to peers consumes significant amount of bandwidth. So, make sure that the global maximum number of connections and connection per torrent is proportional to the swarm of uploaders and downloaders.
For a 2Mbps line, Global limit of 500 and per torrent limit of 200, with 3 torrents active is sufficient to give good speed.
- Bittorrent: This are basic features, It wont hurt if you enable all options like DHT, Local Peer Discovery, Scrape Information. But ensure that Protocol Encryption is enabled. Thats because, ISPs world-wide are aware of torrent data passing throught their networks, and hence everything they can to throttle it.
- Scheduler: Tired of waking up at odd times to avail free bandwidth? Can’t be at two places at once? Use the scheduler to automatically do it for you. If you followed all my instructions, all you need to do is set-up your scheduler according to your time schedules!
Here, the green color means the client is active, it will download as well as upload without restriction on speed (i.e. whatever is specified in the Bandwidth Tab). The light-green color says that upload will proceed according to the speed-limits (specified on the same page below the table, not in above picture).
The above snap is from my client, and heres how it is organised. There are 24 horizontal boxes, one each for every hour of the day,starting from 0000 Hrs. Making that box (that hour) of your desired color, will cause the client to follow the mentioned action. So the above table means: My client is active from 2 AM to 8 AM, since boxes number 3 to 8 are greened.
And if you need to download stuff in the daytime, just deselect the Enable Scheduler option.
So there you go, I have shared much of what I know, still if you need anything, just comment it.
Port Forwarding To Help Speed Torrents
3In continuation of my previous post, I am putting up this guide to explain Port Forwarding. Note, this is something you should do only if you have done this. Also you will have to perform these given steps every time you turn on your UT Starcom UT300R2U ADSL Modem. Well who said speed comes easy ?
Here goes.
- Goto Start – Run, type into it “telnet 192.168.1.1″, without the quotes. It opens the command prompt, with the following . For Linux users, type the same from terminal/konsole.BCM96338 ADSL Router
Login:The login and password both are admin.
- Once it gives you the prompt (>_), paste the following lines. What it means is explained later.
iptables -I PREROUTING -t nat -p tcp --dport 8080 -i ppp_0_35_1 -j DNAT --to 192.168.1.11:8080
iptables -I FORWARD -p tcp -d 192.168.1.11 --dport 8080 -i ppp_0_35_1 -o br0 -j ACCEPT
iptables -I FORWARD -p tcp -s 192.168.1.11 --sport 8080 -i br0 -o ppp_0_35_1 -j ACCEPT
The above three lines mean, a) Accept packets from any source to my computer, b) Send packets from my computer to any destination.
- Make sure of 3 things
- Here 192…11 is my IP address. Substitute yours in that place. eg 192.168.1.10
- 8080 is the port that I have specified in my torrent client to be forwarded. Change them so that both are the same.
- Dont be a Pirate !
- There maybe a problem though. It may happen that your IP address changes everytime you switch on your Modem. So int the Start – Run menu, type ipconfig and see your IP address. Accordingly make changes to the above three lines.
Happy S(p)eeding !
Configuring BSNL Modem to work with Linux.
0Okay, Ive been asked by a lot of friends and classmates, to help me configure their modem with Linux. So here goes. This is a guide for Starcom UT300R2U.
- Goto your browser and in the address bar, type in “192.168.1.1″ (without the quotes).
- In the login window that appears, type in “admin” (without the quotes) for the username and password. That’s right, both are the same.
uid:admin; pwd:admin
- Now you will encounter a window, with various links in a pane on the left side, and a table giving some device information. Click Advanced Setup in the left pane and you will come across such a table.
- Click the Edit button on the first entry. According to your current configuration, the displayed table may differ by a few entries, but its inconsequential, because we are editing and making a new one.
- ATM PVC Configuration: Enter the following: 0 in the VPI textbox and 35 in the VCI textbox. Disable the”Enable VLAN Tagging” checkbox. Service Category must be UBR without PCR.

ATM/PVC config.
- Select the PPPoE radio button. Make sure encapsulation mode is as shown. Click Next.
- This step is pretty important. Make sure you enter the correct username and password provided by your ISP(in this case BSNL). Make sure you have ticked Dial on Demand. It means that your modem (which is halfway into being a router) will dial out automatically when you switch it on.
- Now for the penultimate step. Enable NAT, and Firewall. A firewall is a system to block unauthorised access. It just makes sure your surfing is safer. Don’t mess around with the service name. Keep it as is, if same as shown below.
dont change service-name
- Congrats ! You have configured your Modem to work not only with Linux but also any OS Just click Next then Save and then Save/Reboot.
The only shortcoming you may face, is not having a static IP on your LAN. Here is what you should do, assuming that the modem isn’t shared. Goto Advanced Setup – LAN, and make the following changes.

- IP address means the address of the Modem.
- Start and End IP address means the range of Addresses that the Server can allocate to connected PCs randomly.To achieve same IP, everytime PC connects to the Modem is to make the Start IP and End IP the same, which means there is only one IP to be allocated.
- Or the easier way is Configuring your TCP/IP properties to get the IP address automatically over the LAN.
GPRS on MacOS X Leopard / MOTOSLVR L9
0My brother was forced to use GPRS because his USB CDMA modem broke
So he enabled GPRS on my phone (his phone is a crappy Nokia) and borrowed it for his use.
Then all he had to do was to pair up via Bluetooth on both the machines (Mac and GPRS enabled phone) and he was up and surfing in a few minutes (did I mention it took me around 15 hrs and 3 calls to Help center for getting GPRS enabled :X )
Now he treated himself to a new MOTORAZR V8 and enabled GPRS on his phone to return mine and I couldnt help but start (unfairly) comparing between MOTORAZR V8 and MOTOSLVR L9.
More on that after I turn the V8 inside out and compare!
GTalk Status Message and Winamp
0I installed GTalk 1.0.0.104 today, upon enabling GPRS and had Winamp 5.54 installed earlier.So I was in for a shock (which I had suffered earlier, but was expecting it to be solved) when I set my status message to “Currently playing Music Track”.
GTalk just hangs up, and consumes almost all CPU!But fear not!
The mandarins of technology (or should I say Geekville) found a workaround : All you need to do is create an empty playlist in your Winamp install folder (usually in the “/Program Files/Winamp” folder) and voila!!
And all is well in Geekville!
This thread helped me out!

