Category: D. Technology

Way to GSoC!

If there is one thing, which is a dream goal for any college student who loves to code, that would be GSoC (pronounced ‘jee-sock’). Well, what is this GSoC? Directly from the horse’s mouth,

Google Summer of Code is a global program that offers post-secondary student developers ages 18 and older stipends to write code for various open source software projects.”

Long story short – Students willing to participate should first go through the list of selected organizations in GSoC -> Choose an organisation -> Choose a project -> Start discussing your proposal with the mentors and improve it -> Make a proposal and submit it through Google Melange. If you are selected, you make history (along with 5000 USDs in your bank account :P).

GSoC 2012

I chose Umit as my organisation. Why? Take a look at their list of projects and you would understand the reason. Among all these projects, the relatively new “OpenMonitor” project was my favourite. I loved their idea. As it sounds, its a Monitor for the Open Internet. It keeps track of all the connections on the Internet and has the ability to trace back the reason of a network blockage or blackout. Simply put, it frames a nervous system of the Internet by implementing a peer-peer topology of nodes scattered around the globe. Thats totally awesome. I really wanted to be part of this wonderful project. When? It was last year (2011) May. I worked with Luis, who is a mentor at Umit. He was really really helpful. He guided me right from scratch and helped me out at every stage. I hacked around a bit on Umit Network Scanner, Packet Manipulator and OpenMonitor then. I even made a talk on Umit Network Scanner at Pycon India 2011.

Then came the news of GSoC 2012. And Umit made its way to the selected organisations list this time too! My joy knew no bounds to know that I had the chance to work on my favourite project as part of the legendary Google Summer of Code 😀

I studied the code of Desktop Agent and Mobile Agent of OpenMonitor and I found that the Interpeer Routing was in a prototype-like stage and it really needed to be tweaked up for further enhancements to happen. Thus I started discussing the problem with Zubair, Luis and Adriano and finally settled with implementing a Kademlia based P2P implementation for the inter-peer communication among the desktop agents, mobile agents and the aggregator. We initially planned to make our own implementation from scratch in Python, but later planned to use C++ Kademlia libraries and writing wrappers in Python and Java.

And after all the discussions, I was able to fine tune my project proposal and submit my proposal.

The list of accepted proposals were out by GMT 1900 hours yesterday on the Google melange site and I was glad to see my name on the list. Now, I have a chance to work in one of the coolest projects in the open source world as part of the Google Summer of Code. I am really proud and happy to be at this place.

Special thanks to Dorai Thodla, Karthik Subramaniam, Madhumitha Vishwanathan, Yuvaraj Pandian and all the members of ChennaiGeeks and ILUGC communities in Chennai for exposing me to such excellent opportunities which until last year I hadn’t heard of.

Cheers! 🙂


I just installed Facebook Timeline feature in my profile and got engrossed in it awesomeness. A brilliant feature introduced to the world through the recent F8 Developers Conference, FB Timeline gives a beautiful portrayal of what you are and what you have been. And the timeline is neat and concise with a good mix of statuses, videos and pics, (and most importantly) at an amazing speed! The Timeline feature is the perfect example of gigabytes of per-user information put into good use. Now lets see how to activate it on your profile.

<guarantee>The steps below would hardly take 2 minutes to complete</guarantee>

Step 1 : Open This opens the developer page for you account. If you haven’t developed anything yet, it will ask for the “legendary” Request for Permission where we blindly issue an “Allow” irrespective of whatever it asks us to allow 😛

Step 2 : Now inside the developer’s page, you could find two obvious buttons to the top right namely “Edit App” and “Create New App”. Click on “Create New app” button.

Step 3 : A new message box appears where we are asked to enter an “App Display Name” and “App Namespace”. I entered it as “Narendran’s Chronicles” since my timeline is just gonna be my own history and the namespace as “narendranapps”. (Never Mind!)

Step 4 : You might have to enter your mobile number of credit card details to make yourself authentic to FB. I used my mobile number. After some 2-3 minutes, got a message saying “Facebook Mobile Confirmation Code: XXXX”. Enter this confirmation code into the textbox that appears on the screen and you are done with this authentication thing.

Step 5 : Now getting into the developer page once again, click on “Open Graph” on the Left bar. Under that choose “Get Started”.

Step 6 : You will get a page “Get Started with Open Graph” and it prompts “Start by defining one action and one object for you app”. I entered “read my timeline” at “profile”, since the timeline gets attached to my profile. Click the green “Get started” button.

Step 7 : The next page gives you options to edit the notifications which are displayed once someone reads your timeline. You can very well ignore this and click “Save Changes and Next”. Else if you are grammatically challenged like me 😛 you can have your own funny notifications.

