Skip to content

Instantly share code, notes, and snippets.

View lgw4's full-sized avatar

Chip Warden lgw4

View GitHub Profile
@lgw4
lgw4 / ssh-add-keys.sh
Last active March 31, 2019 18:42
Add SSH Keys to macOS Keychain
#!/usr/bin/env bash
# Add DSA keys
for dsa in ${HOME}/.ssh/*_dsa; do
/usr/bin/ssh-add -K "${dsa}"
done
# Add RSA keys
for rsa in ${HOME}/.ssh/*_rsa; do
/usr/bin/ssh-add -K "${rsa}"
@lgw4
lgw4 / reset_launchpad.sh
Created September 30, 2015 00:42
Reset OS X Launchpad
defaults write com.apple.dock ResetLaunchPad -bool true; killall Dock
@lgw4
lgw4 / retina_13_default.scpt
Created September 2, 2015 20:48
Default resolution (1280 x 800) for MacBook Pro 13" Retina, Yosemite version
-- Default resolution (1280 x 800)
-- MacBook Pro 13" Retina, Yosemite version
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
click radio button "Display" of tab group 1
click radio button "Scaled" of radio group 1 of tab group 1
click radio button 2 of radio group 1 of group 2 of tab group 1
@lgw4
lgw4 / retina_15_default_resolution.scpt
Last active September 2, 2015 20:49
Default resolution on Retina MacBook Pro 15" Yosemite version
-- Default resolution (1440 x 900)
-- MacBook Pro 15" Retina, Yosemite version
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
click radio button "Display" of tab group 1
click radio button "Scaled" of radio group 1 of tab group 1
click radio button 3 of radio group 1 of group 1 of tab group 1
@lgw4
lgw4 / retina_15_rotate_resolution.scpt
Last active September 2, 2015 20:44
Rotate resolution between 1440 x 900, 1680 x 1050, and 1920 x 1200 on MacBook Pro 15" Retina
-- Rotate Resolution… (between 1440 x 900, 1680 x 1050, and 1920 x 1200)
-- MacBook Pro 15" Retina, Yosemite version
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
click radio button "Display" of tab group 1
click radio button "Scaled" of radio group 1 of tab group 1
tell radio group 1 of group 1 of tab group 1
@lgw4
lgw4 / retina_15_most_space.scpt
Last active September 2, 2015 21:04
Set resolution to 1920 x 1200 on MacBook Pro 15" Retina
-- Most Space resolution (1920 x 1200)
-- MacBook Pro 15" Retina, Yosemite version
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
click radio button "Display" of tab group 1
click radio button "Scaled" of radio group 1 of tab group 1
click radio button 5 of radio group 1 of group 1 of tab group 1
@lgw4
lgw4 / retina_15_more_space.scpt
Last active September 2, 2015 21:05
Set resolution to 1680 x 1050 on MacBook Pro 15" Retina
-- More Space resolution (1680 x 1080)
-- MacBook Pro 15" Retina, Yosemite version
tell application "System Preferences"
reveal anchor "displaysDisplayTab" of pane "com.apple.preference.displays"
end tell
tell application "System Events" to tell process "System Preferences" to tell window "Built-in Retina Display"
click radio button "Display" of tab group 1
click radio button "Scaled" of radio group 1 of tab group 1
click radio button 4 of radio group 1 of group 1 of tab group 1
@lgw4
lgw4 / create_os_x_usb_installer.sh
Last active June 8, 2019 20:54
Create OS X USB Installer
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/Mojave --nointeraction
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Set the colours you can use
black='\033[0;30m'
white='\033[0;37m'
red='\033[0;31m'
green='\033[0;32m'
@lgw4
lgw4 / apt-packages-list
Last active August 29, 2015 14:01
Wrapper script for getting a package list on a Debian-based Linux system
#!/usr/bin/env sh
dpkg --get-selections | sort