Tag Archives: Mac

Mount a Mac volume on a Mac from the command line

I still feel like a noob on a Mac even though I’ve been working professionally on one for almost 9 months.  Today I needed to copy files from one Mac to another and I wanted to do that all from the command line.  One way to do that is to use the mount command.  Here are the steps:

cd /Volumes
mkdir remotedisk
mount -t afp afp://remotehost/shareddir remotedisk

The trick here is to specify the file system (-t afp) and to specify the remote shared folder with the correct syntax (afp://remotehost/shareddir).

I found the man pages for mount to be less than helpful for discovering this.  However, I did find a web page that helped.

Adding a separator to the Mac OS X Dock

I’m now developing iPhone apps at work which means developing on a Mac.  It’s quite a shift from Windows, so I’ve been spending time learning the ins and outs to become comfortable with the platform.

One of the things I discovered is that the Dock doesn’t provide a way in the UI to add spacers (dividers) between application tiles.  There are two ways to do this.

Add a dummy application to the Dock

This solution is really simple. Brandon Kelly wrote a very simple application Dock Dividers.  Dock Dividers is simple a collection of do-nothing applications with an application image that looks like a divider.  All you do is simply drag an application to the place in the dock where you want a spacer.  The biggest issue is that you have to make sure you don’t drag the same application to the Dock more than once.

Dock Divider

Use the defaults program from Terminal to add a spacer

The Dock application actually does support the concept of a spacer tile.  Apple just chose not to expose it in the UI.  To add a spacer tile, type the following sequence of commands in a Terminal window:

defaults write com.apple.dock persistent-apps -array-add '{ "tile-type" = "spacer-tile"; }
killall Dock

You can add as many spacer tiles as you want.  Once you’re done adding them, execute the killall command to restart the Dock.

Dock Separator

To remove a spacer tile, simply drag it from the Dock, release it somewhere else, and watch it go up in a poof of smoke.

The biggest issue I see with this method is that the spacer tile is simply a space on the dock.  You don’t get to specify an image to make it look nicer.  Hmm… as I think about this, I’m sure there is a way.  Let me know if you figure it out.

Resources