Design

Access to this item is restricted

I had an odd situation over the weekend that resulted in the inability to view the passwords associated with keys in my Mac OS X user keychain. Every time I clicked on the “Show password” checkbox in a key’s detail window, I’d get an “Access to this item is restricted” dialog.

Needless to say, this was disconcerting. I happened to have a lot of data in that keychain — this is what I get for keeping the same one around since Mac OS X 10.0 or 10.1. While I could revert to a backup, the newest backup wasn’t as recent as I would like. Plus, I just wanted to know why the problem had cropped up.

So, I asked about my problem on the Apple-CDSA mailing list. If anyone would be able to help with the obscure corners of keychains, I figured the people there would.

Very promptly, I got a reply from Ken McLeod, which led me to check the validity of the code signature on the Keychain Access utility.

$ codesign -vvv /Applications/Utilities/Keychain\ Access.app
/Applications/Utilities/Keychain Access.app: code or signature modified

Clearly, the signature and the application didn’t match. Something was amiss.

I reinstalled Mac OS X 10.6.2 on the system, using the latest combo update installer package, and cleared up the problem signature mismatch.

$ codesign -vvv /Applications/Utilities/Keychain\ Access.app
/Applications/Utilities/Keychain Access.app: valid on disk
/Applications/Utilities/Keychain Access.app: satisfies its Designated Requirement

In retrospect, although I wouldn’t have thought of this being a problem, this breakage between the signature and the app — and its affect on my ability to view stored passwords — gives me confidence that thought has been put into the code signing mechanism in Mac OS X. You wouldn’t want a compromised app displaying your unencrypted keychain items, after all.

Getting the settings right for the Drupal GeSHi Filter module

I wanted to find a way to do syntax highlighting of code snippets on my Drupal blog. I came across the GeSHi Filter module, which lets Drupal sites take advantage of the apparently well-regarded GeSHi Generic Syntax Highlighter library that’s meant for just this purpose.

However, I ran into some roadblocks implementing it on my site. Here’s the short story of what I settled on after some trial and error.

My existing code snippets are in <code> blocks, and the initial GeSHi Filter settings applied badly to them. I made the decision to only use GeSHi on <blockcode> blocks, since I wasn’t using that tag yet and it wouldn’t conflict with the snippets already posted.

I most commonly write Bash/Zsh, Python, and AppleScript snippets on my blog. However, the Bash code I was using as part of my trial and error simply wasn’t highlighting; it was coming through as the default (and boring) plain text — but was at least boxed off from the rest of the blog post.

I thought that GeSHi wasn't correctly discovering that the code was written in UNIX shell syntax. I couldn’t find a way to specify the language for that blockcode tag, until I did some searching on the ’net. To change my blockquotes to choose a certain language — at least for the purposes of this Drupal module, if not for GeSHI in general — I needed to add the “lang=lang” style to the tag. For Bash, I could use “lang=bash,” for Python, “lang=python,” and for AppleScript, “lang=applescript.” That made sense.

However, my code was still not being syntax highlighted. I discovered that the Drupal module came with an initial set of languages enabled. The others were all turned off, but that could be changed in the module settings. Without turning them on, even properly-tagged <blockcode> sections did not get the benefit of syntax highlighting.

I changed the GeSHi Filter options to enable some of the languages that were initially disabled, and then disabled the ones I didn’t anticipate using. This allowed me to add Bash and AppleScript syntax highlighting support, as both had been turned off by default. After that, I saw the results I’d hoped for: a syntax-highlighted code snippet.

It took some work, but now that it’s done, I should be all set.

Paper cuts: Layoffs and buyouts at U.S. newspapers

Having once been a newsroom intern, I have a soft spot for newspapers and newspaper people. It’s a bit disheartening to see the scale of layoffs and buyouts at U.S. newspapers.

Even though some would newspapers are anachronistic or dinosaurs, this mashup still represents good people trying to do important work.

Target disk mode versus removable hard disk on the new MacBook

I've been thinking about the lack of FireWire — and the concomitant loss of target disk mode — on the new unibody MacBooks.

I've had many occasions where target disk mode has been a godsend and others when it has just been convenient. I was able to move files off our iBook G3 after its screen failed, and had recent case where I was able to perform data recovery on another system when I had nearly given up hope of getting anything back (thank you, GNU ddrescue). So, I was naturally concerned about not having FireWire around, simply because target disk mode is so useful.

I have come to the realization that the most important situations where I have used target disk mode were for backups or data recovery. For those situations, I just need the drive. The hard disk is more easily removable in the new MacBook (and in the MacBook Pro), so it can be taken out. Then, it can be attached to an external interface or installed in an enclosure, if needed.

While that may not be quite as convenient as target disk mode over FireWire, it's not bad. Consider me appeased, my initial disquiet calmed.

I suppose the other situations will have their workarounds, too. Some of those workarounds will likely be slower than transferring data over FireWire, but oh well.

Frankly, I'm really happy to have both FireWire and the removable hard drive in the MacBook Pro line.

