Vinit Kumar

Blog about Web & Programming

© 2016 Vinit Kumar

Open Source

I joined github in 2010 and it has been my primary source for reading and writing code. I took my baby steps doing open source programming reading others code and it has been a good source of knowledge for me. Since then I have written quite some open source software. I have written some javascript, python and go code and shared those projects in github. Open Source has quite some good benefits as it gives you a nice place to hack on things that fancy your imagination.

But there is certain downside to this as well. Sometimes your primary work(paid job) takes up all the time and you don’t have any time and energy left to spend on side projects. This is something that has happened to me since last 1.5-2 years. I have tackled very nice hard and challenging problems at work. I worked on complex scaling issues, performance tuning and lots of new features that really added value to the product. But I hardly found any time for myself. I have struggled for properly managing my time and it makes me a bit sad. But these days, I am writing some amount of code regularly.

I hope to write some more open source code in the coming time.

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.