Headshot-color me@jbrains.ca Find out where I'm appearing
« Previous 1 3

Click On Macs saved Apple a customer today

It took several years, but Apple had me thinking about switching back today, until Sarah and ClickOnMacs in Toronto teamed up to saved the day.

The internal hard disk on my MacBook Pro began failing in the past few days. I suspected bad sectors based on random pauses while the machine appeared to write temporary data out to disk. Booting to my trusty backup drive made the problem disappear, which reminds me to recognize Hitachi for their fine 500 GB SimpleDrive Mini and Shirt Pocket’s reliable SuperDuper! backup system for allowing me to keep working in spite of a wonky internal disk. Sadly, when I tried to fix the internal disk by software means, I ran out of rocks pretty quickly.1

I managed to learn that the “Write all zeros” feature of Disk Utility identifies bad sectors and pushes them out of the way. I tried that and my drive’s capacity fell by only 300 MB. I could live with that minor loss, but after restoring my backup, Verify Disk failed. At this point, I gave up on the disk and Apple decided to let me down.

Sarah made Genius Bar appointments at all three Toronto locations, but couldn’t get anything before Thursday, when we had to fly to Istanbul. Of those three locations, one claimed to be too short staffed to deal with us. Neither of the other two were willing to tell us whether they had the necessary service parts available to fix my machine before we had to fly. We even asked them merely to make sure they weren’t already out of stock, so we could avoid a wasted two-hour trip on the day we need to fly seven time zones east. They didn’t care, preferring instead to play poor disempowered employees. Sad.

Next, when I remembered I had a ProCare membership, I thought I’d get quick service that way. No dice. First, my membership expired without any notification. Next, I asked about renewing my membership to jump the service line, and they said they’d only let me drop the machine off with no estimate of whether they could repair it in time to fly. Sad.

Finally, Sarah remembered Click On Macs downtown in Toronto. I called them, gave them my computer at 1:30 PM and they invited me to return by 5:30 PM to pick the machine up. I authorized them to install a new hard disk if they couldn’t fix the existing one. All that for less than $200. Nice.

So Apple, I won’t switch quite yet, but be aware that I priced out buying two disposable Dell laptops to avoid this nonsense. If Click On Macs hadn’t done what you flatly refused to do, I’d have bought a Dell today.

But wait, there’s more!

When I picked up my machine, I asked about the lead time on a RAM upgrade from 4 GB to 8 GB, expecting it to take a few days. They answered “we can do it now” and offered me a much more reasonable price than Apple did. I walked out of there with 8 GB RAM and a new, 7200-RPM, 320-GB internal hard disk which, thanks to SuperDuper!, will boot to my OS by the time we come back from the Blue Jays game, and I’ll manage to return my dealings with my computer back to normal.

1 A curling reference. Try Wikipedia.

September 25, 2009 08:00 mac

libxml2: Can't upgrade it; can't downgrade it

It started simply enough: I wanted to use webrat to write view specs with its Matchers to add some specs to this very weblog. I swear, that’s all I wanted to do.

When I managed to run those specs properly, I’d get this message:

HI. You’re using libxml2 version 2.6.16 which is over 4 years old and has plenty of bugs. We suggest that for maximum HTML/XML parsing pleasure, you upgrade your version of libxml2 and re-install nokogiri. If you like using libxml2 version 2.6.16, but don’t like this warning, please define the constant I_KNOW_I_AM_USING_AN_OLD_AND_BUGGY_VERSION_OF_LIBXML2 before requring nokogiri.

Very well: let me upgrade libxml2. Big mistake.

I tried downloading libxml2 version 2.7, then I went through the usual motions: configure, make, sudo make install.

Then I couldn’t run anything. Sometimes I couldn’t even boot. I kept seeing the wrong architecture message when I tried to run various programs on my MacBook.

I tried deleting libxml from /usr/lib and rebuilding, but then I couldn’t even sudo. I didn’t know what the hell was going on.

Finally, I booted from my backup disk (thank you, SuperDuper!) and copied /usr/lib/libxml* back onto my internal hard disk. I booted from my internal disk and all returned to normal, including the annoying nokogiri message. I suppose I’ll have to live with the message for now.

Still… has anyone successfully upgraded libxml to version 2.7 on Mac OS 10.5.7? I’d like to know.

August 13, 2009 08:00 rails, ruby, mac, adventures in RSpec

Fixing Mail.app as it pertains to IMAP and gmail

I am in the process of making gmail my One and Only Mail Database. My first tentative steps showed that gmail filters duplicate emails, which is great, because I have multiple copies of several hundred emails, thanks to POP. Naively, I just started dragging emails from my other Inboxes to my gmail/IMAP/personal mail Inbox and letting the messages synchronize on the gmail server. My goal was to make my other Mail.app accounts empty so I could disable them. This worked well for a while, but for most of today, Mail.app has been telling me this:

Mail has undone actions on some messages
so that you can redo the actions while online.
Mail has saved other messages in mailbox “INBOX”
in “On My Mac” so that you can complete the 
actions while online.  

Additional information: The attempt to read data 
from the server “imap.gmail.com” failed.

I read an article or two and figured I’d overburdened my gmail server and it was scolding me by limiting my access for a while. When about eight hours passed without any change, I knew I had a problem, and that problem was the same email over and over again. Something about embroidery of all things. Each time the message popped up in my “On my Mac” INBOX, I moved it to Trash, then erased deleted messages… nothing worked. Finally, out of desperation, I simply pasted the entire message—you can see it’s quite long—into Google.

Seek and ye shall find.

The advice there, however, didn’t impress me. I might not be a Mail.app developer, but I imagine that if I delete my entire offline cache, I’ll lose all the emails I moved into my gmail/IMAP/personal mail inbox. That would be bad, considering it’s about 10000 messages, many of which matter to me. I thought I should investigate, and fortunately, it wasn’t too hard to figure out what to do.

