Archive for January, 2009

A screensaver to send your display to sleep.

Saturday, January 31st, 2009

I poked around a bit looking for something that did this, and couldn’t find anything, apart from some sample code using a private API to send the display to sleep, so I whacked that into a screeensaver.

https://sites.google.com/a/explanatorygap.net/misc-sw/files/SleepSaver.saver.zip

This does use a private API and thus could do anything. No warranties, may destroy your machine, etc etc etc, but works for me.

code:

//
//  SleepSaverView.m
//  SleepSaver
//
//  Created by Nigel Kersten on 1/29/09.
//  Copyright (c) 2009, Google Inc. All rights reserved.
//

#import "SleepSaverView.h"

@implementation SleepSaverView

- (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
{
self = [super initWithFrame:frame isPreview:isPreview];
if (self) {
if (! isPreview) {
[self dimDisplayNow];
}
}
return self;
}

- (BOOL)hasConfigureSheet
{
return NO;
}

- (NSWindow*)configureSheet
{
return nil;
}

- (void) dimDisplayNow {
io_registry_entry_t r = IORegistryEntryFromPath(kIOMasterPortDefault, "IOService:/IOResources/IODisplayWrangler");
if (r) {
IORegistryEntrySetCFProperty(r, CFSTR("IORequestIdle"), kCFBooleanTrue);
IOObjectRelease(r);
}
}

@end

Awesome Daemons and Agents TechNote

Saturday, January 24th, 2009

http://developer.apple.com/technotes/tn2005/tn2083.html

This is really just going here so I can find it again as I can never remember what keywords to search with to find it and I often need to refer to it.

AAAAA+++ Excellent TechNote Would Read Again kthxbye

Macworld 2009: Puppet on Mac OS X

Friday, January 9th, 2009

Macworld 2009: Python for System Administration

Friday, January 9th, 2009

Presentation here: