iMac configuration

I mentioned previously how I’ve rehabilitated the 10-year old iMac. Today, I’ve been setting up the software environment.

First, I transferred my iTunes library over to the new computer.

Then I installed some non-Safari browsers: Chrome, Firefox, and Brave.

Then I set up Homebrew, and after that, ruby:

$ brew install openssl # various messages because Apple doesn’t like openssl
$ brew install sqlite pcre
$ git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ rbenv install -l
$ rbenv install 2.4.1 # (as of May 19, 2017)
$ hash -r # rehash your environment

Setting Up Homebrew on my New Old Mac

I set up Homebrew on my iMac. (If you go to their site, the Homebrew project has documentation there, which explains the whole not-use-sudo philosophy and using /usr/local now that Apple makes it hard not to, but I don’t understand it, so it seems like an invitation to having your machine rooted. But I’m a greybeard and I quit understanding internet security back when we used uucp because we didn’t have a real internet. Hopefully someone has thought it through.)

Because I’m too lazy and ignorant (and possibly stupid) to RTFM, I found a set of color-by-number instructions handy, although I didn’t use anything after XCode (a mere 4GB download) and Homebrew.

$ brew doctor
$ brew update
$ brew doctor
$ brew install {lots of good stuff}

At some point I ran into keg-only and Cellar jabber jabber messages, but (see above) I don’t understand any of that. I just take whatever advice brew doctor gives me and move on from there.

Some of the things I always want on a new Mac (or even one that’s 10 years old) include:

$ brew install imagemagick --with-fontconfig
$ brew install colordiff pwgen tree wdiff pstree
$ brew install pngquant
$ brew install jhead antiword poppler
$ brew install sox lame eye-D3
$ brew install gnupg
$ brew install sqlite

Moving iTunes from one mac to another

The biggest single reason I wanted to fix my old iMac was to put a honkin’ big HD in it, and the reason for that was so I could have an iTunes library on the main hard drive instead of an external (USB 2.0) drive. My iTunes Media folder looks like this:

32 Books
60 Tones
740 Home Videos
6886 Mobile Applications
10791 TV Shows
53041 Movies
84845 Podcasts
95847 Music

Why iTunes doesn’t let us manage our storage intelligently is a mystery (especially given the ridiculously small storage options that Apple provides its Macs, and all their other devices for that matter). But now I’ve got plenty of room to store 250 GB of media in the iTunes folder as well as the different places I keep it for real. So there.

The only problem was getting it into the iTunes folder, in a way that iTunes understands. But this is a known problem, and Apple has a documented procedure.

Then I had to Authorize my computer (the “new” iMac) and Deauthorize the old one (the Mac Mini). I don’t know how Apple keeps track of what computers have been authorized, but they decided this one was already Authorized, from back when it was our main computer. I don’t know if I forgot to Deauthorize it or what, but now I’ve only got 2 of 5 Authorized computers.

iMac Salvaged!

Mostly I’ve been blogging about my adventures in Linux-land. But I wanted to write a bit about my other project. About 9 1/2 years ago, we got an iMac, and about four years ago we replaced it with a Mac Mini.

The iMac was a mid-2007 20″ model. (This was the first Aluminum and Glass version, replacing the earlier white plastic models. You can watch Steve Jobs introduce the Aluminum Series on YouTube.)  The specs were: 2.0 GHz Core 2 Duo, 250 GB SATA, SuperDrive, and 1 GB of DDR2. It cost $1,220. The late 2012 Mac Mini that replaced it had a 2.5GHz Core i5, 500 MB SATA/5400, 8 GB DDR3) and cost $669, but we had to buy a monitor for it (a Samsung S23C570, which probably cost around $200). So the Mac Mini was definitely an upgrade.

But that wasn’t why we upgraded. It was because the iMac was barely working. The hard drive would go “tick tick tick” for the first hour or two whenever you started running it. The SuperDrive had quit working a couple of years earlier. (Technically, a DVD got stuck in it and could not be removed.) Plus the usual “I’m an old Mac so sometimes I just take forever to do things” that we’re all used to. We finally upgraded because we couldn’t trust that it would work any more.

So. Fast forward four years. I got tired of tripping over the iMac, but I couldn’t bear the thought of losing such a pretty computer. So …I fixed it. Or maybe I threw good money after bad and wasted my time fixing a ten-year old computer. Or both.

I watched a ton of how-to videos (this one was particularly helpful) and read the instructions over and over again. Oh, and before I did that, I got a set of tools from iFixit and parts from OWC (MacSales). Then, after putting it off all during Lent, I ran out of excuses after Easter. So I spent last Friday replacing the original 250 GB hard drive with a 2 GB drive and the SuperDrive with a 2.5″ 1 GB drive. Here’s what it looks like on the inside with the new drives.

iMac 20" (2007 model)

See more pictures of the work in progress on Flickr.