I went to ~/Library/Mail/IMAP-[myemailaddress]/.OfflineCache and saw about 10000 numbered files. I looked at one of them and saw an email. I figured I could grep to find the offending email, delete it, restart Mail.app, then all would be well. So I did, and so far it is.

To be clear, here is what I did:

$ cd ~/Library/Mail/IMAP-****/.OfflineCache
$ ls
1000		1001		1002		1003		1004		1005		1006		1007		1008		1009
1010		1011		1012		1013		1014		1015		1016		1017		1018		1019
1020		1021		1022		1023		1024		1025		1026		1027		1028		1029
....
$ grep -i embroidery *
[...Matched email 854....]
$ rm 854

That worked great. I hope it helps you, too.

June 11, 2008 03:00 mac, just to be clear

Mac OS X: choosing the default currency symbol

This is just a quick tip for Mac OS X users who might want the symbol “$” to represent their dollar, rather than the US dollar.

I’ve been working on expense reports with Numbers.app and I noticed that my laptop was formatting Canadian and US dollars as “Can$” and “$”, respectively. While I thought this a tad US-centric, that didn’t bother me much, so I gave it no real thought until I opened the same spreadsheet on my Mac Mini, where I saw “$” and “US$” instead. I thought this was neat, except of course that now the columns were the wrong width. I saw the difference, figured there was a difference in the International settings, but no! To quote Swiss chess master Gereben, “wie ist es möglich?!” The settings are the same, and yet one window has “Can$” and the other “$”. There is no “Customize…” button, so I can’t change the number format. What can I do?

I did what any self-respecting programmer would do: I played around with the settings until it worked. I found out that by switching the currency to something else, then back to Canadian Dollar, I reset the number formatting, and now both computers use “$” for real dollars and “US$” for the fake kind.

Now you know.

June 07, 2008 03:00 mac

Rescuing disk space from Parallels

I use Parallels to run Windows under my MacBook Pro which has a 93 GiB hard disk. Since I also live a flight away from the nearest authorized Apple reseller, I find it difficult to buy a new hard disk whenever I need one. These reasons form the constraints under which I spent much of a recent afternoon reclaiming disk space, rather than focusing on real work. Since I have more than a neophyte’s, but less than an expert’s, knowledge of UNIX, I needed to look up the command to show me how to ask UNIX how much disk space folders used. I invoked this command

$ du -h -d 1

This command tells me how much space each immediate folder (-d 1 means “depth of one”) takes up in human-readable (-h) form. This gave me a report like the following

....other folders....
 24M	./Applications
 24K	./bin
7.3M	./Desktop
2.5G	./Documents
....yet other folders....

Since I want to focus on the really big folders, I looked for a way to do that. I decided to grep for a “G” in the fourth position.

mel:~ jbrains$ du -d 1 -h | grep ^...G.*$
2.5G	./Documents
 20G	./Library
1.0G	./Movies
5.8G	./Music
3.3G	./Pictures
3.3G	./Workspaces
 36G	.

Since I plan to use this command frequently, I added it to ~/.profile

alias find_big_folders="du -d 1 -h | grep ^...G.*$"

I found that Library took up the most space, and within it Parallels took up over 20 GiB on its own. I searched the web and learned that Parallels has a “Compressor Tool” that compresses hard disk images, but when I tried to use it, it failed, telling me I had snapshots or had enabled “disk undo”. Since neither condition held true, I searched further and saw that Parallels has a long-standing defect (back to July 2007 at least) that causes this problem. Fortunately, the same search gave me a solution: MakeVM.

MakeVM creates disk images for Parallels and VMWare, and although it cost USD 19.99, it appeared to solve my problem, so I decided to try it. I installed it on the Windows XP image running under Parallels and found the “Custom Clone” feature ridiculously easy to use. Since I had no experience with this tool and wanted to recover from each step, I did the following

  1. Back up my entire Parallels virtual machine image by tar-ing it to an external disk.
  2. Back up my second Parallels hard disk image (disk2.hdd).
  3. Choose “Custom Clone” under MakeVM to clone my second hard drive (not the “Virtual Hard Disk” feature, which wants to clone a hard disk image), writing the clone to my external hard disk, since I had little space on the internal disk. When asked whether I wanted to compact the cloned disk, I naturally chose “yes”.
  4. Shut down my virtual Windows XP.
  5. Edit the Windows XP virtual machine settings, removing the existing “Hard Disk 2” image and adding the newly-cloned disk image as “Hard Disk 2”. Windows XP should treat these disks as identical.
  6. Start my virtual Windows XP and judge the results. Although I had to re-install Java to make Eclipse work, everything else appeared all right.
  7. Shut down my virtual Windows XP.
  8. Remove the old Hard Disk 2 image from my internal disk and copy the newly-cloned Hard Disk 2 image to my internal disk, updating the virtual machine preferences accordingly.
  9. Back up my entire Windows XP virtual machine image again, repeating the rest of the process for Hard Disk 1.

This entire process took about a half day, so it helped that I had another computer in the room on which to continue working. Once I completed the process, my Windows XP virtual machine image folder reduced in size from about 22 GiB to its current 9.2 GiB. That rectified my disk space problems. I now have over 16 GiB of breathing room, which means I don’t have to upgrade my hard disk, but rather I can wait to upgrade my entire machine. That makes me happy.

If you have disk space problems, or even if you simply want to save disk space, and you run Parallels or VMWare, I recommend MakeVM to safely compact your disk images. I found it well worth the USD 19.99 I paid for it. If this helps you, then please use the “Discuss” link below to comment.

May 30, 2008 03:00 mac
« Previous 1 3