Step 8 : Click “Save and Finish” in the next page.

Step 9 : Now you would be facing a page which gives you some alarmingly technical information and makes your mind-voice go WTF! But you could safely ignore this and open your FB profile as usual. You’l get a message which looks like this.

Message regarding Timeline feature

Step 10 : Click “Get it Now”. And yes, you’ve got it now!!

This is how your FB timeline looks!! 🙂

Cheers! 🙂

Web has become almost ubiquitous with our daily chores.  Take for example – When we sit before our PC/Laptop, how many of us start typing the letters “F” “A” “C” and choose “” from the drop down and then wonder why we chose it? Such is the impact of the Web on our routine activities. Research says Internet has changed the way we remember facts. Rather than remembering the birthdate of our best friends, we just rely on Gmail reminders. Don’t we?

The amount of information generated in the World Wide Web each day is unimaginably high. What could be done in 60 seconds? Sounds trivial? Well, let me allow the picture to speak for itself.

The Web in 60 seconds

This mammoth network of networks wasn’t built in a day. The web has seen a phenomenal growth since its inception.

Web 1.0 – The Read web. People could just read the contents articulated by others. One-way communication.

Web 2.0 – The Read, Write Web. People could comment on what others said. Thus started the era of blogging. Two-way communication.

Web 3.0 – The Read, Write, Execute Web. People share their ideas. And the system processes and understands the information it has obtained from various authors and suggests the contents which a particular person would be interested in. That’s why he call it the Semantic Web. Suggestion Engines, Mashups, Micro-blogging etc. make the Web much more interactive.

Now we are experiencing the indocile rise of HTML5, which, I feel, is a paradigm shift in Web technologies. With a clever use of HTML5, JavaScript and CSS almost anything and everything could be emulated on the Web. And the OS makers are also ceaselessly working to avoid being an #epicfail. Say, with Windows 8, all the applications (called tailored apps) are supposed to run on HTML5, bringing in in a radically new concept for an operating system. And we are expecting a ChromeOS which could sound the death-knell to all the Native Apps and introduce the concept of “Browser is the OS”.

The Internet we are witnessing now is something larger than life. Something we are depending on so heavily that one day we might even forget our own names and check our Google+ profiles to get them.

The future of Internet, I believe, would be to make an unified ecosystem wherein it would be possible to get the same amount of data storage and processing power from any kind of device connected to the internet. 

Below is a wonderful infographic on how far the Internet has catapulted from humble beginnings to colossal heights.

Extent of "Internetization" : Courtesy - Cisco

Note: This post was published in 2011 and the solution may not work anymore. And please note that we are improving only the DNS resolution part of the web page fetching process. This will not have any impact on your download speeds.

Nowadays I find interest in solving the real-life problems which people face everyday through technology (However trivial it may look, its gonna help someone 🙂 )

Are you one of those thousands of people who are not satisfied by the browsing speed they get with Tata Photon+ connection? Well here is the simplest tweak you could make and increase the browsing speed by a maximum of 300% and AM NOT JOKING!

If you are a geek, am sure you’d have figured it out already. But if you are a non-technically inclined person, this post is for you. The sloth-like speed of Tata Photon+ connection is due to the default DNS servers. So the tweak is setting your DNS to and the alternate DNS to These are Google’s Public DNS server addresses.

In Windows : 

This is for Windows 7. I believe everyone is current enough to have it on your PC 😛

Open Control Panel –> Network and Internet –> Network and Sharing Center –> Change Adapter Settings

Right Click on your Tata Photon+ Connection –> Properties

Move to Networking Tab

Double Click Internet Protocol Version 4

In the second fieldset, change to “Use the Following DNS server addresses”.

Preferred DNS server  : and Alternate DNS server :

Click OK and Reconnect.

In Ubuntu : 

Click the Network Connections icon on the right hand side tray of Ubuntu Desktop.

Choose “Edit connections”

Change to “Mobile Broadband” –> Choose the Tata Photon+ Connection and click “Edit”

Then it might ask for your password. Enter it.

Change the Method to “Automatic (PPP) addresses only”

Set DNS servers to,

Click Save and Reconnect.

Note :  If you don’t find any improvement after the change, then may be Google Public DNS is not the one for you. It works best if you are in Chennai. Now, the thing is that Tata Photon’s default DNS servers are not that fast. So we need a better alternative. You can find them by using Namebench software.

Though am not a full-time coding geek, I never miss an opportunity to appreciate good algorihms and snippets. Saying that, now this post is about an invention of a sorting algorithm on 20th January, 2011 by someone “Anonymous” in the 4Chan Family. If you do not know about the 4Chan website, atleast you must know about the Operation Payback which they launched in 2010. I became a fan to 4Chan after that incident. Now here lets discuss a sorting algorithm from 4Chan which intrigued me. Its called the SleepSort. I know it sounds funny, but believe me you’re gonna feel great once you understand it. Here is the code..