Drupal Administration Menu module streamlines admin tasks

I just installed the Drupal Administration Menu contributed module, and I really like it. When you are logged in and have administrative privileges, it provides a small menu bar with drop-down menus and submenus at the top of every page in your site. It provides quick access to every admin function I’ve needed, and really streamlines the process of making changes to the site.

Here’s a screen shot of what it looks like:

Drupal Administration Menu module screen shot

In that respect, I rank it up there with the Taxonomy Manager module, which also provides a major productivity boost.

Update: Apparently I’m not alone; Administration Menu is among the modules included with the Acquia Drupal distribution. I think that lends quite a bit of credibility to this module … if my own recommendation didn’t provide a tipping point for you.

Search field keyboard shortcut in Mac OS X toolbars

I’ve long had a problem with the search fields that are omnipresent in the toolbars of so many Mac OS X applications. My problem? I wanted to quickly jump up to them so I could enter text directly, but I wanted to do so with a keyboard shortcut.

This is particularly true in Safari and Keychain Access, two applications where I frequently want to use the toolbar search field.

It turns out that I was too lazy to look for it, and the option is labeled in a misleading way. I’ll admit, I just plain missed the keyboard shortcut.

The command can be labeled as “Find” where I’ve seen it. It may vary and carry some additional text, as in Safari where it is “Google Search” and MarsEdit where the label is “Search Weblogs,” both of which make sense when the resulting action is to jump to the search field. In both of these applications, the command is in a submenu under Edit > Find.

In Keychain Access, it’s just “Find” — so it doesn’t even match the label on the “Search” field it sends cursor focus to.

The keyboard shortcut is Option-Command-F, and appears as ⌥⌘F.

It’s sad when you can’t find the “Find” command, isn’t it? Grin.

Collecting important URLs for trips in Safari

I recently took a trip to Seattle, and reminded myself of a useful practice I’d developed a while ago. When I’m traveling, I collect import URLs for that trip in my browser — URLs for my organization’s travel booking/information system, airlines, hotels, maps, conference information, etc. — and put them in Safari’s Bookmarks Bar.

It’s pretty easy to collect them:

  1. Right-click on the Safari Bookmarks Bar. (If it’s not on, enable it with View > Show Bookmarks Bar.)
  2. Choose “New Folder” from the pop-up contextual menu.
  3. Enter the name of the folder in the sheet that slides down from the Safari browser window. I usually name it something short (because despite having widescreen displays, I want to conserve space in my Bookmarks Bar) that reminds me of the trip.SafariNameBookmark.png
  4. Visit a site that I want to bookmark for the trip.
  5. Add a bookmark for that site, either by:
    • clicking the “+” button in the Safari toolbar when I’m there, and then choosing which folder to put it in from the list of folders in the pop-up menu, or by
    • clicking the proxy icon in the URL field, and dragging it onto the folder in the Bookmarks Bar.
  6. Repeat the last two steps for each site relevant to the trip.

The resulting bookmarks can be rearranged, if necessary, in Safari’s bookmarks editor. (It’s the “open book” icon in the Bookmarks Bar.)

The entire group of pages can be opened all at once by clicking-and-holding on the folder in the Bookmarks Bar. When the menu drops down for the folder, choose the last command: “Open in Tabs.” This opens all of the sites bookmarked in the folder in separate tabs in the Safari window. I find that it’s useful to have them all open while I’m traveling to my destination, since that way I can see them even if I can’t get an Internet connection — free Wi-Fi is not always available.

When I’m done with the trip, I can delete the entire folder or just some of the bookmarks it contains. To delete the folder quickly, right-click on its name in the Bookmarks Bar and choose “Delete” from the contextual menu.

So long and thanks for the 125,099 miles

Yesterday, I traded in “Fighterjet.”

I feel pretty raw about signing away the title for my 1998 Subaru Legacy GT 2.5 Limited. (Frankly, I’ll never remember the correct order “GT,” “2.5,” and “Limited” are supposed to go in, even after 10 years — 3273 days, to be exact — of car ownership.) Looking back, I took delivery on July 1, 1998.

What do you say about a car you owned for 122 months? A vehicle that was there to transport you through the highs and lows of life?

Well, the brochure for our new car says, “Few things connect to your life at more points than your car.” Amen. I’ll take a stab at a few notes in haphazard arrangement, below.

This will all seem melodramatic, and it is. There are, I’m sure, people who don’t get attached to their cars. My wife and I are not those people. However, I am beginning to realize that you can only really get attached to one car, and thereafter you realize you simply can’t do that again. This is my struggle this morning, and my usual tendencies to hang on are amplified by how long I had that Subaru.

Fighterjet was the first car I ever picked out and bought myself. The two cars before it dropped into my lap, by the generosity of my family, and being young, I did my level best to destroy them quickly. The Subaru had 40-some miles on it when I bought it, partly because I drove it a few times and partly because the test drive area around the dealership was so large.

