If this blog helped you in any way, please donate a dollar here

Showing posts with label Directi. Show all posts
Showing posts with label Directi. Show all posts

Sunday, November 16, 2014

Removing CLOSE_WAIT connections

Hello folks, just thought I would share something I came with during one fine day at work.

Recently, we faced a problem where there were a lot of CLOSE_WAIT connections on our server which caused a variety of issues on the server. It seemed like there was a bug in the application (a java based app) but hunting it down was a pain, fixing it would also take a long time. Instead what we did, was to restart the application at periodic intervals which seemed to clean up the CLOSE_WAIT connections.

However, we wanted to remove CLOSE_WAIT connections without killing the process. We found that we could do the same with tools like :
We tried them out but none of them seemed to be of much use for CLOSE_WAIT connections. So I hacked into the source code of killcx and found this interesting bit of code:
my $packet = Net::RawIP->new({
      ip => {  frag_off => 0, tos => 0,
               saddr => $dest_ip, daddr => $local_ip
            },
      tcp =>{  dest => $local_port, source => $dest_port,
               seq => 10, syn => 1
            }
   });
   $packet->send;
I modified this and wrote this utility that removes all CLOSE_WAIT connections: https://github.com/rghose/kill-close-wait-connections

This seemed to do the trick! Happy hacking.

Saturday, August 9, 2014

[OFF] The Campus experience from the other side

"The grass is always greener on the other side"

A lot of thoughts cropped up on my mind, the day I was knowing for sure I was to visit NIT, Durgapur, the college from where I completed my post-graduation studies and got recruited to Directi, for recruiting students as part of Directi's panel. The roles had reversed.

Initially I was very enthusiastic but later on it faded away as thoughts of meeting a certain placement officer made me pretty uncomfortable. He was however, not present and that made this visit quite enjoyable! 

Going back to Kolkata after almost 4 months was an amazing experience. After landing at the airport, the first thing we did was head off to Park Circus and of course, Arsalan! This was one place that was on my Zomato wishlist for a long time. Biryani in stomach, now was the time for some "Mishti Doi". We headed off to NIT Durgapur stopping at Shaktigarh for some snacks. One of my Mumbai colleagues fell in love again when he had a sample of "Jhal Muri". How he blushed! We headed off again and it was pretty fun in the car, as always with fun folks like me. (That was sarcasm in case you missed it)

We reached our hotel, the Peerless Inn just next to City Residency and we were given personal rooms for each. I had another Bong for company and we calmly headed off for some local produce. The old box-store ("Baksho Dokan") from where we always bought our greens proved to be handy. Yes, I had missed the shop initially but we were pointed out to the right direction.

It was good. This was the same stuff we had in our 2 years of stay in this fine college. With it came back so many memories. Some so distant that cannot be reached by any means. Came back the years of friendship, struggle, shame, laughter, adventure and verbs that need to be reinvented, to correctly and completely define what had transpired.

We came back to the hotel and gorged on the parcel Biryani and ordered some more food. Hunger had played its part. The next day was campus placement and so we called it a night.

As I entered the main gate of the college I found nobody there. I went to the wing where the placement cell was located earlier. It looked empty, but as I entered the cabin of Mr. Laik I was greeted with a familiar face and a happy voice. He was surprised to see me and happy at the same time. It was good to see him as well. 

I called my colleagues in and we were in the cabin. The placement officer now had come. He had been replaced with someone else this time. I sighed in relief! We made our way up to the auditorium where the HR started his presentation. I was invited to give a talk. Being short of words, I tried appearing professional and saying how good the company is. After the presentations were over we started the MCQ Test. Chaos ensued, question papers were short. After a brief delay we selected 39 for the coding round. We were given lunch from Bapida's canteen and the familiar tastelessness was revisited again. After this we started the interview round.

It felt different and strange on the other side of the table. However, I realize nothing has changed. I wanted to do well in the interviews! I still have my share of good and bad. The students too have that. The guy we ended up hiring was in fact an M.Tech. student.

We had a good nights sleep. The next morning we were off to Kolkata Airport. We had overslept a bit as one of my colleagues wanted to visit Dakkhineshwar temple and it was not possible that day. Instead, we had Lyangcha at Shaktigarh and headed to the airport. While returning, Rohit raided a sweet shop. Then we were off.

While coming back, I had a strong urge, not to. It is a beautiful city, my hometown. Of all its dirt, filth, potholes, it still remains the most beautiful city on Earth. It is my hometown. Amar Sohor.

Monday, August 19, 2013

How many websites in the world?

So here I was sitting on my desk at work wondering how may websites are there in the world. The guy next to my cubicle announced Google had 8 billion websites indexed in it's servers! So I had to delve in and find out how many are there really.

So here's the number for today:  146,350,470

So, it was actually pretty easy to find the internet on the internet. So here are some cool links that have the relevant info.

Thursday, August 2, 2012

[OFF] How I almost screwed Directi

Been over a year since I have felt this good. Yeah, precise, and to the point!

Being ditched was one of the worst experiences I have ever had. Probably, this fills me up with a sense of redemption rather than some achievement.

People ask Does Linux Pay? Today, I would say it does!