Archive for the 'whinging' Category

Printing from Mac to Linux: the cheat sheet

Friday, February 26th, 2010

For the last few years, desktop Linux and Mac OS X alike have used CUPS (Common Unix Printing System) as their native printing subsystem. In an ideal world, this would mean it’s really easy to set them up to talk to each other.

In the world we live in, however, things are not so easy. Configuring CUPS remains a black art, compounded by the absolutely abysmal reporting of errors to the printer UI on both OSes. To have any clue what’s going on you have to seek out and find the log files…

I can understand that on Linux, but really, how did Steve Jobs let this out the door on his precious Macintosh? Heck, Apple even bought the company that developed CUPS a few years back. Stop making our iPods smaller for a couple minutes and fix your printing error messages! ;)

The situation:

I have a relatively straightforward setup: an Ubuntu Linux desktop PC (stormcloud.local) with a well-supported USB printer hooked up, and a Mac laptop (nimbus.local) which roams the world. When at home, it’s nice to be able to print directly from the Mac rather than print to PDF, copy the file, and then print.

The cheat sheet:

First the basics — make sure printer sharing is enabled on Linux; this much you should be able to do through the regular GUI:

Now the voodoo! Add to /etc/cups/cupsd.conf on Linux:

    # Allow remote access
    ServerAlias *
    Port 631

And restart cupsd:

    sudo /etc/init.d/cupsd restart

Now, you can add the printer on the Mac; be sure to fill everything out!

Several gotchas I discovered:

Listening isn’t enough

Very early in my journey I made sure that the Linux box’s cupsd.conf was set to listen on the network as well as to itself:

    BAD: Listen localhost:631
    GOOD: Port 631

But when I’d try to hit the CUPS web administration pages I’d just get a “400 Bad Request”. After some experimentation, I found that it actually responds just fine… as long as in the HTTP headers I call it “localhost” instead of by its proper local network name.

To get it working (so eg http://stormcloud.local:631/ would actually pull something up!) I had to add this to cupsd.conf:

    GOOD: ServerAlias *

No, setting the name I wanted in ServerName mysteriously wasn’t enough.

Pick a queue, any queue

The Mac’s IPP printer setup dialog says you can leave the “Queue” field “blank for default queue”. This is a lie! Despite having only one printer available, I could only get printing working if I listed the queue explicitly.

To add insult to injury, you need to include the “printers/” prefix. This is easiest if you find the printer on the web interface and copy-paste the path from the URL…

Now I can print my dang Fandango tickets, which I’m pretty happy about!

Drivers

I’ve been using the native driver for the printer on the Mac side. It should also work to just leave it at Generic PostScript as long as the Linux box has a driver, but I feel safer with it there. ;)

Welcome to the lower middle class?

Thursday, December 24th, 2009

Hehe... I'm not actually in a trailer park... accurate geonames for inaccurate locations are fun. :D [A few seconds ago from web at Rail-A-Way Trailer Park, Browning, California, US ]

Don’t spam me, bro

Thursday, October 29th, 2009

I got a pretty HTML spam email from Microsoft about the opening of their Mission Viejo, CA retail store today. This was probably not a smart marketing decision…

  1. Spam is bad; I don’t remember ever asking for this
  2. I haven’t lived in the area for 3 years. What old product reg info were they pulling from?
  3. All links in the mail run through the email marketing partner’s domain, so I’m never going to click them… haven’t they heard of phishing?

Although I have to admit, I’m tempted to swing by when I’m down that way visiting the folks for Christmas, just to see a Microsoft store… :)

Compound document formats

Monday, May 18th, 2009

I’m generally appalled at the state of compound documents…

In the Apple world, Mac apps like Keynote love to use bundled directories which look like flat files at the UI level. Cute, but Thunderbird gleefully destroys them as attachments… Apple’s Mail.app transparently packages them into .zip archives for you, but Thunderbird just gives you a file with a directory listing, which naturally enough fails to open when you download it. Nice!

OpenOffice and the latest greatest MS Office stick their XML documents into a .zip archive and package image files, etc into that archive. These actually do act like flat files, so attachments and uploads work. :) But it makes file type detection and validation a little harder; verifying which file type your zip thingy is and whether it contains extra files slipped in…