Every girlfriend I had in my adult life rode in Fighterjet. One of them helped me choose it. The car outlasted all but one of them.

My wife and our first son rode in Fighterjet. In fact, it was the car that Aaron and I had to rescue from the snowy parking lot at work — its door had been jammed open by ice so the alarm was sounding — so that I could collect the bags we’d left at home and return to the hospital with them. The baby was born a day later, and perhaps we’ll be more prepared in the future.

Fighterjet didn’t have LATCH anchors. Oops.

When I bought Fighterjet, I didn’t have any music in MP3 format. Having an iPod connection was unheard of, because the iPod wouldn’t ship for years yet. But it had a CD player and a tape player, not to mention weather band radio. (Weather band radio is really dull.)

Luckily, I had obtained my first digital camera nine months before Fighterjet, so I was able to document the car pretty well.

The month I brought Fighterjet home, I went to Macworld Expo in New York City. It was the first of five such expos in New York (and that was a particularly whirlwind trip), but it was even more memorable for a big product introduction: the original bondi blue iMac. Fighterjet, meanwhile, was “Rio red.”

Hearing about the color of my car, Kristi laughed and said, “Oh, it’s pull-me-over red!” I got exactly one ticket with Fighterjet.

The Sabres had only been to the Stanley Cup Finals once in their history when I started driving Fighterjet. Now, they’ve been there twice. And had a few conference finals appearances, too. (Did Aaron and I drive Fighterjet to that playoff game with Philly? The one that created the wall of sound in the atrium of HSBC Arena? Correction: Aaron says it was this game against Ottawa.)

I drove to a lot of Ultimate games in Fighterjet. Cleaning it out, I had a regulation Frisbee in the trunk. Along with a wiffle bat and some wiffle balls — you never know when an impromptu game would break out.

I spent one long day in Fighterjet, stuck on the New York State Thruway (I-90) for about 15 hours, one winter. There was a big snowstorm. Some of you lived through it with me, and others have probably heard me talk about it, so I don’t think I need to say more. At least that time, I was prepared.

That incident taught me that if you can’t tell your car from other snow-covered cars in the vicinity, you should probably stay home.

Fighterjet drove through a lot of snow, and barely broke a sweat over it. There were a few close calls, though. Once, I hydroplaned through the turn from 96 onto 332 — no wheels gripped, they only slipped. There was one Christmas morning, driving to Cuba, where we spun 180 degrees together; thank goodness the next car was so far behind us. Another morning, going to work and sliding slowly, sideways, into and kissing a (thankfully) snow-packed guardrail.

I didn’t have a cell phone when I bought Fighterjet.

Baxter was in Fighterjet when I hit my second deer with the car, and, as a dog, he was pretty freaked out by the sudden ordeal. I really thought that was the end of the line, but the insurance didn’t total the car. I haven’t taken Baxter with me to get take out since, as I recall.

The car got its name from the view I got sitting in the driver’s seat, looking back through my regular and oddball lane-changer mirrors. It reminded me of the rearview cameras you see in fighter jet films on TV, looking back on the tail of the plane. Dumb, yes, but I couldn’t think of a better name.

I can’t remember how many sets of tires I put on the thing. The first one involved a lot of anxiety while reading reviews on the Tire Rack Web site. The Dunlop Sport SP2s, later, were utter flops.

Fighterjet helped me move between apartments and houses. Thrice. And, I think it helped move Lloyd’s family once, and maybe others. I forget.

I drove it to Pittsburgh and the Adirondacks and other places, but I also think of destinations I never went.

After giving up this car, I wonder how many cars I have left in me. How many more will I own? My sense of mortality is briefly heightened.

I miss Fighterjet, but it was time to move on. I feel like I’ve abandoned a friend — but that’s silly. Hopefully that feeling will fade, because, after all … it was just a car.

Is that site running Drupal, curl edition

The Lullabot Web site has a clever way to help answer the question of “Is that site running Drupal?” Angie Byron mentions that the HTTP “Expires” header returned by Drupal corresponds to a specific default date. Look for that date in the HTTP headers, and you can make a reasonable guess that a site is a Drupal site — or at least one that hasn’t modified one of the core files.

Some commenters posted notes about how to do the same thing with wget and then curl. I expanded on the curl instructions to make them a little more robust (especially in the case of redirects or URL rewriting), and here’s the result:

$ curl -fsIL http://jaharmi.com/ 2>&1 | grep -q -m 1 "Expires: Sun, 19 Nov 1978 05:00:00 GMT" && echo "Yes, this appears to be a Drupal site." || echo "No, this does not appear to be a Drupal site."
Yes, this appears to be a Drupal site.

Manipulate Apple Type Services settings in Leopard with atsutil

Aaron Hall noted on the MacEnterprise list that the font caches in Leopard “seem to be under /var/folders now, but you can manipulate them with the cool new atsutil in Leopard.”

The atsutil command is quite an interesting find to me, so I wanted to point it out.

Syndicate content