function f() {
sleep "$1"
echo "$1"
while [ -n "$1" ]
f "$1" &

filename : sort.bash
usage : bash sort.bash 5 2 8 1

The code is amazingly simple, but the algorithm is the interesting part.
while loop : The loop executes until there is a value for the “$1” expression, which actually denotes the command-line argument. So as long as there is a command-line argument value, the function “f” is called by f "$1" &. Because of the presence of “&”, the command is executed as a background process without disturbing the control flow in the current execution, and thus the next line shift is executed immediately. This line shifts the the focus on to the next command-line argument, and therefore now the value of “$1” is the next value in the argument list. This loop is repeated until all the command-line arguments are exhausted. After the loop is done with, there is a separate background process executing the function “f” corresponding to each command-line argument.
function f() : This function makes the process to sleep for “$1” number of seconds and then prints the value of “$1” in the terminal by the echo command. We know that all the background processes we created have a value from the argument-list. Thus lower the value of the argument, earlier is its value displayed on the screen. Like 1 is displayed after 1 second, and 3 is displayed after 3 seconds. Thus the numbers are printed in ascending order.
Though there is a major drawback that higher argument values lead to increased delay in getting the result, still the algorithm amused me.
Happy Hacking 🙂

My college, SSN College of Engineering provides “24×7” Wifi Connectivity. Ya thats true. But only “19×7” Internet Connectivity, since Internet connectivity is barred from 12 am to 5 am everyday. So I bought a Tata Photon+ Data Card with the Unlimited plan for Postpaid. It was of great help to me. In addition to the real “24×7” Internet access, it allowed me to access some useful websites like youtube, github, etc which are actually inaccessible through my college proxy. Moreover, I cannot access Android Market, TweetDeck or any other web application (save for the browser) in my Android phone through my college’s proxy. Now I had to find a way to get this Tata Photon+ Connection, which works on my laptop, on my Samsung Galaxy S2. So I had to share it wirelessly through my laptop’s Wifi Card, making it work like an access point. The procedure is damn simple.. Yet I made this post so mercilessly elaborate that you could rarely be misled by the procedure. So here we go –


Note : By wired connection I mean any connection you get through your physical ports, like Ethernet Cable, Mobile Broadband etc.

Step 1 : Get Connected to the Internet.

Check Internet connection

Step 2 : Switch on your Wifi Card. (So that you can see available wireless networks, if present)

Step 3 : Open Network Connections – First click the Network Connections icon on the top pane of Ubuntu desktop –> Click “Edit connections”. You must be facing a screen like this now.

Network Connections

Step 4 : Create Adhoc Network – Change to Wireless Tab –> Click Add –> Enter the details for the new connection.

Enter Adhoc network details

Step 5 : Change to IP4 Settings –> Set Method to “Shared to Other computers”.

Change Method to "Shared to Other Computers"

Step 6 : Connect to the newly created adhoc network – By clicking Network Connections icon –> Choose “Connect to Hidden Wireless Network” –> Choose the appropriate connection and connect.

Connect to the newly created adhoc network - naren-adhoc

Now all the surrounding systems will be able to access the adhoc network you created. By connecting to this now anyone can access the Internet, which was initially accessible only on your system.

Thus we have made our own laptop into an access point. Cheers! 🙂

Now to the funny part of the experiment – Though this was quite helpful, it did not solve the original problem. Ya, I couldn’t connect to this network using my Android phone (Gingerbread OS). 😀 The reason is that, Android Phones cannot detect Adhoc networks with their Stock ROMs. We need to root the phone and change the wap-supplicant file to enable that feature. More on that in another blog post.


This is exactly the same as the previous one. The only change is that instead of changing the IP4 Settings in the Adhoc wireless network we created, do the same to the ethernet connection. Thats it. We are done.

Happily Everafter 🙂

In terms of technology and computers, I have currently decided to blog on NS2, Android and Python. I will bring in other interesting languages like LISP, Haskell, Perl later on.

Technology is fun. Though I don’t have any great desire to become a techno-geek or something,  I do read a lot on Tech stuffs. And am mad about computers and gadgets. i know am not alone. Because they really have profound impact on our lives. Don’t they?

Choice of Computer Science : It all commenced when I was doing my 12 std in High School. I was asked to make a choice of a lifetime among three streams – Computer Science, Biology and Business. After hearing all the opinions from mom, dad, anna, anni, chithappa, chithi, thatha, paati and so on (:P) I decided to settle with Mechanical Engineering in PSG. But there was one particular thing which was continually haranguing my mind. “What is it that I never get bored with?” –> “Hacking into Computers” replied my conscience, everytime. Then after a deep study into the roots of Computer Science, I fell in love with it. I wanted to learn more and more about it. And thus am into CS. So, what made effected that sudden change of mind?

I ascribe that part to the history of Computers. I thank the forefathers of computer science who have provided such a brilliant platform for the current generation of young entrepreneurs to work on. Anyone who could clearly visualize the power latent within computers and the platform available for students would easily go for computers and technology.

Take for instance, the concept of languages. We interact with the humans with languages like English, Hindi, Tamil etc. These are nothing but a product of recursive abstraction of languages, the phenomenal process which started with the introduction of Hieroglyphics in Egypt. With each level of abstraction, the depth of each word increased. And finally we ended up with beautiful languages that are in use today. Such is the evolution of computer languages. We started instructing the computers using  machine code with mere 0s and 1s. We started abstracting it to Assembly language, BASIC, procedural languages like C, Functional Languages like LISP, Object Oriented languages like Python and Java and it continues to evolve. If you ask me, this will evolve until the computers are able to perceive instructions fed in human languages like English!! Imagine instructing your computer to pXe boot to Ubuntu just by a verbal command in English. Thats going to be legendary..

And moreover computer languages too follow a grammar, similar to the grammar rules we have in our human languages. Thus programming languages are very closely related to human dialects. This closeness to reality impressed me. I swore that I would learn all these technologies and make a better platform when I pass the baton to the next generation. because thats is how civilizations occur. Thats how the world has developed over the years. That leads to ultimate glory of mankind.

And this is what made me a technophile 🙂

For those who are unaware of NS2, NS2 is a event-driven network simulation software, used to study network models and simulate network scenarios. Installation of NS2 in Ubuntu seems like a tough job for many. If not, atleast for me, it was a herculean task because of lesser documentation on this installation part.

Network Simulator

Without much talking, lets dive into the topic.

Since “long long ago so long ago”, this has been the method of installation. But installing in latest version of Ubuntu is little challenging due to the new gcc version.

Step 1 : Install the dependencies

$ sudo apt-get install build-essential autoconf automake libxmu-dev

Step 2 : Download ns-allinone-2.35 package from NS2 official site. At the time of this writing, the latest version was 2.35 RC7.

Step 3 : Place the ns-allinone-2.35.tar.gz file in your home folder(/home/sunshadow in my case). Extract the contents of the archive to a folder of the same name.

Step 4 : Open terminal and change directory to the ns folder.

     $ cd /home/sunshadow/ns-allinone-2.34
Step 5 : Editing files to remove X::X construct – Edit the file ns-2.35/tools/ and change the line 219 :

return GammaRandomVariable::GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);
return GammaRandomVariable(1.0 + alpha_, beta_).value() * pow (u, 1.0 / alpha_);