And then you get fun packages like Scribus, which just give you an XML file referencing all your external image files by path, leaving no way to transfer your entire document without manually managing a directory structure and sending around or archiving multiple files manually.

We had a request for allowing Scribus uploads to Wikimedia sites for things like PR materials… sounds great, except for how any actually relevant document will need image files packed into the same directory which you can’t do. D’oh!

OpenOffice Spanish keyboard shortcut oddity

Friday, May 8th, 2009

Preparing for the upcoming Wikimania in Buenos Aires, I’ve been attempting to practice my Español in part by switching my computer’s user interface into Spanish.

OpenOffice 3.1 was released today, so of course I went and grabbed the Spanish-language Mac download and fired it up. ¡Bueno! Except…. while editing a document, cmd+A brought up an “open” dialog instead of selecting all. Um?

Ok, “A” for “Abrir”, sounds good right? Except for the part where the entire rest of the operating system maintains the same keyboard shortcuts regardless of my language setting, and I would go completely mad if common shortcut keys randomly gave me different features in just one application.

A little googling turned up complaints about this sort of behavior going back years, but not a lot of good solutions. After some poking around, I did finally discover the configuration dialog for the keyboard shortcuts — under Tools/Customize… (Herramientas/Personalizar…) instead of, say, oh, in the preferences dialog.

I was able to — component by component — export the English keyboard settings to a file (saved conveniently with a “.*” extension) and — component by component — load my “customized” settings back up after relaunching in Spanish.

It seems to work now — cmd+A selects all, cmd+O brings up an open dialog — but it was a bit of a pain getting there. Let’s hope they don’t spontaneously revert…

Update: I’ve added a note on this to a bug on OOo’s bug tracker. Trying to track down some Spanish-speaking Windows users to check the standard platform behavior of Windows apps localized in Spanish… is Ctrl+A for Open and Ctrl+G for Save normal there?

Epic sort fail

Friday, March 20th, 2009

Was transferring some screen shots from my iPhone with Mac OS X’s “Image Capture” app when I discovered that the sort-by-date seems to have some problems:

epic-sort-fail

Yes, it’s sorting by ASCII string value of the formatted date. 3/4 comes after 3/22, and 3/22/08 comes after 3/20/09. How’d Steve Jobs let this one out the door? I can only assume nobody had a memory card or camera with old photos on it when they tested…

en.planet.wikimedia.org borkage resolved

Wednesday, February 4th, 2009

Was out sick for a couple days, catching up now before the FOSDEM rush. :D

Got a report that en.planet.wikimedia.org hadn’t been updating since January 30; turned out to be a UTF-8 BOM problem — one of the maintainers saved the Planet config.ini file in an editor that added a Unicode byte-order-marker character.

In theory, the BOM is a great idea. It’s a particular character (U+FEFF) which can act as a signature to tell the computer what variety of Unicode encoding the file is using — UTF-16LE, UTF-16BE, UTF-32, or UTF-8.

In practice, in the Unix-y web world, UTF-8 is king… and lots of things that eat UTF-8 don’t know what the hell a BOM is. We can’t use them in our PHP code because PHP sends them to output, corrupting your headers or binary data. We can’t use them in our Planet configuration files because the Python config file class gets confused by it.

Back in the 1990s they told us Unicode was going to be so easy… :) *wistful sigh*

Google Transit yay!

Thursday, May 8th, 2008

A few months ago I whined about the Google Maps transit planner not working very well.

Well somewhere since I last looked, they fixed it!

Transit directions now include San Francisco MUNI bus and train routes and walking to/from stations, so you can actually put in start and end points and get something useful! The alternate route selection is a little different from the driving directions (you get a short list of a few options, rather than being able to click and drag waypoints to whatever route you like), but still quite useful; it comes up with pretty close facsimiles to the three alternate commute routes I use in reality.

Goodbye, 511.org!

Now if they can just integrate the transit lookups into the iPhone Google Maps widget… d’oh!


I love Wikipedia!