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