Recent Discoveries

To be added to my ongoing useful linux omnibus page:

  • Firefox 0.9 remote newtab syntax
    When I open a link from another application (gnome-terminal or evolution, for example), I would like it to open in a new tab in Firefox, so I had a script which I called newmoz:

    firefox -remote “openURL($1,new-tab)”

    This is my default web browser. With Firefox 0.9, the syntax has changed. You now need:

    firefox -a firefox -remote “openurl($1,new-tab)”

    I believe this has something to do with the confusion of the possibility of several related Mozilla applications running all at once, although I’m not entirely convinced. To make it really snazzy, try:

    firefox -a firefox -remote “openurl($1,new-tab)” || firefox $1

    This way, if firefox isn’t already running, it will still work.

  • Email yourself after a long task
    This is a really obvious one, but I only recently thought of it. Due to several recent failed hard drives, I’ve been moving a lot of data around from one drive to another, some through NFS, and some over my cable modem. Moving 200 gigabytes, even within a LAN, takes a long time—even longer if you throttle it so as not to congest the network too much. I would find myself checking back on the process every few hours, even though I knew it probably wasn’t done. So why not append a mail command after a long process? E.g.:

    rsync -Pa / storage.system.somewhere:backup ; echo done | mail adam

    Since I’m always checking email, I’ll find out as soon as it’s done, and waste less time continually checking back on the process, especially when the transfer might take three or four days.

  • ssh timeout error/connection reset by peer with rdiff-backup and D-Link DI-604 router
    Backing up bostoncoop.net over a cable modem takes a long time. If something goes wrong, rdiff-backup has to roll back the previous backup and start over. As best I can tell, rdiff-backup first makes the connection, then starts the roll back, but doesn’t send or receive any data during the roll back. On my system, the roll back can take longer than the timeout period for my DI-604 router—the consequence being that the connection is reset before the backup can start and rdiff-backup fails out.

    There’s an easy fix, which should come in useful to anyone with a router that is too vigilant about timing out ssh connections (for example, if you ssh to get your email and often leave the window alone for an hour at a time). Add the following to your .ssh/config:

    serveraliveinterval 300
    serveralivecountmax 10

    This will insure that ssh will occasional send an ACK type request every 300 seconds so that the connection doesn’t die.

  • Fixed font in gnome-terminal
    I’ve wanted to use gnome-terminal for a long time, primarily because of the tabbed terminal feature (many terminals in one window) and because of the URL recognition (open a URL by right clicking on it). I also like being able to paste into the window with the keyboard.

    There was always one problem, though. The font. I know some people like the new fixed-width GNOME fonts, but I don’t. I just wanted plain old fixed, which I use with xterm (10×20). But that font never showed up in the list of available fonts.

    I finally found the solution in /etc/fonts/local.conf—namely, the following lines:

       

    Just uncomment the path, run fc-cache as root, and you should see fixed in the output of fc-list.
    I’m not sure how a naive user would ever figure this out, but then again, maybe a naive user wouldn’t care that much about having fixed font in gnome-terminal. I also don’t understand why we wouldn’t users to have access to bitmapped fonts by default—why not just set the default font to something the GNOME people like, but have the other choice in there to start?

Okay, now I’ve really got to study for the bar exam.