Skip to content

Instantly share code, notes, and snippets.

View jabenninghoff's full-sized avatar

John Benninghoff jabenninghoff

View GitHub Profile
@jabenninghoff
jabenninghoff / brew-list-depends.sh
Created September 11, 2016 14:51
List all installed brews along with their dependencies
#!/bin/sh
# one-liner courtesy of http://zanshin.net/2014/02/03/how-to-list-brew-dependencies/
brew list | while read cask; do echo -n "$cask ->"; brew deps $cask | awk '{printf(" %s ", $0)}'; echo ""; done
@jabenninghoff
jabenninghoff / osx-mount-drives-on-boot.md
Created September 10, 2016 16:07
Configure OS X to mount external drives at boot

By default, OS X only mounts external drives (USB, Firewire, Thunderbolt, etc.) when you log in, and unmounts them when you log out or reboot. To change this behavior, enable AutomountDisksWithoutUserLogin.

sudo defaults write /Library/Preferences/SystemConfiguration/autodiskmount AutomountDisksWithoutUserLogin -bool true

Installing OS X Server also enables this setting.

Alternatively, you can create the /Library/Preferences/SystemConfiguration/autodiskmount.plist with the following content:

@jabenninghoff
jabenninghoff / ssh-require-publickey-external.md
Last active December 20, 2015 16:15
Configure ssh to require public-key based authentication only for external networks

Given: my local network is 10.1.1.0/24, my username is jabenninghoff, my ssh host is ssh.example.com, my host's address is 10.1.1.17, my ssh port is 22, and I'm connecting from either 10.1.1.33 (locally) or 172.16.1.20 (remotely)
When: connecting from the local network
Then: allow default ssh authentication methods

When: connecting from other networks
Then: require key-based authentication

Configure using a Match rule:

Match Address *,!10.1.1.*