March 10, 2009

Fast Times at Guru Labs

Q: So what did you do today at work?

A: Oh, you know, the usual. Threw stuffed penguins at one boss. Put forty pounds of putty on my other boss's head then watched it slowly melt around him. Buried a co-worker in roughly one thousand stuffed penguins... And you?

It's going to take some time to process all the photos, but I promise we'll share. Stay tuned.

February 21, 2009

tellme: A Simple Shell Script Helper for XOSD

Derek Carter, a friend and former co-worker, was recently trying to use XOSD to display text on the screen while recording screencasts. As a result, I ended up creating a simple shell function to make osd_cat easier to use.

function tellme() {
  echo "$*" \
    | fmt -20 - \
    | osd_cat -c red -p middle -A center \
              -f "-*-*-bold-i-*-*-128-*-*-*-*-*-*-*"
}

I've already found this it quite helpful during my daily work flow. For example, I've used it to tell me when a large file is done moving or a compile is completed. The following screenshot shows an example.

tellme.png

April 26, 2008

Firefox 3: Two Steps Back

I upgraded to Ubuntu 8.04 (Hardy) this weekend. So far my first experience with Firefox 3 hasn't been great.

First the minor issue: When I launched FF3, my fonts were messed up. Some pages looked normal, others had ugly huge fonts. Maybe the big fonts are a problem with Ubuntu's Freetype config. Maybe it's a problem with the nVidia drivers. I don't know. Thankfully, I found a workaround. In Firefox about:config set layout.css.dpi to 96. (http://ubuntuforums.org/showthread.php?t=706788&page=2)

Now my bigger gripe: I don't like the new rich urlbar. Back in FF2, I could open most of my favorite sites in 4 keystrokes or less. By increasing the amount of data the new urlbar searches, the Firefox devs have decreased the unique identifiers for each link. So far, I haven't found a fix. It isn't just the slow loading or the giant waste of space, the most important detail is the sorting algorithm. I know abou the oldbar plugin, unfortunately it's only a cosmetic fix because it doesn't include the old FF2 sorting.

Hopefully I'll find reasons to like FF3, but for now it feels like Firefox has taken two steps back.

April 17, 2008

Pragmatic Version Control Using Git

I've used several revision control systems over time: CVS, Subversion, Arch & Bazaar (both baz & bzr). Each was a real improvement over the previous application, at least as far as functionality was concerned. Documentation was the opposite story. As a direct result of their ages, each generation had less documentation.

Git is in a class of its own. Feature-wise, Git is a swiss army knife to everyone else's single blade. (CVS: A butter knife. Subversion: A steak knife. Arch: A switch blade. Bzr: An X-ACTO knife.) Whereas in the past I've had to shape my workflow around the tool, with Git I could decide on the work flow I wanted and pick the Git commands necessary to achieve it. I love that. It's the Unix way.

Unfortunately, Git was also a bear to learn. I've been using it for 5 months now and don't want to give it up, but the first couple weeks were pretty confusing. Which is why I was excited when I found out that Travis Swicegood is writing a git book for Prag. Prog.

February 23, 2008

Fixing Printer Margins in Linux

I've just spent a frustrating hour trying to find the right program and print options to print a PDF without extra margins or scaling. Thankfully, I've found the solution: disable the printer's "scale to fit" option.

Perhaps you've seen this problem yourself. I created a PDF with landscape orientation and carefully measured layout, but when printed it would be scaled smaller with an extra margin (and sometimes even switched to portrait). I tried every print option and program available. I started with evince. Then I switched to acroread and tried configuring scaling, rotation, Postcript level 2, Postscript level 3, every option I could find. I even tried lp and lpr. No matter what I tried my margins were incorrect.

Finally I realized that if every program was wrong, it was probably the print driver's fault. Sure enough, CUPS, the most common Linux printing system, was performing the scaling.

From the command line: /etc/printers.conf

One way to eliminate the extra margin is to edit your /etc/cups/printers.conf and disable the fitplot option.

Option fitplot false

Using a GUI: system-config-printer

On Fedora and Ubuntu, system-config-printer can be used to configure CUPS. If you're more comfortable using a GUI, I've included a screenshot showing the option I'm referring to.

system-config-authentication: scale to fit