I will say that Apple sure doesn’t want you to make a bootable OS install disk. In spite of all the instructions they provide (here, here, and here). I own three Macs, but ((Shift+) Option+) Command+R doesn’t work on any of them. I finally dug up an old Snow Leopard install DVD and then upgraded to El Cap the slow and painful way.

Got the Mac Pro running again

The Mac Pro “Quad Core” (specs here) that I picked up at a surplus sale for $50 just cost me another $15. No, wait, it was $20. The power button was blinking on and off and the machine wouldn’t boot. Supposedly, you can fix certain things just by resetting the SMC. Or maybe the battery is dead. Since the computer is about 10+ years old and probably was still using the OEM battery, I figured I should start there, I started there by replacing it. (It’s a C2032 lithium battery, which is apparently the button battery equivalent of a AA. It cost me $5, because I didn’t  check Amazon, where they run about 80¢.)

But, sorry, no luck with the SMC or battery. That left “bad RAM” as the problem. The RAM is (unfortunately) but exotic and obsolete: PC6400 DDR2 ECC 800MHz in pairs of 240 Pin FB-DIMM Modules.  ECC memory! Can you believe it? I don’t think I’ve used ECC RAM since leaving college and the DECSystem-20‘s core memory. Or, who knows? Maybe I use ECC memory all the time via Facebook, Google, Amazon, and other web-based services. But I’ve never had to pay for it. It’s not cheap, at upwards of $10 per GB from OWC.

How much could I afford? The machine came with 4 MB, but it supports up to 16 GB (or 32 GB if you cheat). It seems crazy to spend money to upgrade a machine today if you’re only going to have 4 GB when you’re done, but who wants to buy $80 worth of RAM?

Finally, I hit on the idea of getting the wrong kind of RAM. Apple RAM has about 4 ounces of head-spreaders per stick. (It’s actually pretty amazing. I guess they figure people who buy a Mac Pro are going to be serious users.) But you can get ECC RAM of the wrong kind directly from China for just $15. So that’s what I did.

It arrived, and I installed it. (What an awesome thing it is to have a computer from Apple that is easy to upgrade instead of a hermetically sealed Batmobile.)

The best part is that it works. It’s probably more failure prone now, I know. But remember, it wasn’t booting at all. This looks better to me:

Mac Pro - working again

Ubuntu 16.10 and Zeroconf

I don’t do enough system admin to enjoy it when I do. (Does anyone?)

When you upgrade Ubuntu, you lose a lot of the software you’d installed. There’s a list of system admin tips that I try to remember here. (Which reminds me, I should find a better home for it for when Twitter dies.)

I couldn’t resolve names of Macs in my local network. I should point out what a shame it is that Mac addresses aren’t the same thing as MAC addresses, since Google as my primary system admin resource.

That’s the work of avahi-daemon and friends (a/k/a Zeroconf and Bonjour). For awhile I thought that something had broken there. But eventually, I figured out that was working, i.e., the problem lay elsewhere.

I wondered if they’d added a firewall to 16.10. They did (or, for all I know, they’ve always had one) called ufw (more here), but it’s (still) not enabled by default. If that ever changes, I can learn what to do about it here.

After about an hour, I found out there is something called nss-resolve. Which is actually a pretty clever idea. Except it wasn’t working. Its configuration file is well documented here. Good luck figuring that out.

Finally, I just compared my 16.10 /etc/nss-switch.conf file with the one from a working installation of 16.04.1. HAH!

Not only was there a difference, it gave me a string I could Google. That brought me to this: http://askubuntu.com/questions/837982/how-to-configure-local-dns-lookup-in-ubuntu-16-10

It also brought me to this: https://github.com/systemd/systemd/issues/4157, which (if I read it correctly) says that I should go ahead and use the string from 16.04.1 that works instead of the one from 16.10 that doesn’t.

Microsoft Keyboard Blues

I foolishly installed the Intellipoint drivers for my Microsoft Keyboard 4000, and have been frustrated ever since. I assume it’s because it’s a Microsoft product on a Mac.

Anyway. This is the solution.

First, uninstall the Microsoft drivers as described there.

Second, open the keyboard preferences pane:

Mac OSX Keyboard Prefs

Then swap the modifier keys as follows:

Mac OSX Keyboard Prefs

More rbenv notes

My last post on rbenv mentioned some things you need to do to get ruby to build on Mountain Lion. Here are a few more things.

This guy Jacob Swanner didn’t want to use either Xcode or gcc. He just used the Xcode command-line tools, with a CC environment variable, thus:

$ CC=/usr/bin/clang rbenv install 1.9.3-p194
$ rbenv global 1.9.3-p194

That won’t work with older versions of Ruby, however, as I mentioned before.

I noted he is also a Homebrew user. I’m not yet ready to go there, although macports gets more and more frustrating with each OS release. (I’m not alone.) (But that’s a subject for some other time.)

And, for convenience, here’s another Homebrewer’s notes on how to get ruby building again with Mountain Lion