git bisect, by example

git bisect can turn out to be very useful when you want to find a bug in a series of commits. It uses binary search to search through commits  and helps you find out where a bug was introduced. Lets take a look at an example. Say you have a file called controller.py, and you […]

Elasticsearch _cluster/health

Elasticsearch’s cluster API is a good 30,000 ft high description of your cluster health. If you have Elasticsearch installed on your local machine, give this a try: http://localhost:9200/_cluster/health You output might look something like this: { “cluster_name”:   “elasticsearch”, “status”:   “yellow”, “timed_out”:  false, “number_of_nodes”:  1, “number_of_data_nodes”:  1, “active_primary_shards”:  5, “active_shards”:  5, “relocating_shards”:  0, “initializing_shards”:  0, […]

Saving repetitive typing using PyCharm’s macros

There is typing I do on my PyCharm which are repetitive. An example of this is adding a breakpoint. I use ipdb to debug and I always need to type in this when I need to add a breakpoint: from ipdb import set_trace; set_trace() To avoid this, you can always use PyCharm’s macros to record the typing and […]

Opening files in PyCharm, the unknown way

Navigating though code in PyCharm is easy. All you would need is this: But there is a hidden open-everything shortcut which might just save your day. Hit shift twice and this is what you’ll see: This window shows you classes, files and symbols. Its a lot easier than using a shortcut for each type !    

The null device : /dev/null

/dev/null is a special file in unix. It is also called the ‘Bit Bucket’. Data sent to the /dev/null is as good as sending data to a black hole. But why would you ever want to send data to a black hole ? Here’s an example of why you might use it : Lets say […]

An evening with Neil Degrasse Tyson

Today was a special evening. Had the amazing honor to listen to Neil Degrasse Tyson at the Orpheum Theatre in San Francisco. The talk was all about how we stopped innovating in the space arena and how the cold war was the most important reason we got to where we got to 50 years ago. Thats him reading the […]