Thejesh GN

A Blog, A Website and A container for all my views with excerpts from technology, travel, films, india, photography, kannada, friends and other interests. I am Thejesh GN. Friends call me Thej

hg4subl – Sublime Text plugin for Mercurial

Posted by Thejesh GN On December - 26 - 2011ADD COMMENTS

I love Sublime Text and Mercurial. All most all my projects use these two tools. Clearly I need a tighter integration between these two. Sublime Texts provides Python based plugin API architecture. Its quite easy to follow and write a plugin. So I took sublime-text-2-git and modified it to work with Mercurial. I have added a few extra features and intend to develop in future.

Now I can work with my repository from inside Sublime Text.

Its easy to install:

  • On Linux go to command prompt
  • cd ~/.config/sublime-text-2/Packages
  • hg clone http://code.thejeshgn.com/hg4subl
  • Restart you Sublime Text

Now your tools menu should have Hg and related menus. Some of the menu’s are enabled only when you are inside a repo work folder. I have tested it only on Linux. If you are a windows user, let me know how it goes.
You can also use Ctrl+Shift+P to quickly access the commands.
hg4subl options

hg4subl show logs

The bottom panel is used to display the notifications to users. For example branch change in the working project

The plugin also can update itself. Go to Tools-Hg->hg4subl update. The notification panel show the information about the update
update

You can fork the project on bitbucket-hg4subl and send me pull requests if you have any.

My mercurial dev/prod workflow using clones

Posted by Thejesh GN On December - 16 - 20112 COMMENTS

Most of the people whom I work with are very confused about repository and work-folder of mercurial. If they are comfortable with that then they are hesitant to use named branches. Hence I stopped using branches for maintaining my dev and prod code streams. Instead settled on clones (forks on Bitbucket/GitHub). I find it easy to explain to all kind of people and easy to work. I was thinking about writing an how-to for the same. But blog makes much sense.

dev-prod-clone model I have a development repository for a ‘project’ called ‘proj-dev’. Every bit of code which makes sense will live here. Every team member has push access to this project. Lets say we developed over several months. Now we have reached some sane level where we could show it to our family. We use tags to bookmark stages of development. So after passing all rc.x.x.x (release candidate aka test releases) stages, we have reached v.0.1.0. Which probably is our alpha production release.

Now I clone/fork the ‘proj-dev’ to ‘proj-prod’. Only support and system admin team has push access to ‘proj-prod’. Anything that has to get onto production servers has to come from ‘proj-prod’. Hence we deploy the production code from ‘proj-prod’.

From here on we have two tracks. Click on the image for bigger resolution.

Track 1 – ‘proj-dev’ :

  1. May not be stable
  2. All developers will have push access to this repository
  3. Regular development continues on this repository
  4. Any developer can pull, production fixes from ‘proj-prod’ or accept pull requests
  5. Once all the features reach stable state and production ready, team marks it as v.x.x.x

Track 2 – ‘proj-prod’ :

  1. is most stable
  2. Direct commits to this repository are done only as part production fixes
  3. All production fixes are sent as pull request to main ‘proj-dev’ repository
  4. Any developer can pull ‘proj-prod’ into their repository
  5. Any production ready code (v.x.x.x) on ‘proj-dev’ will be pulled into this repository. Production deployment can be done only from this repository.

This is what I follow as a team lead. It keeps the work-spaces separate on my developer’s machine. It also keeps repositories separate. I guess its easy to understand or I find it easy to explain it to my team. Do you think its easy to follow?

I will probably call it the dev/prod clone model :)

Meeting Woz

Posted by Thejesh GN On December - 4 - 201112 COMMENTS

I didn’t expect it to happen. It was a very happy surprise. Today is one of the most unforgettable days in my life. I am much bigger fan of him now.

I knew he was in Bangalore. I knew he was here for a private secretive conference. But he was not really secretive about it on Facebook:). I knew it was almost impossible to meet him. Also I didn’t want to disturb him in any way.

I just wanted to leave a fan letter at hotel reception. But like any other hotel they denied he was there. Reception refused to pass on my letter. I literally had to wait there for an hour or more. At last they accepted it. The last line in my fan letter was “let me know if you have time. I would really like to meet you.”. I was just trying my luck.Like anybody I couldn’t wait, so I sent him a mail inquiring about my letter. He replied very promptly that he got it and offered to meet me. It was the OMG moment. I was so happy and high that I couldn’t sleep properly. Read the rest of this entry »

How to keep my data safe and secure?

Posted by Thejesh GN On November - 25 - 20119 COMMENTS

If you are like me then you will be traveling with all your data all the time. There are two big risks when you do that

1. Risk of losing the data
2. Risk of others accessing your data

I have managed the first one by setting up a daily sync from my laptop to my home server. As you know my life now lives inside a version control. All I need to do is run Pull and Update on my home server. I would have backed up the data without any problem.

Second issue is quite complex. All my important data resides inside a virtual truecrypt volume. Its nearly half as big as my hard disk. Truecrypt is quite secure. But my profile data (for example firefox and chrome profiles, my dot files) live outside and is accessible if somebody has physical access to my laptop. I use Ubuntu on my laptop. Ubuntu allows home directory encryption. For some reason I didn’t select it while I was installing it. I don’t know how to enable it now? Do you know? How secure is it?

Also is there any other way to encrypt the whole home folder without performance degradation?

Time Greenwich Mean Time

Posted by Thejesh GN On October - 25 - 2011ADD COMMENTS

Time has always been of great interest to me. Once I started working with developers around the world, time-zones became much more important. GMT is naturally the reference to any time zone. Like IST is +5.5GMT.

So Greenwich as soon as my friend told me about it. I was all in. Greenwich has the Royal Observatory overlooking river Thames on a hill in Greenwich Park. prime meridian (longitude 0, check the picture below) passes through Royal Observatory. It’s from here ( prime meridian, Greenwich) the time is measured. You can see the clock running GMT above. If you have a smart phone then start plain vanilla GPS app and check UTC time. It’s almost equal to GMT. The difference between UTC and GMT is below 0.9 seconds. GMT is also called as Universal Time (UT).
Read the rest of this entry »