Archive for November, 2007

Opening files in MPlayer through nautilus

Monday, November 26th, 2007

There is no doubt that MPlayer is one of most amazing players around. Specially considering that it’s capability of handling all sort of codecs. I was a happy mplayer user until I upgraded MPlayer to 1.0rc2-4.1.3. After the upgrade when a file is opened via nautilus, it gives me an error message, “file://…..” cannot be opened. Opening the file via terminal worked perfectly. So, the problem was nautilus is sending the Gnome-VFS url of the file to mplayer and mplayer is not capable of handling URL, rather it needs a direct file path.

Thanks to some recent project I was pretty aware of “.desktop” files. The “.desktop” files are used by the desktop environment to get the list of available applications. So does in nautilus’ “open with” section. So, simply editing the “/usr/share/applications/mplayer.desktop” file and changing the Exec value from “gmplayer %U” to “gmplayer %F” solved the problem. Read the freedesktop spec for more information on Exec parameters.

vga kernel parameter in gutsy

Monday, November 5th, 2007

When your computer boots up, no matter how much you hate terminals you’ll see the bios information as text(with some exceptions of course, ie - bios splashes). I don’t know the quantities, but approximately when 6 peoples hate it 2 people love it, and another 2 people looks for a better terminal. More clearly, smaller font sizes, so that we can make use of the space.

Apparently, we can’t really control the text size of the bios output, but when it comes to ttys, there is a kernel parameter called “vga”. This is in common usage and you must be probably using it. So, am I.

If you don’t know how to use it, it’s the bootloder config file. “/boot/grub/menu.lst” in case of you are using grub.

However, since I upgraded to gusty, “vga=792″ kernel parameter didn’t work properly. It’s due to some restrictions on the framebuffer driver. Here is the work around :

  1. Add “fbcon” and “vesafb” to “/etc/initramfs-tools/modules”. (In two separate lines)
  2. Open “/etc/modprobe.d/blacklist-framebuffer” and comment out the “blacklist vesafb” line. It should look like “#blacklist vesafb”. (You can delete that if you want)
  3. Regenerate initram file by typing “sudo update-initramfs -u” in the terminal

Restart your computer and enjoy :)

Version Controlling Systems - SVN and BZR

Thursday, November 1st, 2007

I have been using both “svn” and “bzr” lately. “svn” is a quite popular system, have been there for many years. “bzr” is developed by Ubuntu team to use as their version controlling system. Even though bzr is quite new to the field, it’s pretty much transparent to the user. For example if you type “bzr add” in the root bzr branch directory, then all the newly added to the repository recursively whereas svn doesn’t do that recursively. “bzr” is capable of detecting removed files, but “svn” is not; you’ll have to delete the files manually. That’s really annoying.

So, I wrote a small shell script to handle those.

#!/bin/bash

svn status | while read line; do
	command=`echo $line | awk '{print $1}'`
	file=`echo $line | awk '{print $2}'`
	if [ "$command" = "?" ]; then
		echo “Add $file”
		svn add $file
	fi
	if [ "$command" = "!" ]; then
		echo “Remove $file”
		svn delete $file
	fi
done