Skip to content

Instantly share code, notes, and snippets.

View jabenninghoff's full-sized avatar

John Benninghoff jabenninghoff

View GitHub Profile
@jabenninghoff
jabenninghoff / fix-osx-vnc-black-screen.md
Created August 30, 2017 12:21
Fix the VNC "Black Screen" on older versions of OS X

Occasionally on older versions of OS X, connecting to a remote system via VNC will result in a "Black Screen" that is non-responsive. To fix this, kill the loginwindow process:

$ ps ax | grep loginwindow
   83   ??  Ss     0:00.89 /System/Library/CoreServices/loginwindow.app/Contents/MacOS/loginwindow console
$ sudo kill 83

loginwindow will automatically restart and the login screen will appear.

Thanks to Mac Mini World!

@robeastham
robeastham / cloud-config.yml
Last active May 17, 2019 20:36
This is a cloud-config file template for Rancher OS. Fill in the blanks and it'll automatically setup your Rancher Server behind an Nginx proxy and register Let's Encrypt SSL certs and then renew them automatically
#cloud-config
ssh_authorized_keys:
- ssh-rsa <my-public-key>
rancher:
services:
nginx-proxy:
image: jwilder/nginx-proxy:0.4.0
restart: unless-stopped
ports:
- "80:80"
@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:

@rudelm
rudelm / autofs.md
Last active May 15, 2024 17:28
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@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.*
@L422Y
L422Y / osx_automount_nfs.md
Last active May 10, 2024 09:06
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@jasoncodes
jasoncodes / README.markdown
Created October 6, 2010 11:16
Run VMware Fusion headless at Mac OS system startup

Run VMware Fusion headless at Mac OS system startup.

I heard you like headless VMs on your Mac so I wrote this script for your launchds.

Assumptions

  • Tested on Mac OS X 10.6.4 with VMware Fusion 2.0.5 and 3.1.1.
  • A interactive user automatically logs into the system at startup. I had some issues trying to get this running without an interactive user logged in. I automatically log in for Airfoil Speakers anyway.
  • Your virtual machines live in /Virtual Machines