How Many Seconds Are There Till End Of Month?

(datetime.datetime(,, calendar.monthrange(,[1]) -

There's a log going on in that one liner. Let's break it down.

The two key Python modules we need to calculate the number of seconds till the end of year are datetime and calendar.

calendar.monthrange(year, month) returns a tuple. The tuple's second element is the number of days in the month.

We create two date objects:

Taxonomy upgrade extras: 

Mercurial - How To View A File Exactly Like It Appeared On A Particular Date

Here's a quick tip for Mercurial users.

Travel back in time and see how the file appeared. :)

hg cat --rev "date('2011-05-03')" controllers/

Let's break it down.

hg cat is the command we use to print the given revision of file.

hg cat --rev 10885:ae28ee103fed controller/

would print the file for the revision 0885:ae28ee103fed.

Mercurial supports a functional language for selecting a set of revisions. To know more about it try:

hg help revsets

In our solution:

Taxonomy upgrade extras: 

Connecting USB Cable To The Brain

Anand and Golix are chit chatting in a bar.

Anand: Golix, I have a doubt about USB cables.
Golix: What is it?
Anand: I've been thinking about it for a while. What happens if you connect the USB cable to your brain?
Golix: You'll hear the message: "this disk is not formatted. Do you want to format it now?".

Taxonomy upgrade extras: 

Which News Feed Have You Subscribed To?

Golix walks into a college campus. Asks few questions to the students.

Golix: What does POP stand for?
Sharath: POP? No idea. Sounds like a distant cousin of Jazz to me.

Golix: What does IMAP stand for?
Shruthi: International mail application something.

Golix: Who created UNIX and C?
Parameshwar: It is beyond me.

Golix: What is Ubuntu?
Parvati: It's a bird!

Golix: Which is the most popular social networking site?
Asha: Facebook.

Golix: Which technique is often used to download movies and music freely from the Internet?
Santhosh: Torrents.

Golix: Which operating system do you use?
Kavitha: ******

The uninitiated readers must watch the video.

Taxonomy upgrade extras: 

Changes In Bizsense

Bizsense is an open source CRM project which uses Zend Framework. The open source project was started by Binary Vibes about three years ago and was released under the GPL V3 license. Some of you might have noticed that I am no longer active in Binary Vibes.

I wanted Bizsense project development to continue to nourish, flourish and cherish. Therefore, there we did a few changes. Bizsense is now released under the new BSD license. Bizsense uses Google open source project hosting which offers issue tracker, Wiki and source control. Bizsense now uses Mercurial for source control. The documentation is published at In order to contribute to Bizsense, signing a CLA is no longer required.

Here are the project links:

Installing Redmine With MySQL And Nginx On CentOS 6

Redmine is a software project management tool which has Wiki, issue tracer, source code browser and other cool features built in. If you want to install Redmine with MySQL and Nginx on CentOS 6, follow these steps.

I always use EPEL repository with CentOS. EPEL provides additional RPM packages. We can use Nginx and some Ruby gem packages from EPEL.

Enable EPEL:

rpm -Uvh

Install required packages:

yum install nginx mysql-server ruby rubygem-rack rubygem-rake ruby-mysql

Redmine requires a Ruby gem called i18n. I couldn't find the RPM for i18n gem. I had to install i18n gem using the gem installer.

gem install -v=0.4.2 i18n

Start MySQL server:

/etc/init.d/mysqld start

Use the MySQL secure installation program:


Connect to the MySQL server as root:

mysql -u root -p

Create a MySQL database and user for Redmine:
mysql> CREATE DATABASE redmine character set utf8;
mysql> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'secret_password' WITH GRANT OPTION;

Writing A Python Script To Send Files To Amazon S3

Amazon Simple Storage Service or Amazon S3 is a storage service with a web API. I use Amazon S3 to store backups of my blog and other sites. I made a simple python script to handle file uploads to S3.

In order to use Amazon S3, first create a bucket using your Amazon AWS account. As the name suggests, bucket is a container. You can create buckets using the AWS management console.

The script we're going to write will take two input parameters

  1. Path to file, local
  2. Target S3 path

Personal Wiki

When someone asks how to become a programmer or a good programmer, the usual answer is "hack something". To clarify the jargon, hacking is not breaking into computer systems. When you start learning programming, it is good to write programs. You could hack on existing open source software projects or your own cool new project.

I have been blogging ever since I have started programming. I have urged a lot of developers to start blogging. In addition to working on a personal project, blogging about hacking is an awesome experience. Unfortunately, blogging doesn't tick for a lot of people. The usual reasons are lack of time and not having writing skills.

I have been a wiki user from a long time and I enjoy browsing wikis. I use Wikipedia everyday. Wikipedia search is the second search engine in my Firefox's list of search engines. At work, I use the wiki in Redmine. A wiki is a good tool for collaborative content creation and editing. It also works great for single users. Apart from using wikis at work and other places, I have been using a personal wiki. I use it to store

  • notes
  • blog post ideas and drafts
  • technical documentation
  • business ideas
  • miscellaneous items

Website Content

Jane: Golix, we have to put up some impressive content on our website. Any ideas?
Golix: Sure. On the front page, mention that we're innovating in the field of cloud computing.
Jane: Good point.
Golix: Also, mention that we're creating social media products. Put up some badges.
Golix: On the technology page, be sure to mention noSQL and node.js.
Jane: That would be cool. Thanks.
Golix: Remember, we have to update our website in one year.

Taxonomy upgrade extras: 


Year 2002

John: Hey Golix. What's up buddy? You seem to be unhappy.
Golix: I got the pink slip today. I'm looking for a job.
John: Sorry to hear that. I'll see if I can get you a lead.
Golix: Thanks.

Year 2011

John: Hey Golix. What's up buddy? I don't see you online these days.
Golix: Yup.
John: I heard you're not working for Crux Consulting anymore.
Golix: Yeah. I've founded a stealth startup.
John: Congrats. A friend of mine was looking to hire a Java programmer. I suggested you. Anyway, I will tell him you're not available for hire. All the best.
Golix: Hey. You know what. Just tell your friend, I'm open.

Taxonomy upgrade extras: