Evince broken: unhandled x-extension-pdf

On Linux and the Gnome Desktop, Evince is the default application for viewing Adobe Acrobat (PDF) files. Recently, it started giving me the message “Unhandled MIME type: ‘application/x-extension-pdf’”. Here’s how I fixed it.

  1. Edit $HOME/.local/share/mime/packages/Override.xml
  2. Replace “application/x-extension-pdf” with “application/pdf”
  3. Run “update-mime-database $HOME/.local/share/mime”

Reportedly, a bug in the Nautilus file manager causes this behavior.

XRandR in Fedora 8

Fedora 8 ships XRandR 1.2 (the X Rotate and Render Extension), which makes it possible to render a screen onto an overhead projector, among other things. Here’s instructions on how to do useful things with XRandR (not Fedora specific). For now, control of XRandR is handled through the command line. In Fedora 9 or 10, there will likely be better user interfaces to configure XRandR.

Gnome Slideshow Screensaver Sanity

The default setup for Gnome’s GLslideshow is highly annoying on Fedora 8, and there’s not an easy way for users to individually configure it. Here’s how. As ‘root’, do the following:

Edit /usr/share/applications/screensavers/xscreensaver-glslideshow.desktop and replace

Exec=glslideshow -root

with

Exec=glslideshow -root -duration 15 -zoom 100 -pan 1 -titles

‘fuser’ linux command

I recently learned about the fuser command, which may be useful when I want to unmount a file system that is in use (lsof is also handy):

fuser -mu /media/USBFLASH   # list pids and usernames with files open
fuser -muki /media/USBFLASH # kill, with a prompt, pids with open files

However, a lazy unmount is often sufficient:

umount -l /media/USBFLASH

Laptop hard drive lifetime (load cycles)

Run the following:

$ sudo smartctl -A /dev/sda | grep -P 'Load_Cycle|ATTRIB'

And see something like this:

ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
193 Load_Cycle_Count        0x0032   100   100   000    Old_age   Always       -       6038

The last value is the number of load cycles. A laptop hard drive typically has a lifetime of 600,000 load cycles. If the count is increasing by several thousand per day (or even several hundred), it may be cause for concern.

For information and how to fix it, see http://lwn.net/Articles/256769/

The journey to Fedora 8

I’ve upgraded our family laptop to Fedora 8 (yes, we still dual boot into Windows Vista). The upgrade would have been a rather bumpy ride, except that I knew that Fedora 8 upgrades are problematic (installs are OK), and that there’s a workaround.

While Fedora 7 supported our laptop fairly well, Fedora 8 is even better. The power savings features are better. The Fedora community has tracked down and fixed several programs that were power hogs. The screen dims automatically while on battery power after about 30 seconds. File systems are reportedly mounted with the new ‘relatime’ option, which saves on hard drive battery usage — unless you upgrade, in which case, you have to add it manually. Improved wireless drivers in combination with an improved Network Manager connect more reliably, and more quickly, to our WPA2 access point.

FreeNX broken, and manually fixed

I use FreeNX regularly to connect to a remote linux box. When I upgraded one machine to Fedora 8, I couldn’t connect using an NX client. I found a suggestion that helped me fix it: Edit /usr/libexec/nx/nxnode and replace DISPLAY="unix:$display" with DISPLAY=":$display" everywhere. Hopefully, someone will re-roll the FreeNX packages to fix this for Fedora 8.

Ubuntu sidenote

I’ve heard the claim that Ubuntu is more ready for the desktop than Fedora, and up to this point, I didn’t know how that could be. Last weekend, I plugged a Logitech quick cam into my brother’s Ubuntu system. I was trying to figure out how to load the webcam driver, when we discovered that Ubuntu had already recognized the webcam, and it was ready to use.

Laptop lamentations and blissful benefits

At our household, we’ve finally made the leap from a desktop computer to a shiny new laptop — an HP dv6426us. A new computer, in theory, should save time because it runs faster, right? Wrong. It takes time to become familiar with Windows Vista and where they’ve managed to hide various configuration options (displaying file extensions in Explorer). HP doesn’t make it obvious how to get rid of their annoying add-ons from popping up in my face. I didn’t buy this thing to run the HP Health Center. I bought it so the OS would stay out of my way, and let me focus on work (err, tinkering).

We’re still attached to our desktop computer until we have migrated our data and applications over to the laptop. Migration requires time, time, and more time. FireFox, Thunderbird, Quicken, Vim, Password Safe, Putty, Cygwin, PrintMaster, Hallmark Create-a-Card, Palm Desktop, OpenOffice, IrfanView, NoMachine NX, an instant messaging client, and the list goes on. I’ve tried Vista’s new Windows Mail, and it’s much better than Outlook Express, but my wife and I have our email in Thunderbird, and it was easy to migrate that across — once I figured out where to drop the folder on Vista — in C:\Users\MyUserName\AppData\Roaming\Thunderbird. PrintMaster 12 didn’t run for non-admin users until I figured out that I needed to grant Full Control access for C:\Program Files\Broderbund\PrintMaster\Ereg. Cygwin and NoMachine NX conflict with each other.

