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 10This 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.
Dave Ahlswede Jan 28
I suspect the reason for bitmap fonts not being abled by default has something to do with the fact that a lot of pcfs seem to work poorly or not at all with freetype/fontconfig. I’ve had to manually edit a couple to get them working.
Peter Jan 28
Normally dpkg should ask you if you want Bitmapped Fonts enabled:
dpkg-reconfigure fontconfig
Christian Jan 28
Fixed font in GNOME Terminal… As far as I know fontconfig asks whether to enable bitmap fonts upon installation. This was enough for me to have Fixed enabled.
Adam Kessel Jan 28
Several people have pointed out that the bitmap fonts is a fontconfig configuration question. I guess I just haven’t seen the fontconfig debconf question in a long time, and perhaps the question wasn’t there the last time I went through configuration. dpkg-reconfigure fontconfig does, in fact, fix the problem.
Josh Triplett Jan 28
Since you use bitmap fonts, might I suggest the excellent “neep-alt”, from the package xfonts-jmk? I use it in GNU Emacs, since GNU Emacs won’t support anti-aliasing for TrueType fonts until the GTK2 version is released. (For everything else, I use the fonts in ttf-freefont; however, that package is broken at the moment, so use the previous version and put it on hold.)
Andrei Voropaev Jan 28
With fontconfig-2.2.3 I can’t get bitmapped fonts at all. And no help from fontconfig mailing list. Older version of fontconfig was showing my fonts after their directories were added. With new version I’ve even had to recompile gvim against Nextaw. With GTK it was too ugly.