Skip to content

How I spent my Memorial Day weekend, part one

Let me apologize in advance for an extremely long post. It’s been a while since my last post and I have some catching up to do.

Also, I’ll apologize because this post has pretty much nothing to do with Cocoa. However, it has everything to do with the fact that MACS ARE TOTALLY AWESOME.

Seriously, this weekend it was like the scales lifted from my eyes (yet again) and I glimpsed the true greatness that is OS X.

And finally, I’ll apologize for turning into a raving Mac fanboy. Being a fanboy is not something I’m ashamed of. What I want to avoid is becoming a Mac apologist. We’ll see what happens.

The weekend started, as most weekends do, on a Friday night. Jo (my wife) and Erin (our friend) were enjoying a steak and salmon dinner at Daniel’s on Eastlake. I had received a gift certificate as an attaboy at work so we were splurging. During dinner I asked, “How thick do you think a 1600 page book is?” I was wondering because I had ordered Mac OS X Internals by Amit Singh. I had heard him interviewed on a podcast and was intrigued enough to purchase the book. I knew it was waiting for me when I got home.

At home, Jo and Erin rolled their eyes and settled down to watch a movie as I cracked open the tome. (As you can guess, I was on the receiving end of some rolled eyes and “what a nerd!” comments.) Jo pointed out that a book can be 1600 pages for a couple reasons: Either it contains a lot of information, or it is very poorly edited. Based on the first chapter, which is historical rather than technical, I have to side with the latter. Also, this book could really, really use some design work. I’ll save the details for a further post.

I’m hoping it gets better as it gets into technical topics. If you’d like, you can read a greatly expanded version (140 pages instead of 40) of chapter one here. Maybe the longer version is better, but my problem with the book so far is not its brevity. (Which is probably the same criticism that can be leveled at this post.) I do plan on going back and reading the longer version at some point.

Saturday was when the fun really began. Over the previous week, I had been trying to move our old blog to my new site, and convert it from TypePad to WordPress. TypePad is costing me money because you have to pay for the privilege of letting more than one person post to the blog, the site is slow, and the online editor is clunky and cluttered. Since creating this blog in WordPress, I’ve been blown away by the speed (thanks DreamHost!), features, ease of use, and awesome online editor.

However, even though the export and import went fine, the new site was still using images from the old site. Plus I had decided that I wanted to preserve the look and feel. Jo had spent a lot of time getting the blog to look cool, and I wanted that to be part of the archive. This turned out to be a giant pain. I tried to find a theme that was close to the old site and modify it, but it’s been years since I’ve had to massage HTML and stylesheets. (This is one of the benefits of moving into management.) After fighting with it for several hours, even with the help of FireBug, I decided a new approach was in order.

Lesson of the weekend 1: If you want to archive your blog, are moving to a new blogging platform, want to keep the look and feel, and aren’t going to continue adding posts, just create an HTML copy; don’t bother trying to perform a full migration.

Since I knew we weren’t going to be creating any new posts, I figured a copy of the site would be enough. I don’t really know how I knew this, but there is a nifty Unix tool called wget that can be used to make local copies of websites. I figured that OS X, given its Unix roots, would have a copy, but apparently it doesn’t. I didn’t trust myself to compile it from scratch (I’m still a ways away from that level of competency), and I didn’t trust a build from a random blog (Sorry Kevin!) I did find an application called DeepVacuum, which is a Mac GUI on top of an modified wget. I downloaded it and gave it a try. (Don’t ask why I trusted the software from HexCat and not Kevin. I don’t have a good reason. When I give it some thought, it’s more likely that if someone was trying to get me to install malicious software, they would set up a professional looking website, and not use some random blog.)

DeepVacuum worked like a charm, so I now had a local copy of Kris and Jo go to Paris. I Pointed Firefox at the home page via the file system and everything seemed to work fine.

Here’s where the awesomeness starts to set in. If you check out my about page, you’ll see that I have little to no Unix experience. We’ll, there’s no motivator like necessity. Unlike the “one click” install for WordPress, DreamHost doesn’t offer a one click upload of 100 megs of html and images. The web-based FTP client provided by DreamHost that I’d been using until now had transfer limits, so it would take forever. I have plenty of experience with command line FTP clients. Windows has shipped with one for a while, and they’re all pretty much the same. But in an effort to save disk space and bandwidth, I needed to compress the files first.