I bought this particular laptop because the hardware was likely to work with Linux — it has an Intel graphics card, which has open-source Linux drivers, and Intel WiFi. Open source drivers mean that suspend and resume are far more likely to function correctly than when using proprietary drivers (as from Nvidia or ATI).

I would install Fedora 7, which meant I needed to resize the existing windows partition. Vista’s disk manager made this a piece of cake. Installing Fedora 7 was easy. At first, Fedora didn’t resume after suspending to RAM. After applying all Fedora updates, it worked, although WiFi doesn’t work after the resume. Hibernate always works, and so does WiFi after resuming from hibernation. WiFi and the NetworkManager didn’t allow me to connect to my WPA2-encrypted access point until I disabled SELinux.

Linux has other problems running on the hardware, including:

  • Secondary screen output hasn’t worked yet. This is easy and painless in Windows. It sounds like the latest xorg releases may help solve this situation with their Rotate and Render extensions (RandR).
  • Microphone doesn’t seem to work (although it does through VMWare Windows guest). Haven’t figured this out yet.
  • Spotty webcam support in applications. Ekiga crashes. But yes, I found a driver for my webcam. Too bad it didn’t come with Fedora 7 — I had to download, compile and install it myself.
  • Slow hibernate/resume. The TuxOnIce project supposedly remedies this, but I don’t want to spend all of my time tweaking my Linux box.
  • Battery life. Even the Linux kernel hackers acknowledge that Windows gives better battery life than Linux. This situation is being remedied, gradually.

It takes more time than I want to spend to get Linux to run optimally on this hardware, and there are some Windows applications that just don’t have equivalents in Linux, like Print Master. My plan is to run Linux under VirtualBox or VMPlayer.

I now realize that there’s huge value in an OEM preinstall of an operating system for end users. I had considered buying a Ubuntu DELL laptop, but let’s face it, DELL insiprons are ugly. HP systems are sleek, beautiful, and cost less while coming with more features (like a webcam).

Having a laptop is changing the way we work. Mobility is a huge win. We took the laptop with us when we went to vote in the primary election, because we had candidate information we could access using a web browser. There are downsides, of course.

We need a new printer and a new scanner with Vista drivers. We get to put up with frequent security dialogs interrupting our work flow. Vista itself consumes more RAM (nearly 500 MB), so we may need to upgrade to 2 GB. Vista runs slower than XP and Linux. Vista’s hibernate/resume is quite slow and gives no visual feedback during hibernation, just a blank screen. Vista’s boot and login experience is slow. Oh well. Life goes on.

FreeNX and SELinux

As I mentioned earlier, upgrading from Fedora 6 to Fedora 7 broke FreeNX. A temporary solution was to disable SELinux. Here's what allowed me to re-enable SELinux. First, I read the RHEL 5 SELinux guide to building a local policy module. Next, I ran the following commands, as root:

setenforce Enforcing
/etc/init.d/auditd stop
mv /var/log/audit/audit.log /var/log/audit.log.old
/etc/init.d/auditd start

At this point, I used an NX client to attempt to connect to my server, which failed. Then I did this:

cd /etc/selinux
cat /var/log/audit/audit.log | audit2allow -M freenx
semodule -i freenx.pp

At that point, my NX client allowed me to connect to the server. Here's the freenx.te file that audit2allow created:

module freenx 1.0;

require {
        type unconfined_t;
        type lib_t;
        class file execmod;
}

#============= unconfined_t ==============
allow unconfined_t lib_t:file execmod;

Upgrading from Fedora 6 to Fedora 7

Last night, I completed the easiest Fedora upgrade I've ever had, without having to download and boot from a CD/DVD. Here are the instructions I followed: http://fedoraproject.org/wiki/YumUpgradeFaq

I did have some unexpected glitches, mostly due to SELinux.

  • The pidgin (formerly known as gaim) system tray icon didn't appear until I deleted my .gconf settings and logged back in. This has the drawback that I had to reconfigure several aspects of my UI. It may be possible to only delete ~/.gconf/apps/panel/applets/systray (or to remove it from the panel manually), then re-add it by right-clicking the panel, selecting "Add to Panel" and chooise "Notification Area".
  • The Dovecot IMAP server wasn't allowing Thunderbird to connect. I ran 'yum upgrade', and it installed an updated SELinux policy pack. After restarting, IMAP services functioned properly.
  • HAL didn't start up. To fix it, I ran 'touch /.autorelabel' as root and rebooted. Since then, I've learned that using fixfiles is a safer approach.
  • FreeNX didn't allow me to connect unless I disable SELinux. Later, I figured out how to configure SELinux to allow FreeNX.