Written by David on Fri, Oct 21, 2011 at 3:40pm
Filed under OS X
OS X Mail defaults to including all attachments at the end of emails. While useful for some file types (ZIP archives, programs, etc.), I still prefer that images be embedded exactly where I paste them in a message.
This insert-at-the-end behaviour can be disabled by unchecking an option in the Edit/Attachments menu:

Unfortunately, the option always reverts to being checked again for subsequent emails, with no obvious way to disable this behaviour permanently. As it turns out, the solution is simple:
If you disable this option while editing an email, it will remain disabled for that message only. If you disable this option from the main window, it will remain disabled for all future messages.
Tangentially, the option to “Send Windows-Friendly Attachments” can only be toggled when you are not editing an email. When you have a message screen open, the option is greyed out.
These options seem like perfect candidates for Mail’s Preferences menu. Why they exist solely as menu options and why they behave this way remains a mystery to me.
Written by David on Mon, Oct 17, 2011 at 4:05pm
Filed under OS X, Security, Unix
nginx defaults to running its master process as root and all workers as nobody.
You can tell nginx to run worker processes under different credentials by setting the user directive in nginx.conf.
On OS X, you need to specify a valid group as well, since nginx will default to looking for a group that doesn’t exist. You will see “nginx – getgrnam()” in the error log when this happens. The easiest solution I found is to assign the OS X staff group:
user userid staff
It probably bears mentioning that changing the runtime credentials won’t negate the need for sudo if you run your web server on port 80, since OS X (and all Unixes) will not allow nginx to use that port unless it runs as root.
Written by David on Fri, Oct 14, 2011 at 5:55pm
Filed under OS X
OS X’s dock allows the addition of spacer tiles, blank objects that occupy the same space as an application icon. Spacer tiles are quite helpful for organising applications into logical groups.

Adding spacer tiles is relatively simple:
- Launch Terminal (from Applications/Utilities).
- Cut and paste the following into the command line, once for each tile you want to add. (Need 4 tiles? Run it 4x.)
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}'
- Restart the dock:
killall Dock
Spacer tiles behave like normal application icons: they can be dragged into any position, or dragged out of the dock completely to remove them.