Here’s the dilemma. Once the file was on the DreamHost server, I’d need to decompress it. Since they’re running Debian Linux, it’s not like I could use WinZip to do it. I knew what I needed to do: I had to learn gzip.

Terminal Inspector Window

I open up Terminal and type man gzip. I then read a few paragraphs and decide to try another route. The first problem is that my terminal window is way too small. Preferences doesn’t have any window-related options, and I completely miss the the “Window Settings…” item in the Terminal menu. Google searches return nothing because the Internet apparently assumes a certain level of competence, so I go hunting around the menus again. This time I find the “Window Settings…” item, but get intimidated because the drop down says “Shell”, and I don’t want to change anything about my shell settings. Finally the light bulb goes off, albeit dimly. The drop down is to select which options you’re changing. This seems like a serious usability problem. The dropdown is being used as a substitute for a tabbed dialog. Because in most OS X dialogs, settings are applied immediately, I figured changing the dropdown would change some setting, and I wasn’t sure exactly what it would change. What does the shell have to do with “Window Settings…” anyway?

So I went to the Window and Color tabs and increased the windows size and made some other adjustments.

Lesson of the weekend 2: A drop down control is a very poor substitute for tabs. Lesson of the weekend 2.5: To change the size of your Terminal window permanently, go into “Window Settings…” (under the Terminal menu) and select “Window” from the dropdown. Once done, choose “Color” from the dropdown and change the window transparency. You’ll want to do this because …
Lesson of the weekend 3: Translucent terminal windows are totally awesome! Seriously. Take a look at this screenshot.

Okay, even with the bigger window, the man page sucks. I hadn’t really learned this lesson yet, but I’ll post it for you now.

Lesson of the weekend 4: Unix man pages suck.

Why can’t the man pages include simple usage examples? Who cares about the bugs? And why does a program like gzip require 11 paragraphs of description at the beginning? I think the Microsoft Word manual is shorter. After this weekend, I don’t even try to read the man pages anymore. I’ll first try –help, then -h, then a Google search for [Unix command tutorial]. It took me going through a few more commands to really learn this lesson.

Here’s an incredibly useful piece of information that should probably be the first thing in the gzip man page.

Lesson of the weekend 5: gzip can only compress a single file.

How do I know this? From a Google search on [gzip tutorial]. I no longer remember the exact page, but I now knew that what I needed to create was a tarball. Reread everything I just said about gzip, but replace gzip with tar. I finally found this page, created my tarball, and used OS X’s command-line FTP client to upload it to my DreamHost account.

I used SSH to connect to DreamHost, and used gunzip and tar to upback my tarball. (I’m already familiar with SSH because we sometimes have to use it, via PuTTY, at work.) One note, I could only get SSH to work if I connected using ’ssh username@hostname’ within terminal. Supplying the username via a parameter, or leaving it off completely didn’t work. Have I mentioned how much the SSH man page sucks?

Though it only took a few minutes to read, this took several hours to actually accomplish, plus I was really tired so I went to bed.

However, I was super jazzed and couldn’t really sleep. The great thing about learning gzip, tar, and SSH is that these tools exist on practically every computer in existence, so long as it’s not running Windows (and doesn’t have Cygwin or something similar). I could do this on DreamHost’s Debian Linux machines, the Solaris machines at work, or any Unix box. This exercise was a giant leap in my quest to move beyond Windows.

I got my brain to relax by working on a Rubik’s Cube. (I can solve everything but the last two corners! Arrgh!)

Since this is a natural stopping point, and this post is already too long, I’ll continue the rest of this story later. Let’s just say that what happened on Sunday was even cooler.

{ 3 } Trackbacks

  1. [...] I’m sure you recall from my earlier post, I had managed to upload an archive of our old blog to the new [...]

  2. [...] even better about my choice. Amit Singh is also on the list, who’s book I briefly mention here. I swear I’ll post more about the book later, but after making it through the second chapter, [...]

  3. [...] topic, and I can get back to blogging about writing code and reading books.Just for a refresher, in part 1 I migrated our old blog to this new site. In part 2 I used some Perl to fix some problems caused by [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *