The hostname you initially chose for your Mac gets used in various ways; as a friendly identifier for the user, file sharing, command line networking and services like AirDrop. Although you can change the computer name used for file sharing in the System Preferences GUI, that’s only used for file sharing. To update the hostname across the board, you need to issue the following three commands, followed by a reboot for good measure.

ComputerName is the name shown to the user in most of the GUI, and is used for things like AppleTalk and Windows file sharing.

sudo scutil --set ComputerName "my-laptop"

HostName is the name that you’ll be using at the terminal and for networking, as reported by the hostname command.

If you’ve installed the Android File Transfer application for OS X, you’ll find it automatically starts each time you connect your Android device to your Mac. This behaviour is fine if you only connect your Android device to your Mac for the purpose of transferring files, but it becomes a bit of a nuisance when you just want to charge your device or use it for development purposes.

There’s no setting within the app to disable auto-starting so you need to manually disable the agent that ‘listens’ for Android device connections. Here’s how to do that.

Edit (8th January 2013): The above worked well for me until some time around the start of the new year, probably tied in with my Mac updating to OS X Mavericks. Now, an additional step is required to keep the agent from auto-starting, and is included in the following instructions.

Open the Users & Groups panel in System Preferences, and remove any entry for ‘Android File Transfer Agent’ in your user’s ‘Login Items’.

Done! You can still manually start the Android File Transfer application (as you would for any other application) but now there’s no more auto-starting.

If you want to re-enable auto-starting at a later date, simply rename the two app files back to their original names and manually start the Android File Transfer application to kick start the agent again.

If you’re feeling especially geeky, you could achieve the same thing from the command line. Here’s a not-so-pretty one liner that will kill the agent process if it’s running, rename the two agent .app files, and remove the agent from your user’s ‘Login Items’.

If you have the Dock set to automatically hide and show, you will have probably noticed that there’s a small but perceptible delay between it being triggered and it actually appearing. This is by design, to make it more difficult to trigger by accident, but when you need to flick between items in the dock frequently, those wasted milliseconds can become quite annoying very quickly.

There aren’t any options to control the dock delay from within the System Preferences but it is very easy to adjust via the command line. The following commands will work on OS X 10.7 (Lion) or newer.

The setting to control the delay is called autohide-delay and its value is specified in seconds. Personally, I have this set to 0 so that it’s instantaneous but you can set it to whatever you like by changing 0 in the following command to your desired value. The default is probably around 0.3.

defaults write com.apple.Dock autohide-delay -float 0
killall Dock

To restore the default delay:-

defaults delete com.apple.Dock autohide-delay
killall Dock

In addition to reducing the delay, you can speed things up further by specifying the duration of the Dock animation. This setting, called the autohide-time-modifier, is also specified in seconds. A value of 0 is instantaneous (no animation). I like a value of 0.4 which makes the dock feel very snappy whilst still looking pretty slick.

Modifying the EXIF data in photos is pretty easy – a lot of image viewing / editing apps will let you do this, but usually only on a one by one basis. That’s a lot of pain for when you need to work with a whole lot of photos, and of no use at all from the command line. A quick Google search turned up a selection of apps that looked like they would do the job but I settled on Jhead because it works from the command line and it is available from Ubuntu’s standard repositories. There are also Windows and OS X binaries available.

Installing Jhead

Jhead’s been around for over a decade so if you’re using Linux, it’s most likely in your distro’s repositories. For Windows and OS X you can download it from here. It’s also available from Mac Ports on OS X, and probably via Homebrew too.

On Ubuntu, installing Jhead is as easy as:-

sudoapt-get install jhead

sudo apt-get install jhead

Modifying the EXIF Date and Time

Firstly, you need to work out how much time you need to adjust your photo’s EXIF data by in order to correct them. Because the photos I was working with came from two different cameras, each with a different date and time set, I separated them in to two directories and did this for each.

A full summary of Jhead’s command line arguments can be found here but for most purposes there are only two options we need to make use of, one for adjusting the time by a specified offset and one for adjusting the date.

To adjust the time, we use the -ta option followed (without space) by the offset to use in hh:mm or hh:mm:ss format. If, for example, your photo’s times are set 1 hour too far in to the future, we can subtract a single hour from all photos using the following.

jhead -ta-1:00 *.jpg

jhead -ta-1:00 *.jpg

If the photos were set 12 hours, 20 minutes and 43 seconds too far in the past, we’d offset with a positive value.

jhead -ta+12:20:43*.jpg

jhead -ta+12:20:43 *.jpg

For offsets greater than 24 hours, we can use the -da option followed by two dates in yyyy:mm:dd format, or to include a time, as yyyy:mm:dd/hh:mm:ss. Because years and months have different numbers of days, rather than specifying an offset, we actually specify two dates for this option – the first being the date to translate to, relative to the second.

So if a particular photo was taken on the 29th February 2012 at 8:21am, but the camera recorded it as the 1st January 2000 at 2:24pm, we would use the following.

jhead -da2012:02:29/08:21-2000:01:01/14:24*.jpg

jhead -da2012:02:29/08:21-2000:01:01/14:24 *.jpg

It doesn’t matter that the photos weren’t all taken at the very same time specified by either date in this argument, Jhead will just work out the correct offset to use from the before and after dates and apply it correctly to each photo individually.

Setting the File System’s Timestamp

This is not strictly necessary but can be useful if you want your file system’s file creation dates to now match those of the newly fixed EXIF dates.

jhead -ft*.jpg

jhead -ft *.jpg

Additonal Options

Jhead can also perform some other useful tasks such as image rotation in accordance with the image’s orientation tag, extracting camera settings, displaying embedded GPS info, etc. Check out it’s full list of command line options to learn more.