Articles tagged: macintosh

Windows tool to clean up OS X junk files

I wrote a little old-school Windows HTA script to delete the .DS_Store, .Trashes, and ._* junk files and directories typically littered across non-HFS media by Mac OS X:

nosx

You can download it from my GitHub account if you have a use for this sort of thing. Written and tested with Windows 7 and IE 8; I’m not sure how it will work with earlier versions of either. Standard disclaimers apply: use at your own risk, etc.

Incidentally, I think HTAs are really underrated as Windows scripting goes. More on that topic later…

Exporting AddressBook birthdays to Remind

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.

You can also view the source code repository on Github.

halfdim

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

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…

Pagination