Vinit Kumar

Blog about Web & Programming


© 2014. Vinit Kumar All rights reserved.

Why I Write Code

I think I was hardly 10 years old when I wrote my first line of code. It was probably some IBM PC and the language was LOGO. It was so much fun. Next, It was GW Basic, then Java and then C/C++/Python. I have been writing code professionally for 5 years now and I still enjoy writing code.

I enjoy solving tough problems with code. It gives such a great high when I solve something that seems very difficult at the moment.

Last year has been very hectic and I haven't given much time on writing code on things I enjoy personally the most(side projects).

Well, I am still figuring out my dreams at the moment but very soon I will have a clear idea of how and what I want to become in future.

But there is one thing that is sure, I would change the world for better than how I found it.

Clean Up Your Mac From Other Files


Sometimes, your mac is filled up with files and you can't seem to understand what really is taking much space. Here is how you can find out.

  • First of all find disk usage and save it to a log file. Also, find all big files that are there. Grepping using 'G' would find all files that are in GB.

Also, save the second list to another file so that we are only doing it once.

du -h > ~/space.log
cat ~/space.log | awk '{print $1}' | grep 'G' >  ~/highspace.log

Next, open a split window and do

cat ~/highspace.log

And Now, start finding the ones which are big one by one.

Let's say one of the entry was 5.6G, Let's find which one was it.

du -h | grep '5.6G'
#which outputs
5.6 ./Document/Movie.avi

Now, if you feel the file is not needed and you want to delete it. Do the following:

sudo rm -rf Documents/Movie.avi

Voila! Repeat this process and remove all files and directories that you no longer need.


Do it very patiently and backup everything that's important. This guide is for very advanced users and you should only do it if you know what you are doing. I am not responsible for any data loss. Do it at your own risk.

GPS Tracking on Android

Like everybody else, I have an Android phone too. If you are a developer you must have noticed a file called as GPS.LOG. It is the one file which has all your GPS logs in it. This weekend I spend couple of hours hacking with it. He is the outcome.

How you get tracked

First of all, connect your Android device to your computer and copy the gps.log file into your desktop:

cp /Volumes/NO\ NAME/GPS.LOG ~/projects/gps.log

Now, we need to find the good data that contain gps coordinates: sh cat ~/projects/gps.log | grep 'position' > ~/cleangps.log

The cleangps.log file contains only data that has coordinates on it.

Now, create a log file that only contains coordinates:

cat ~/cleangps.log | awk '{print $3, $4}' > ~/gpscord.log
# notice the new file is nothing but values seperated by commas, hence write them as csv
cat ~/gpscord.log > ~/gps.csv

This csv file is the basis we use to find that location the GPS log was taken.

Prepare virtualenv and install googlemaps:

mkvirtualenv maps
pip install -U googlemaps

Also, follow the clear instructions at to find your API key.

Here is the python file that would find what these coordinate means and how they related to your daily life and place you are frequent to.

#! /usr/bin/python
import googlemaps
import csv

gmaps_client = googlemaps.Client(key='<Your Server Key Here>')

with open('~/gps.csv') as csvfile:
    gps = csv.reader(csvfile, delimiter=',')
    for row in gps:
        lat = float(row[0])
        longit = float(row[1])
        reverse_geocode_result = gmaps_client.reverse_geocode((lat, longit))
        formatted_address = reverse_geocode_result[0]['formatted_address']
        print row[0], row[1], formatted_address
        print "=" * 150

Run this file in your terminal by and check out the output, you will get freaked out for some moment.


How it went?

Hello People!

It has indeed been very long since I last wrote a blog post. It sure feels good to start it again. Firstly, if you enjoy my writing, I am sorry for this big gap. I was very busy in writing code at my work.

Here are some important updates about what happened:

  • I got married! Yay :) I got married in December with my lovely girlfriend. It has been pretty amazing last three months with her.
  • I wrote various features for my product and there are more than 20k users using those features right now and the feedback has been quite good actually.
  • I write less code these days and spend more time thinking. I think it is better this way. I felt burnout with my previous lifestyle. Now, I wait to write code every morning.
  • I feel less annoyed with stupidity around me and have a better coping mechanism.

I have decided to be more consistent with my reading habits. I hope to be more sincere this time. That's it for now. Will write another post soon.

Better Time Management At Work

Time management is a key quality of any successful person. I have been working pretty hard these days to improve me efficiency. Today, I have decided to follow this pattern while at work.

Here is the breakdown. Let's assume the net hour spent at work is 8.

  • 50% Time (4 hrs) - Writing Code.
  • 5% Time (24 min) - Documentation of the Code I wrote.
  • 5% time (24 min) - Writing test on the Code I wrote.
  • 10% time (48 min) - QA and testing the work I produced.
  • 20% time (96 min) - Planning and Studying about the topic I need to work on.
  • 5% Time (24 mins) - Working with colleagues and helping out in case they need any assistance.

I felt the need to this timetable because it is really necessary to control the time when you are on tight deadlines. I like giving my all to the work and definitely have very limited time to execute that. So only if my planning and time management is solid I would be able to produce quality work on time.

I will produce a analysis of how this goes and how much success I achieve using this methodology. Also, today I have completed my 41 day streak at GitHub.