Tuesday, September 27, 2011

Removing "RC" packages on Debian/Ubuntu

If you do "dpkg -l", sometimes you will get to see a long list of packages with the following details:
  • rc  package-name  0.4-3  package-details
Note the "rc" status at the beginning of the package description. Some packages will show up in the "dpkg -l" output even after removing them. The reason behind this is - packages with "rc" status indicate that the packages have been removed but some configuration files for those packages are left on the system.

To remove these packages, do the following:
  • sudo dpkg --purge package-name
For a list of packages, run the following:
  • dpkg -l | grep ^rc | cut -d ' ' -f3 | xargs sudo dpkg --purge








Friday, September 2, 2011

Forcing Vim's syntax highlighting (for odd file extensions)

I often tend to keep backup copies of my C/C++ source files with odd extensions (i.e. something that does not end with CC or C). If these files are opened with Vim, they wouldn't be recognized as they should, which means my CTAGS extension and colored syntax highlighting would both refrain to work. The quick solution to this problem is to tell Vim explicitly about the file type. Here is how one can do it:
:setfiletype c
More information on it, as always:
:help setfiletype

Wednesday, August 24, 2011

Remove Firefox add-ons installed by 3rd Party Applications

The list of add-ons with pointers to the XPI code is here:

HKEY_CURRENT_USER\Software\Mozilla\Firefox\Extensions.

Just remove the unwanted entry from the list. Cheers :).

Tuesday, August 23, 2011

Multiple Java Console add-on in Firefox

I recently discovered more than one Java console add-on inside my add-ons manager in my Windows 7 machine. Since I only had only one version of JRE (Java Runtime Environment) updated to the latest version, this did not make sense. To make it more of an eye-sore, these add-ons did not have an associated "Remove" button in the add-on manager.

Some Google-ing revealed these are Java update left-overs. They do not have the "Remove" button because they are installed inside the %ProgramFiles(x86)%\Mozilla Firefox and not inside the %AppData%\Mozilla\Firefox profile directory.

In my installation, I had the following directories inside %ProgramFiles(x86)%\Mozilla Firefox\extensions directory:
  • {CAFEEFAC-0016-0000-0026-ABCDEFFEDCBA}
  • {CAFEEFAC-0016-0000-0023-ABCDEFFEDCBA}
  • {CAFEEFAC-0016-0000-0017-ABCDEFFEDCBA}
The blue numbers are indicative to the Java versions. To remove older left-overs, just keep the folder with associated with the latest Java version, which usually is the highest number in the list and delete the others.

Thursday, July 14, 2011

Evince would not start over SSH X-forwarding

Evince, which is the primary PDF and PostScript viewer on Ubuntu, recently stopped working on my Ubuntu/Natty (11.04) over SSH X-forwarding. It works flawlessly inside 'gnome-session'. But, would not run as a regular application (e.g. xpdf or gv) over X-forwarded SSH.

After digging up a little bit, I found a lots of these message in my
dmesg output:

[1305902.871825] type=1400 audit(1310620543.587:75): apparmor="STATUS" operation="profile_remove" name="/usr/bin/evince" pid=20166 comm="apparmor

It was obvious that apparmor [1] was blocking Evince to run outside Gnome session over SSH. A solution to disable the AppArmor block on Evince over SSH connection was suggested here [2]:

#inside the gnome-terminal
sudo ln -s /etc/apparmor.d/usr.bin.evince /etc/apparmor.d/disable
sudo /etc/init.d/apparmor restart


And voila! Now Evince can again be launched over SSH.

[1] http://en.wikipedia.org/wiki/AppArmour
[2] http://ubuntuforums.org/showthread.php?t=1472642