Thursday, June 24, 2010

Motivation

I'm analysing some things happening in my life and wondering how... well, subjective and isolated from environment certain things could be.

A good example is a car. You buy a new car and you start adjusting it the way you like: you buy wheels, suspension, maybe audio etc etc, you have a long list of things you want to install like silicon hoses, gauges, consider buying some new wheels and so on. There are of course a lot of cars better then yours and you surely can afford some of them, but you don't think about that. But one day a simple thought kicks you in a head: "I NEED this car". So you decide to sell your car and buy a new one; probably not now, probably not even this month, but you're sure you'll do it soon. So... nothing has changed in the environment. Just a simple idea in your head kills your passion in a second without any obvious changes in the environment and you cannot do anything about that.

It scares me a little when I think about it and subconsciously I apply these thought to my programming job: what if my attitude to the certain projects or people are caused more by some ideas in my head than the environment? Well, there is nothing new in this thoughts and this subject is covered in a psychology, but despite of that it's really hard to find own base sometimes.

Monday, June 14, 2010

About commit messages

I noticed that top 3 commit messages on a project I'm currently working on are following:

1. fixes / fix bug / fix bugs
2. typo
3. changes (hey, 2pac)

Every time I spot such a commit message I literally see how the $EDITOR arises between the poor developer wanting to commit his changes and the repository like the magic door in front of Ali Baba and how the developer has to say 'Open sesame' to make this annoying thing go away.

Anyway, I know how to fix that! If you're using git, add the following alias to your ~/.gitconfig:

ci = commit -a -m "changes"

and you're all settled up! Just use git ci to commit your stuff.

For a reasonable price I can consult you how to exorcise the $EDITOR from other scms.

Thursday, June 3, 2010

libcloud's GoGrid driver

We have to work quite often with GoGrid quite frequently and about a year ago I wrote gg-tools -- a set of CLI tools and a library in Python. We've used it for a while but later decided to switch to libcloud to have a better portability if we decide to move to other cloud provider.

However I found that some things in GoGrid driver could be improved. Specifically, there is quite annoying thing that gogrid doesn't assign an id to a node immediately after creation, but libcloud always expects to get an id for the image. As per discussion in libcloud maillist, create_node() was patched to block until the node gets ip assigned. Also, ex_create_node_nowait() method was added which simply adds node right away and returns id == None.

While the patches are being reviewed, I created a fork on github: http://github.com/novel/libcloud
with these changes applied. Feel free to check it out, GoGrid driver should be in a working state here as we use it on a daily basis and even if some error raises up it will be fixed quickly.

Tuesday, May 18, 2010

Changing partition type on FreeBSD

I had an ufs partition that I've used as a swap device. I was pretty satisfied with this setup until I decided to use it as a kernel dump device. I've ran dumpon on it and figured out it's not possible to use it as dump device. So I decided to change partition type to swap.

I executed bsdlabel and got such error: bsdlabel: Class not found. I've been googling and reading quite a lot of time, lots of such questions are not answered, but finally was able to find a solution. The solution is to use gpart tool. It appeared to be a handy tool and to change type of my ad0s2b partition I executed these commands:



Works great.

Sunday, May 2, 2010

Introducing goocaa, or on the way to my perfect mutt setup

I've already posted a guide how I configured mutt over gmail to leverage some of gmail useful things, esp. address completion. I've used goobook for query_command. However, I don't quite like its stability, the way of its configuration and generally I prefer to avoid using software written in Python (or Ruby or any interpreted language) on my workstations.

So I wrote a small tool called goocaa (click on the link to check its github page). It's written in C and uses libxml2, glib2 and neon.

It uses ~/.goocaarc configuration file and its schema looks this way:


[default]
email = me@gmail.com
passwd = lalala


To start using it, just add:

set query_command = "/usr/local/bin/goocaa %s"

to ~/.muttrc [1].

One more thing that I've implemented is multi-account support. I have my work mail hosted at google also, so I forward it to my gmail account and put to a separate mailbox. For this mailbox I apply special rules, like, set "mail from" to work address, etc. One more thing that makes sense to do is to search in work's contacts instead of gmail ones. It could be done with goocaa's multi-account support. First, add additional profile to ~/.goocaarc:


[default]
email = me@gmail.com
passwd = lalala

[mywork]
email = me@mywork.com
passwd = tatata


And now use folder hooks in ~/.muttrc:


folder-hook . 'set from = "me@gmail.com"; \
set query_command = "/usr/local/bin/goocaa -p default %s"

folder-hook mywork 'set from = "me@mywork.com"; \
set query_command = "/usr/local/bin/goocaa -p mywork %s"


All done! Now mutt will use your gmail contacts everywhere except 'mywork' folder where it will be using your work contacts.

1: documentation on mutt's $query_command

Monday, April 26, 2010

Ingeneeriing

Found some colleagues on Facebook. I think they rock:



I think it's funny when an enginiir cannot spell word 'enginiir' right AND doesn't use a spell checker.

Monday, March 8, 2010

My first magazine publication

My small article about cijoe has been published in Russian journal Linux Format!



It's a small article describing how to get cijoe up and running for a typical Django project. I am really happy to see my article published! It seems the hardest part about writing technical articles in Russian is translating not very popular technical terms into Russian. For example, I still don't know what would an adequate and elegant trasnlation for 'test runner', for example.

Anyway, I want to continue writing articles and I already have an idea about my next article.