enjoy

etc

Archive for the 'tips' Category

So my Magic TrackPad suddenly stopped working after a year or so of use. Wouldn’t pair with my iMac no matter what I did. Tried resetting it, replacing the batteries. Nothing worked. Tried to pair it with my MacBook pro and same result. It might appear briefly as an available Bluetooth device but not long enough to successfully pair.

The last time I tried to reset it I noticed something odd: the Mac mini Git server sitting under the desk briefly woke up. Ah ha, the trackpad had paired with the mini and kept re-pairing with it every time it was reset. Sure enough, it’s listed as a device on the mini. No problem, just turn off the Bluetooth on the mini.

Did I mention it’s my Git server? Did I mention it’s a headless Git server, i.e. no attached display, keyboard or mouse? As it turns out at least on 10.6 you can’t turn off Bluetooth if there is no physical mouse or keyboard attached. Well you can but it turns itself back on after a few seconds.

A quick visit to /Library/Extensions, move the Bluetooth extensions to /Library/Extensions (Disabled) and a reboot and Bluetooth is well and truly off and everything else still works just fine.

Maybe I’m missing something but it appears that Leopard Mail removed the old preference to prefer the plain text version for incoming messages over fancy HTML formatting. It still seems to be implemented, it was dutifully transferred when I updated to Leopard, but I can’t see any way to actually set it in the Preferences window.

For anyone who wants to enable this feature you should be able to do it by opening a Terminal window then type the following command followed by a RETURN:

Many of my projects must support previous Mac OS X versions including at least 10.3, and in order to do that I have to make sure the PowerPC version is built with GCC version 3.3 rather than 4.x or the app fails to load on 10.3 and earlier. So to handle that I add an Xcode project setting named GCC_VERSION_ppc with value of 3.3 to force the PPC version to build with GCC 3.3 and everyone’s happy.

Ran into a strange problem lately where breakpoints would not work on my G5 tower but worked just fine on my Intel laptop. Same version of Xcode, same everything else I could see. EXCEPT I finally realized that the problem was that special GCC compiler setting. Apparently Xcode 3 can’t debug code compiled with GCC 3.3.

The solution is easy: instead of adding the GCC_VERSION_ppc setting to All Configurations, add it just to the Release configuration. That way Debug builds can still use breakpoints but the final will still run on Mac OS X 10.3.

The downside is you are no longer debugging with the same version of the compiler as the release uses but since bugs are never caused by the compiler that shouldn’t be an issue, right? (NOTE: This is what’s sometimes called sarcasm.)

OK, let’s say you bought an AppleTV and while playing with its settings paired the remote to it. Let’s also say you decided to void your (modest and about to expire anyway) warranty by installing something like, oh say, Awkward TV. And after successfully installing it you maybe discovered that your remote didn’t actually work to control the AppleTV any more and had visions of having to really violate it by cracking open the case, hooking its drive to a Mac and directly manipulating the contents so you can restore it to factory defaults.

Before you do that you might try pressing and holding the MENU and |<< (rewind) buttons for a few seconds to unpair the AppleTV remote.

Not that you necessarily did any of that, but I’m just saying if you did.

From time to time I’ve downloaded Mac OS X Disk Image files only to have the system display a cryptic warning that it failed to mount because it was “Not Recognized”. It’s happened several times when I tried to download the Intel Mac version of the excellent free 3D package Blender and I wrote it off as corrupted files.

It happened again yesterday but this time today I bumped into this weblog posting by Unsanity that points at a server configuration issue as being the cause. Basically, the disk image is sent to Safari as a generic blob of data instead of being tagged as a disk image and Safari makes an (incorrect as it turns out) guess presumably based on the “bz” in the file name that the disk image was compressed using bzip2 after it was created and appends the extension .bz2 to the download when in fact the bz probably means the contents of the disk image use that compression method. OS X dutifully applied the bz2 decompression algorithm to the disk image data, strips off the extension and attempts to mount the resulting disk image which fails because it’s been thoroughly scrambled.

Now many compression methods include internal checks (looking for specific tags or verifying a checksum) to make sure you are applying them to bone fide compressed data but it appears bzip2 doesn’t, or at least the OS X archive helper doesn’t use them.

The proper fix is to let the provider of the file know about the problem, and point them at Unsanity’s post at http://www.unsanity.org/archives/macosx/mydmgisbwokenafter_download.php for details. The temporary workaround is to, when and only when you see the “not recognized” warning, remove the .bz2 extension from the original downloaded file leaving just the final .dmg then try opening file again in the Finder. If this was the cause of the problem the disk image will successfully verify and mount.

As to why only the Intel version of Blender had the problem, it turns out that the PowerPC version is served as a .zip with the correct MIME type rather than as a .dmg disk image.