sudheer's blog

Github For Mercurial User

You are a Mercurial user and have little experience with Github. You are required to publish your Mercurial repository on Github. The good news is, you can do it without parting with Mercurial. There are bridges between Git and Mercurial. The one we are going to talk about today, is hg-git.

Let's start demonstrating our solution.

Step 1: Create a mercurial repository somewhere. I do it on Bitbucket. We'll call this our canonical repository. Clone the repository.

Suspend Laptop When Lid Closed - Fedora

How to get Fedora to suspend laptop when lid is closed?

Edit the file


Look for the 'HandleLidSwitch' entry. Add the entry if it is not there already. If the entry is already there, change to:


Then restart systemd-logind:

systemctl restart systemd-logind.service

This is tested on Fedora 21.

Taxonomy upgrade extras: 

Access Dictionary Keys As Object Attributes

You access Python dictionary keys using the syntax:


For example:

>>> my_dict = {'food': 'idly'}
>>> my_dict['food']

Sometimes, you might want to access the dictionary keys using:
syntax. If you do this is what happens:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'dict' object has no attribute 'food'

How can you solve this? Easy.

$ pip install attrdict
Taxonomy upgrade extras: 


Pani version 0.1 has been released.

Pani is a glue tool that provides a web interface atop hg-ssh. Through the web interface, you can add, modify and remove packages and assign access to users.

The documentation is also available.

Business Reason

Golix: Hello there. I have an announcement to make. We are excited to launch our coffee shop where you can listen to music. The new business is ready to rock and roll.

After a year.

Golix: We have an announcement to make. We are shutting down the music service in our coffee shop. Now you can just drink coffee. No music.

Journa: Golix, why are you shutting down the music business?

Golix: For business reasons.

Journa: We thought you were a cool kid. Your explanation is so uncool.

How To Setup php-fpm And Nginx On CentOS 6

FPM, FastCGI Process Manager is a PHP FastCGI implementation. Using php-fpm you can have a website running as its own user instead of a common user like Apache or www-data. In this post, we will go through the process of installing and configuring php-fpm with Nginx on CentOS 6.

php-fpm package is available in the official CentOS repository. There is no need to enable third party repositories in order to use php-fpm.

nginx package is available in Fedora EPEL repository.

Enable Fedora EPEL.

Taxonomy upgrade extras: 

How To Setup MySQL Replication

In this tutorial, I will provide step by step process to setup MySQL replication. We will create one master and one slave. We will use two CentOS 6 servers - one for master and the other for slave. This following steps have been tested on two virtual machines.

Our master server will have IP address
Our slave server will have IP address

You might want to run SELinux in permissive mode.

Perform these steps on the master:

Install MySQL server.

yum install mysql-server -y