Thursday, June 24, 2010

MPlayer: Failed to open LIRC support

Whenever I run MPlayer from my terminal, which is always when I am playing any kind of media, including Youtube videos, I get the following error.

mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

I do not own a LIRC remote control, although I have read it is not too difficult to build one yourself. I this message had become an eyesore. The fix is rather simple. Add a line "nolirc = yes" without the quotes to the file ~/.mplayer/config in your home directory. Given how customizable MPlayer is, it is possible to fine tune almost everything from the config file. The default configurations are listed in /etc/mplayer/mplayer.conf and are overridden by the config file in the home directory.

Tuesday, June 15, 2010

Resolving "murrine_style_draw_box: assertion `height >= -1'"

When using Emacs 23 and a few other applications on Ubuntu running GNOME, I often get a irritatingly cryptic error message ** (emacs:25074): CRITICAL **: murrine_style_draw_box: assertion `height >= -1' failed. Turns out it has got something to do with the theme I'm running.

Thanks to Alf, it is very easy to get rid of that by tweaking Gtk configuration. Modify the entry in /usr/share/themes/Ambiance/gtk-2.0/gtkrc from GtkRange::trough-under-steppers = 0 to GtkRange::trough-under-steppers = 1.

Wednesday, May 26, 2010

Upgrading Fedora from the command line

I have a Fedora box running and I sort of screwed up the GDM so I was left without a display. Since the Fedora 13 (Goddard) was released recently, I decided to upgrade, from the command line. It kept giving me the error that complained, "Can't open display".

I finally figured out that I needed preupgrade-cli, as specified here: http://fedoraproject.org/wiki/PreUpgrade

The syntax, from the command line is this (as root):
preupgrade-cli "Fedora 13 (Goddard)"

Note the quotes surrounding the argument - you need those to specify the string for the version you want to upgrade to.

Monday, May 24, 2010

Eclipse: GLib-WARNING **: g_set_prgname() called multiple times

While coding a few things using SWT on Eclipse, the console was continuously showing me this error:
g_set_prgname() called multiple times
that too in red - meaning a sort of an error.

This is a nagging problem: especially if you are a code purist like me who loves to see no errors/warnings at all in the code I write. I googled a bit, and the Ubuntu Forums provided the solution: downgrade libglib2.0. I'm quoting from there:

Mark the package you want to downgrade, and choose "Force version ..." from "Package" on the main menu. Select the previous version and it is done.

I am using Karmic Koala (yeah I haven't upgraded to the Maverick LTS yet). So all I needed to do was to select the value from the drop down menu to one that did not say "(updates)". Don't worry, there are only two options and you just have to select the other one. After applying, I got that line marked in yellow in Synaptic. But hey... got rid of a nagging warning! :)

Sunday, May 9, 2010

Road rash on Linux using wine

For a lot of us, Roadrash is a game that is going to remain close to our hearts forever! Countless hours spent in front of the PC while kicking and punching others, or even on the LAN fending off your room-mate. For a lot of us, this has been THE introduction to computer video games.

Downloading the game is pretty easy, actually. I got mine at http://www.download-full-games.com/pc/sports/road_rash.html

The tricky part is to get to run it on Linux. In my case, Ubuntu Linux is the only operating system I have: I honestly don't need Windows for much. This game, however, runs only on Windows and so the quintessential wine came to the rescue. So then I unzipped the file and from the command prompt typed:

sudipta@Hogwarts:~/roadrash$ wine ROADRASH.EXE

This unfortunately leads to the "CD-Rom not found" error. The fix to this, as we all know, is to have the registry edited. There is a SETREG.EXE which you can run, but then the state is not persistent. As in, if you run

sudipta@Hogwarts:~/roadrash$ wine SETREG.EXE
sudipta@Hogwarts:~/roadrash$ wine ROADRASH.EXE

Then the registry was just altered when the last wine command was run, not this time. So I opened up the RASH.REG file and found that it contained:

REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\Electronic Arts\RoadRash 95]
@=""
"Path"="D:\\"
"CheckDialup"=hex:00
"ChatState"=hex:02
"MiniDash"=hex:00
"OpponentList"=hex:01 

Which basically means that the above Windows registry value needed editing. This in turn led me back to the .wine folder in my home directory. Lo and behold, there was a system.reg file with lots of Registry-like entries.

sudipta@Hogwarts:~/.wine$ gedit  system.reg

So I simply added a section right on top that said:

[SOFTWARE\\Electronic Arts\\RoadRash 95]
@=""
"Path"="D:\\"
"CheckDialup"=hex:00
"ChatState"=hex:02
"MiniDash"=hex:00
"OpponentList"=hex:01 

This was because there was an entry right on top that said, ";; All keys are relative to \\Machine". And now when I run


sudipta@Hogwarts:~/roadrash$ wine ROADRASH.EXE

I get







Viola! Ah the joys of kicking the next guy off the road... :D

Sunday, April 25, 2010

SSH Hostname Shortcut

As I work with 3 machines: laptop, desktop, and a server: all running 64-bit Linux, I often need to use ssh and scp. I find repeated typing of long hostnames stress inducing, with the chance of making a typo or just the pressure on my fingers. Here is a trick I use.

Create a file .ssh/config with the following entries:

Host [shortcut]
Hostname [full-hostname]
User [username]

where entries in [brackets] are to be filled with your entries. Additional entries like Port, ServerAliveInterval, etc. can also be filled out.

This along with public key based password-less ssh works like a charm. If you are as lazy (= productive) as I am, one-letter shortcuts for frequently used hosts like

$ ssh a

is enough.

Monday, April 5, 2010

Syncing Text Notes

A very basic need, trivial to address and yet surprisingly, at I haven't found a convincing solution: you want to make your text notes on your mobile device and then copy-paste to your files on your computer.

I keep my tasks and other important lists in the form of formatted text file (e.g., in Google Docs). I found this to be the most flexible compared to any other todo list applications such Google Tasks or Remember the Milk that never measured up to what I needed to do with them. However, Google Docs doesn't allow you to edit on Mobile devices. iPhone internal Notes program doesn't sync over 3G (I guess that can be made to work somehow with iTunes?) . At some point, I emailed those notes to myself and then copy-paste from the email to Google Doc. Then I found DropBox in which you can sync file with your mobile device and view them. But still NO EDITING despite many people requesting it!!! So I found EverNote and you can edit there but there process requires many clicks at at least on the iPhone with no background app, it's painful and not practical. Also, if you do any rich formatting on a desktop, the mobile app only appends. Then I thought what I make a draft email and keep updating this and then copy-paste from this draft. I used this solution for a while but then again too many clicks to get to it.

What am I missing? Shouldn't there by something out there for this? I doubt that not enough people need to sync their notes.

Out of options, I created my own small application and you can put a shortcut on your mobile main screen. On your first use, it creates a note for you which it will remember from the cookie next time you visit the main URL. You can email it to other computers that you want to sync notes and again using cookie you only need to do this once. Couple of disclaimers:

1. I'm putting this up for comments and would love to hear if there is interest (or alternatives). I may stop this service at any point
2. It is currently formatted for iPhone and I haven't tried on other devices. Again if there is interest, I will support it.
3. This is to be used for small temporary text transfers. Not a secure service. Also, the app is almost too minimalistic and missing many features.