mark shroyer, dot com: this is where I keep my things

Site Navigation


Macintosh

Exporting AddressBook birthdays to Remind

May 20, 2007 12:06 PM

I always thought I was a bit of an oddball for choosing the ancient scheduler Remind as my favorite OS X calendar software. But as it turns out, I’m not quite as alone as I had assumed. I guess OS X is a bigger draw to Unix geeks than I realized.

So I’ve decided to publish a tool that I wrote a few months back, a simple little Objective-C command line application that reads the birthdays of all your OS X AddressBook contacts and outputs them in .reminders format.

The source code bundle is here. After installation, see the manpage remind_birthdays(1) for documentation.

halfdim

February 7, 2007 9:41 AM

It seems to be a commonly experienced problem with the Intel rendition of OS X 10.4 that some power management settings, such as the halfdim pmset parameter (a.k.a., “automatically reduce the brightness of the display before display sleep”) may be reset when the system boots. Since I started dual-booting Vista my reboots have increased from about once a week to a few times a day, so I decided to tackle this annoying little bug with a StartupItem.

Here’s how to do it. First, make a directory named PMSetManager in /Library/StartupItems. Create two files in this new directory, StartupParameters.plist and PMSetManager, with the specified contents.

/Library/StartupItems/PMSetManager/StartupParameters.plist:

{
    Description = "PMSetManager";
    OrderPreference = "Late";
    Provides = ("PMSetManager");
    Message =
    {
        start = "Starting pmset manager";
        stop = "Stopping pmset manager";
    };
}

/Library/StartupItems/PMSetManager/PMSetManager:

#!/bin/sh

# pmset manager
#
# Resets the 'halfdim' pmset parameter to false
# on reboot, in order to counteract what appears
# to be a bug on OS X 10.4.

. /etc/rc.common

StartService ()
{
    if [ "${PMSETMANAGER:=-NO-}" = "-YES-" ]
    then
        ConsoleMessage "Starting pmset manager"
        pmset -a halfdim 0
    fi
}

StopService ()
{
    ConsoleMessage "Stopping pmset manager"
}

RestartService ()
{
    StopService
    StartService
}

RunService "$1"

(The pmset command in this script can do more than just disable display dimming, if you like. See `man 1 pmset` for all your options.)

Next, make the PMSetManager script executable:

$ sudo chmod +x /Library/StartupItems/PMSetManager/PMSetManager

And finally, append “PMSETMANAGER=-YES-” to /etc/hostconfig in order to enable your new StartupItem. Now congratulate yourself for no longer needing to run System Preferences to get rid of that pesky dimming option every time you log in, and you’re good to go.

Apple battery recall

August 24, 2006 3:53 PM

Probably to help ensure that this doesn’t happen to anyone else, Apple has decided to recall more than a million batteries shipped with its G4 iBook and PowerBook computers from October 2003 through 2006:

powerbookexplode_01.jpg

More information can be found on the Apple web site. On the positive side of this, at least I’m getting a fresh new battery for my two-year-old laptop…