Similarly, change the lines 183 and 185 in file ns-2.34/mobile/ :
resultPower = ErlangRandomVariable(Pr/m, int_m).value();
resultPower = GammaRandomVariable(m, Pr/m).value();

Step 6: Begin ns2.35 installation

     $ sudo su

     $ ./install

The installation runs for a couple of minutes. Don’t get freaked out on seeing the varieties of warnings and messages over there. :P. Its normal. Don’t close this terminal. We got some important information in the last section of the installation.

Step 7 : Add the path information to the file ~/.bashrc

     $ gedit ~/.bashrc

Append the following lines to the file ~/.bashrc

export PATH=$PATH:/home/narendran/Documents/ns-allinone-2.35-RC7/bin:/home/narendran/Documents/ns-allinone-2.35-RC7/tcl8.5.8/unix:/home/narendran/Documents/ns-allinone-2.35-RC7/tk8.5.8/unixexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/narendran/Documents/ns-allinone-2.35-RC7/otcl-1.14:/home/narendran/Documents/ns-allinone-2.35-RC7/libexport TCL_LIBRARY=$TCL_LIBRARY:/home/narendran/Documents/ns-allinone-2.35-RC7/tcl8.5.8/library

Here replace /home/narendran/Documents with the path to your home folder.

Step 8 : Check installation : Thats it, folks!! Now type ns in terminal. A ‘%’ symbol will be displayed denoting that interpreter is working. Installation Success!!

Happily Ever After 🙂

Note : If you are not a serious ns developer or you just want to run a simulation file on your system, use apt-get or yum (based on which Linux distro you use) Eg. : sudo apt-get install ns2 nam xgraph. It is not mandatory to build ns2 from source to use it.