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

Site Navigation


February 2007

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.

Vista

February 3, 2007 7:41 PM

The University’s software licensing program proudly furnishes UF engineering students with Microsoft’s latest-and-greatest (with the notable exception of cash cow Microsoft Office). As of Wednesday, latest-and-greatest meant Windows Vista Business Edition*, so I decided to download it and, with the help of Boot Camp, give it a run on my iMac. Here are my notes and impressions, in no particular order:

  • It’s faster than I expected. It takes almost twice as long as OS X to boot, but programs (subjectively) seem to start more quickly.
  • The new user interface is nice. I still prefer Exposé to Flip3D, but things such as real-time previews of taskbar items and a hardware-accelerated UI make this the first version of Windows that I actually feel comfortable while using.
  • User Account Control is a mess. Some operations, such as touching a file in C:\Program Files\, require you to confirm your intent twice – once for UAC, and once again for what appears to be some manifestation of Windows Security Center. Talk about the left hand not knowing what the right is doing.
  • AutoPlay finally asks for your confirmation before automatically executing whatever program or virus might be on that CD you just stuck in your computer. A small touch, but this one’s been a long time coming.
  • Data Execution Prevention (NX bit support) is enabled by default for the operating system, and optionally for the rest of your programs as well. This didn’t seem to cause any problems with the relatively small set of software that I’ve installed so far. Apple needs to bring this feature to OS X as soon as possible.
  • The whole system seems quite a bit less naggy than XP was about activating your OS and so on. Granted, “less naggy than XP” might not be saying much, but it goes a long way to improve the overall user experience.
  • It isn’t entirely stable. The whole system locked up on me three times while I attempted to install (the admittedly not-entirely-Vista-ready, but-whose-fault-is-that) Microsoft Visual Studio 2005. That shouldn’t happen.

Aside from DRM issues, Vista really is a solid improvement over XP. In particular (and I’ll probably get burned at the stake for saying this), Vista is interesting because it may represent the first time in PC history that Microsoft Windows is, on paper but probably not in practice, on par with or better than the most prominent “alternative” desktop operating systems in terms of security against remote attack. I would really like to see OS X pick up heap-side support for the NX bit to complement the protection already in place against stack overrun attacks, and both OS X and the most popular Linux distributions integrate an analogue to Vista’s OpenBSD-inspired address space layout randomization.

However, despite the extended Beta stage Windows Vista still doesn’t have the feel of a finished product. Things like the quirkiness of UAC and possible stability issues (not to mention the lack of an entirely Vista-ready version of Visual Studio) make me recommend that anyone who relies on Windows as a primary operating system hold back from upgrading just yet, at least until the first service pack rolls around the corner. As history shows, one can never be too cautious with a first-iteration Microsoft product.

*Too bad they couldn’t spring for Microsoft Windows Vista Ultimate Upgrade Limited Numbered Signature Edition. Yes, it’s real.