Codes from my life

Archive for the ‘Linux’ Category

Getting middle button of 3M ergonomic mouse to work

Yes that is a mouse. I use this at work.


But the default configurations did not let me use the middle button. I wanted to use it for scrolling. So I had to add some custom settings to X.

Before we begin, we need to know the device name:

# hal-find-by-capability --capability "input.mouse"


Then get the product name by

hal-get-property --udi "/org/freedesktop/Hal/devices/usb_device_4b4_60_noserial_if0_logicaldev_input" --key "info.product"

Areson USB Device

On an ubuntu system you need to create a file at /usr/share/X11/xorg.conf.d/42-middle-mouse-scrolling.conf with the following contents:

Section "InputClass"
    Identifier "Middle Mouse Button Scrolling"
    MatchProduct "Areson USB Device"
    MatchDevicePath "/dev/input/event*"
    Option "EmulateWheel" "true"
    Option "EmulateWheelButton" "2"
    Option "XAxisMapping" "6 7"
    Option "YAxisMapping" "4 5"

Then restart X or reboot.

Original Source:


Personalizing GNOME and Unity

I have used GNOME 3 for quite some time now. Of late the shell started to crash a lot, so I switched to Unity. I usually hate dark themes, I like bright desktop and larger fonts so that my eyes don’t get strained. It is great that people have so many useful gui tools for these things. These are my personal favorites:

  • gnome-tweak-tool – Good for changing themes and font, adding removing shell extensions. It can also be used to customize buttons(minimize, maximize, close) on title bar. I am still old school and I like all the buttons there.
  • gconf-editor – This is an advanced tool. Before you start be exactly sure about what you are doing. You can configure most of the gnome behaviour using this.
  • gnome-color-chooser – This lets you choose the various color schemes. This was particularly useful in my case as I hate white on black, and the default ubuntu has white on black for eclipse tooltips which is really annoying for me.
  • CompizConfig Settings Manager(ccsm) – You can use this to configure Unity hot-keys. I have changed the hot key for Unity launcher from super key (windows key) to super-z as I wanted to use super-c and super-v for copy paste on my terminal.
  • Gnome-Terminal – This comes with its own options for personalizing it. I use profile preferences to change the font and the color schemes. I use Monaco font. Also I have changed the copy and paste shortcut. Pressing 3 keys is cumbersome and that too when you have to do it so many times.

In the process if you screw up your system simply log out, and log in to the shell using Alt+Ctlr+F1 and delete .gnome. .gnome2. Sometimes you may have to delete .local and .config depending on what you have modified. After that press Alt+Clrl+F7 to log back in.

Network Manager troubles after wifi password change

I recently changed my router’s password and even changed the authentication type. Now after that Network Manager started crashing. And thanks to the new GNOME 3 network manager, I was not able to manually change the password, I was not even getting where they had hidden the previous Network Connections window which used to list all the interfaces.

After googling for a while I found the command.

$ nm-connection-editor


Problem due to incompatible Qt versions

I had recently bought MTS connection which gave a usb stick to connect it. It also gave a rpm for the GUI. Later I found that due to it, some software like vlc and skype had stopped working.

I used to get errors like this:

roshan@localhost:~/Downloads$ vlc
VLC media player 1.1.3 The Luggage (revision exported)
Blocked: call to unsetenv("DBUS_ACTIVATION_ADDRESS")
Blocked: call to unsetenv("DBUS_ACTIVATION_BUS_TYPE")
Warning: call to signal(13, 0x1)
[0x9e9c8fc] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0xa02ba9c] skins2 interface error: no suitable dialogs provider found (hint: compile the qt4 plugin, and make sure it is loaded properly)
[0xa02ba9c] skins2 interface error: cannot instanciate qt4 dialogs provider
[0x9e9c8fc] main libvlc error: interface "default" initialization failed

roshan@localhost:~/Downloads$ skype
Fatal: Cannot mix incompatible Qt libraries
Aborted (core dumped)

The problem was with the linking of Qt libraries.
roshan@localhost:~/Downloads$ ldd /usr/bin/skype |grep -i Qt => /usr/lib/ (0x00406000) => /usr/local/bin/ztemtApp/bin/ (0x00efa000) => /usr/lib/ (0x002eb000) => /usr/local/bin/ztemtApp/bin/ (0x0084e000) => /usr/lib/ (0x00122000)

The libraries installed by the MTS stick had screwed the system. Notice that libQtGui links to /usr/local/bin/ztemtApp/bin/

So since I had forgotten which rpm had installed it I simply moved /usr/local/bin/ztemtApp/ to some location not in my path and things were back to normal.

roshan@localhost:~/Downloads$ ldd /usr/bin/skype |grep -i Qt => /usr/lib/ (0x00e24000) => /usr/lib/ (0x00eff000) => /usr/lib/ (0x002eb000) => /usr/lib/ (0x073ae000) => /usr/lib/ (0x00d1a000)

Rhythmbox id3 dumex missing plugin problem — solved

This is a problem that I faced once earlier also. However, I never cared to solve it then. The solution to this problem is on

Simply download the tar and extract the tar. Follow the steps mentioned on the page.

Posted from GScribble.

messing up

These days I have no work to do, expect willing time :P, so I thought lets try “Sugar Desktop”, so I installed it using

# yum groupinstall sugar

then i logged out, and logged in to Sugar, which I later found out that there was nothing for me in it, then I logged out and removed Sugar using

#yum groupremove sugar

which removed gdm as well, the gnome login manager. Things worked fine till I was logged in. Later when I rebooted, all I could see was the fedora logo and no login prompt, I was clueless what had happened. Then I realized what had happened. I tried to open console by pressing Alt+Ctrl+F1 to F7 nothing happened.

Finally I rebooted my machine went to single user mode so that I could reinstall it again. I realized later that run level 1 did not allow me to configure network. Now what to do ? I always knew that /etc had some file which could change my default run level. Then i did /etc/init pressed tab which had two options one of which was inittab which controls the default runlevel.

So I edited /etc/inittab to change my default run level and rebooted my machine, configured network manually and then installed gdm. Finally its working again :-).

Posted from GScribble.

Mukti 10

Mukti is the annual FOSS festival of NIT Durgapur. We celebrated this from 5-7th Feb 2010. So here is the post on what we did. Since last year we have changed the pattern of what Mukti used to be, we try to bring FOSS developers from all over India, so that people here can meet them and learn from them. With this in mind, we had with us, Pradeepto Bhatacharya, Shabbir Keriwala from Geodesic Technologies, Arun Ravindran and FOSSEE team.

Mukti began on 5th, with Android workshop by Shabbir. He introduced us to what android was and showed us basic demos of little apps that ran on the eclipse simulator. A lot of people were running Eclipse for the first time and since a lot of them were new to Linux, the sessions went a little slow than Shabbir might have anticipated. I could not attend this one, but folks told that it was really interesting.

After that, we had Qt workshop by Pradeepto. Since I had little knowledge of GUI development using PyGTK, I found this one really enlightening. Pradeepto had made some demo applications, in which he demonstrated step by step, how to go about learning Qt.

On 6th, we had two talks one by FOSSEE team for Scientific computation using Python. We had very less audience for this workshop because of the overnight coding events. The other workshop was by Arun Ravindran on Game Programming. This was really interesting as I had no idea what the workshop would be like. He taught us to make a flash game in two hours using an open source tool called Haxe.

We have video recorded most of the sessions, which we would upload on our server very soon, apart from that the source codes for the various workshops have been put for download at