Blogs

Where We Can And Where We Must

  1. Python where we can, C++ where we must.
  2. CLI where we can, web where we must.
  3. Use available software where we can, write our own where we must.
  4. Open source software where we can, proprietary software where we must.
  5. Upstream where we can, patch where we must.
  6. Bash where we can, others where we must.
  7. Nginx where we can, Apache where we must.
  8. JSON where we can, XML where we must
  9. POST where we can, GET where we must
  10. REST where we can, RPC where we must

How To Install RapidSSL SSL Certificate - Nginx Server

In this article, I will describe how to use the SSL certificate provided by RapidSSL with Nginx server.

openssl is a command line tool to use various cryptography functions.

The req command of openssl provides PKCS#10 X.509 Certificate Signing Request (CSR) management facilities.

We will generate a new certificate request for the domain .

openssl req -new -nodes -keyout www.example.com.key -out www.example.com.csr
Taxonomy upgrade extras: 

How To Comment Several Lines Quickly Using VIM

If you have to insert comment on several lines do you do manually insert the comment character in every line? Stop. Vim is a really good editor and has a nice feature to accomplish this quickly. Here are the steps:

  1. Enter visual blocking mode by pressing CTRL V (CTRL key and the lowercase v).
  2. Make your selection using motion keys(jklm, etc).
  3. Press I(uppercase I) to enter block insert mode.
  4. Press #, the comment character.
  5. Press Esc key. The comment character # will be inserted on each line the visual block selection.
Taxonomy upgrade extras: 

How Many Seconds Are There Till End Of Month?

(datetime.datetime(datetime.datetime.today().year, datetime.datetime.today().month, calendar.monthrange(datetime.datetime.today().year, datetime.datetime.today().month)[1]) - datetime.datetime.today()).total_seconds()

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/crons.py

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/crons.py

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 docs.jubero.com. 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 http://download.fedora.redhat.com/pub/epel/6/i386/epel-release-6-5.noarch.rpm

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:

mysql_secure_installation

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

Pages