This is entirely unofficial, I'm just using it to collect some of the niftier OS X hacks I've found while bouncing around the 'net since the public beta came out. I'm concentrating on hacks accessed using the defaults command line program, as these are the ones I have the hardest time remembering the syntax for.

Defaults

The defaults command line program is used to adjust all the hacks I've collected here. Some tips on using it:

For any setting where you are changing behaviour with a true/false switch, just retype the command with the opposite setting to revert to defaults.

To see all the system defaults (lots of info):

defaults read

To see the different domains (sections) of defaults available:

defaults domains

To see a specific domain's defaults:

defaults read domainName

Built-in help for defaults:

defaults help


Dock

With each of these hacks, after you make the change you'll need to quit the dock before you'll see the change. This can be done either by rebooting, logging out and back in, or forcing the application to quit, either through the control-alt-escape dialog box or the unix 'kill' command.

Changing icon behaviour:

To make hidden app icons display as translucent:

defaults write com.apple.dock showhidden 1

...and use a value of 0 to reset to no transparency.

To make the foreground app's triangle display blue:

defaults write com.apple.dock showforeground 1

...and again, set the value to 0 to display all arrows as black.

Different Genie effects:

The dock actually has three seperate minimization effects that it can use - pick one you like. "Genie" is the default behaviour.

defaults write com.apple.dock mineffect genie

defaults write com.apple.dock mineffect scale

defaults write com.apple.dock mineffect suck


Finder

Zoom rectangles:

Disabling zoom rectangles:

defaults write com.apple.finder ZoomRects false

Showing hidden files:

To show all files normally hidden by the system:

defaults write com.apple.finder ShowAllFiles true


Sherlock

Changing the banner graphic and target:

To change the displayed graphic:

defaults write com.apple.Sherlock internetUrlDefaultBannerImage file:///~Documents/banner.gif

...where "banner.gif" is the name of a banner file in your default Documents folder.

To change the target URL:

defaults write com.apple.Sherlock internetUrlDefaultBannerLink http://djwudi.dyndns.org

...where the URL is the URL you wish the banner to point to.


Terminal

Transparent terminal windows

In the terminal, type...

defaults write com.apple.terminal TerminalOpaqueness X

...where X = a value between 0 and 1 (.85 works well). Then either exit and restart the Terminal program, or just use command-N to open a new terminal window. You may need to experiment with the colors a bit - I'm using a black background with bright green text, and it works well, I've heard that a white background makes it look like a pane of smoked glass.


UNIX processes

Enabling sendmail

All this takes is a couple simple changes to some textfiles on the drive. You'll need root access to do this, though, and I'd suggest using vi or some other unix command-line level editor to be sure that the file gets saved with unix-style linebreaks.

First, edit /etc/hostconfig, changing the line MAILSERVER=-NO- to MAILSERVER=-YES-.

(Optional step - only necessary if you have a qualified domain name and intend to recieve mail on the machine. Not necessary for sending only.) In the same file (/etc/hostconfig), change HOSTNAME=-AUTOMATIC- to HOSTNAME="yourmachine.yourdomain.com".

Now, to get sendmail to startup automatically at boot, you need to edit the file /system/library/startupitems/sendmail/sendmail. Towards the end of the file, you'll see a line that ends with an ampersand (&). Remove the ampersand, and save the file.

Reboot!

To test sendmail, create a textfile (in this example, the filename is testmail.txt). Then type this at in the terminal:

mail -s "Subject of the mail" YourEmailAddress@wherever.com < testmail.txt

For a slightly clearer example, my test looked like this:

mail -s "testing..." djwudi@yahoo.com < testmail.txt

Wait a few moments, and your mail should show up at whatever address you sent it to!

You may get this error returned to you when you try the test send:

/etc/mail/sendmail.cf: line 81: fileclass: cannot open /etc/mail/local-host-names: Group writeable directory

This seems to mean that the root ( / ) directory's permissions are wrong, even though it's giving a different directory. Make sure that the root of the filesystem is set to 755, not 775. That should do it!

Removing the non-english language packs

As OS X comes localised for many different languages, it includes a ton of *.lproj files that are used to translate the OS and applications to the correct language. If you don't plan on using any other language, you can somewhat easily delete those files - and save yourself about 270Mb of drivespace!

You'll need to execute these commands as root.

To delete all non-english files:

find / \! -name "English.lproj" -name "*.lproj" -type d -exec rm -rf -- { } \; -prune

The find and delete operations will take about five minutes, and should clear up about 270 Mb of drivespace.

Here's a quick explanation of the various parts of the command:

find / - executes the 'find' command, and tells it to start at the root ( / ) level of the system

\! -name "English.lproj" -name "*.lproj" - tells find to look for any file that ends in '.lproj' except files with the full name of 'English.lproj'

-type d - tells find only to look at directories (all the .lproj 'files' are actually directories)

-exec rm -rf -- { } \; - tells find to run the 'rm' command on the results of its search (-rf tells rm to recursively delete through the directory tree wihout confirmation, -- tells rm that anything following that is not an argument, I don't completely understand what the brackets do, and the \; signals the end of the 'exec' statement)

-prune - tells find not to look further into a directory once a match has been made; this prevents the rm command from trying to remove a directory inside a directory that's already been removed.