Add spacers to the OS X dock

· Mac, OS X, dock

I like to organize my applications in the Dock on OS X. This trick will add a spacer that you can place anywhere to create a separation between different groups of apps:

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

The Dock will restart and you'll see an empty space somewhere on your Dock. Just drag it to where you want some extra space and you're good to go.

Dock with Spacers

Passwordless NFS with Vagrant

· vagrant, NFS

Getting tired of having to type your password every time you start up your Vagrant box? Well, I have good news for you because there is a solution for that.

$ sudo visudo

If you are on OS X you can add the following lines:

# Allow passwordless startup of Vagrant when using NFS.
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE

Linux users should add this:

Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD_CHECK = /etc/init.d/nfs-kernel-server status
Cmnd_Alias VAGRANT_NFSD_START = /etc/init.d/nfs-kernel-server start
Cmnd_Alias VAGRANT_NFSD_APPLY = /usr/sbin/exportfs -ar
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /bin/sed -r -e * d -ibak /etc/exports
%sudo ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD_CHECK, VAGRANT_NFSD_START, VAGRANT_NFSD_APPLY, VAGRANT_EXPORTS_REMOVE

Vagrant SSH forwarding not working

· vagrant, ssh

If SSH forwarding on your Vagrant box is not working as expected on you Mac, first check if the SSH agent knows about your SSH key.

On your Mac:

$ ssh-add -L

Most likely your SSH key is not in the list so execute the following command:

$ ssh-add -K ~/.ssh/id_rsa