18th March 2012

Mac OS X Reference

Service User Accounts

dscl / -create /Users/foo
dscl / -create /Users/foo UserShell /bin/bash
dscl / -create /Users/foo RealName "Foo Bar Baz"
dscl / -create /Users/foo UniqueID 1234
dscl / -create /Users/foo PrimaryGroupID 1000
dscl / -create /Users/foo NFSHomeDirectory /Local/Users/foo
dscl / -passwd /Users/foo PaSsWoRd
dscl / -append /Groups/admin GroupMembership foo

Disabling Spotlight

Disable indexing on all volumes:

mdutil -a -i off

Minimal Cocoa Programming

/* gcc -o example example.m -framework Cocoa */
#include <Cocoa/Cocoa.h>
int
main(int argc, char *argv[])
{
    NSAutoreleasePool *pool = [NSAutoreleasePool new];
    [NSApplication sharedApplication];
    /* ... */
    return 0;
}

Enabling Core Dumps

ulimit -c unlimited
ls /core/core.$PID