Sunday, 18 September 2011

Using Emacs for development

When I started working with linux, I had the choice of the following text editors:
  • KEdit
  • Vim
  • Emacs

I decided to try all of them. After initial try, I was certain I would not use vi. It just did not suit my tastes. KEdit turned out to be limited in functionality. So, Emacs became my editor of choice. Initially, I was using it for trivial tasks only. Gradually as I knew more about it, I started using it more.

Compiling and debugging in emacs was fine. However, I was missing code navigation features which really come in handy during code reading phases. Searching through the world wide web, I found this blog explaining the use of etags with emacs for code navigation. I gave it a shot and it surely is fast. While working with python, I found emacs' support for python is not that good; but I am sure it will improve soon.

Arch linux: my perspective

When I finally found an article covering Arch linux, I thought its time I write about the distribution I have been using for over two years. I switched to it from openSUSE. I have been a KDE user all along; seen transitions from stable 3.x to current 4.7.

I am a minimalist and Arch fits right in. It sure is "bleeding edge". Today only Chromium 14 was released and it was available in Arch repositories. In contrast in Gentoo, another rolling release distribution, the policy is they stabilize a package after a month without any bug reports about it. Due to this policy, Gentoo is still at Firefox 3.6.x while Arch provides me latest Firefox. Even when Firefox released an update after the DigiNotar issue, Arch also pushed the update to its repositories. With Gentoo's policy, it certainly is more stable. As Arch provides, bleeding edge software, you need to understand how to act/react when there are inconsistencies. Only yesterday, hit three bugs: filed one in KDE directly, another in Arch and another in Enlightenment. Another time, I was getting a bug related to valgrind because I had an updated version of it as Arch had pushed the update much before any other distribution. I should probably also mention that Arch released a patched version the following day.

Arch is really simple in the sense at the system level. I was able to create init scripts for Arch far more easily than on Gentoo for the same package. Arch however is not as configurable as Gentoo is. No distribution can match or even come close to Gentoo in this regard. It uses a unique system for this called USE flags. With Arch I can not have a custom KDE; but with Gentoo I have a large number of options as to what I want to have and what not. This flexibility of configuration in Gentoo comes at a price: every package is compiled on your system.

I have provided comparisions with Gentoo because it is the only distribution that has comparable features. Both of these distributions are in a way close to me. On my home desktop, I have Gentoo installed; but on my laptop where I do most of my development tasks, I use Arch linux and I do not see a distribution switch in near future.

For me, Arch surely is a base platform to do what I want to do. I have so to say three distributions in one: a distribution that provides nice command line environment, another that provides nice and stable KDE. I have even stopped akonadi and nepomuk search from starting up at all as they started mysql instances and I was not using any of them. The third one provides latest Enlightenment desktop. I compile it instead of using the packages in the repositories so that I am up to date and also to get debug symbols compiled in.

There have been some issues with Arch from time to time though. For example, the Ricoh card reader on my laptop works fine for some kernel versions; but does not work with others. Arch surely is not for the beginners. However, for advanced users, it provides a lean system which can be tweaked to taste.

Monday, 12 September 2011

Recovering Gentoo linux after changing hard disk channel

On my system I have two hard drives a 40 gb old one [reminiscent of the times when that much was enough] and a new one of 1tb. Initially both of them where on channel 2: the new one was the master disk while the old one was the slave disk. When I installed Gentoo, I tried

fdisk -l

and found the new one to be /dev/sda while the old one was /dev/sdb. So while installing grub, I assumed the following mapping:
hd0 --> sda --> 1tb hdd
hd1 --> sdb --> 40gb hdd

Grub was installed successfully and dual boot was working fine. [For those readers who are curious about getting a dual boot system, the best place is to look at the handbook.] However, when I got a new DVD writer, the old hard disk was connected at channel 0 as slave and the new one was connected at channel 2 as master. My BIOS was set to boot from the new one and Windows booted fine but I could not boot into Gentoo. So, I decided to fix it and chrooted into my Gentoo installation from the minimal install iso that I had put on to a usb stick using unetbootin. [Recently there have been questions about the performance of unetbootin. I would just like to add that when I tried unetbootin from Windows it failed me thrice with different distributions. However, when I tried it from linux, it worked just fine.]

From within the chrooted environment, I ran

fdisk -l

and found the old hard disk was now sda and the new one was sdb. So, I assumed the following mapping while reinstalling grub:
hd0 --> sda --> 40gb hdd
hd1 --> sdb --> 1tb hdd

However, when I rebooted, grub showed error 17. A quick look at Grub error collection shows that I had somehow got root(hdX, Y) wrong. While talking about the issue on #gentoo, I found that hd0 is actually the drive the BIOS is set to boot from. So, my assumed mapping was incorrect and it turned out that hd0 was being mapped to 11tb hard drive. So, I went into the BIOS and changed it so that the correct mapping was followed.

P.S. To know more about grub read this article.

Tuesday, 6 September 2011

Office not working in Archlinux

After dropping of, Archlinux switched to LibreOffice from the Document foundation. As this was pushed through a regular update, I went on with it. However, after some time when I tried opening Office files, I was having trouble opening them at all.
I used to get stuck at this filter selection every time I opened a file. When I opened up LibreOffice, the various files options were grayed out.

I thought of checking the wiki for the procedure of installation. I reinstalled it using the following command:

pacman -S libreoffice-common libreoffice-{base,

pacman -S libreoffice-extension-{pdfimport,presentation-minimizer,presenter-screen,report-builder,wiki-publisher,ct2n,hunart,numbertext,oooblogger,typo,watch-window,diagram}

After that, I was able to get things working again. However, interestingly, each time I had upgraded my system after the switch to LibreOffice, using

pacman -Syu

I had seen these packages were installed. Now there is only one issue, tooltips are just black rectangles.

Friday, 2 September 2011

Firefox responds to fake certificate issue

Recently, we have seen false SSL/TLS certificate issued by DigiNotar causing trouble to a lot of people. The Tor project's blog describes it at length. Details of such vulnerabilities are detailed here. Firefox has been fast in responding to this. They have released an update which basically prevents its users from becoming a victim.