Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick McSpadden nmcspadden

View GitHub Profile
@nmcspadden
nmcspadden / bootstrap.py
Last active Jun 30, 2020
Bootstrap Chef
View bootstrap.py
#!/usr/bin/python
"""Bootstrap Chef with no other dependencies."""
import os
import sys
import platform
import subprocess
import json
import plistlib
import urllib2
@nmcspadden
nmcspadden / AddWifi.sh
Last active Jul 31, 2019
AddWifi.sh - joins a wifi network at the login window.
View AddWifi.sh
#!/bin/sh
# Set paths to our utilities
networksetup=/usr/sbin/networksetup
airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
# Determines which OS the script is running on
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
# On 10.7 and higher, the Wi-Fi interface needs to be identified.
View mad_wizard_deekin_familiars.vbs
;LEVEL DETECTOR GEM FARM
;This script is designed to farm gems and boss chest drops by automatically progressing through low level areas, then resetting and starting over the same mission
;It achieves this by levelling click damage and clicking automatically to kill enemies as fast as possible. To ensure the fastest boss kills, and to pick up
;item drops, it utilizes a pixel-color detector to determine when the game is changing levels. This allows it to know when it is 'safe' to level champions
;or click damage without missing anything, and allows it to click in the right place to pick up items as they drop and to open the boss loot bag as soon
;as it reaches the middle of the screen. Overall this allows for a sub 11 minute run, with no down time; the script resets as soon as it reaches area 31.
;Settings: Set your adventure map to show all, including completed adventures (though the script should handle this). Set level up mode to UPG (though the script should handle this),
;turn on autoprogress (though the
@nmcspadden
nmcspadden / SignProfiles.sh
Last active Mar 3, 2018
Signs a folder full of profiles
View SignProfiles.sh
#!/bin/bash
for profile in Profiles/*.mobileconfig
do
s=${profile##*/}
outName=${s%.*}
outName+="Signed.mobileconfig"
/usr/bin/security cms -S -N "Mac Developer Application" -i $profile -o "$outName"
done
View xcode_results_9.2.txt
autopkg run -vvv Xcode.munki -p ~/Downloads/xcode_9.2.xip
Processing Xcode.munki...
...
PackageRequired
{'Input': {}}
{'Output': {}}
XcodeXIPUnpacker
{'Input': {'PKG': '/Users/nmcspadden/Downloads/xcode_9.2.xip'}}
XcodeXIPUnpacker: Xar unpacking /Users/nmcspadden/Downloads/xcode_9.2.xip
XcodeXIPUnpacker:
View xcode_results_9.3b2.txt
$ autopkg run -vvv Xcode.munki -p ~/Downloads/Xcode_9.3_beta_2.xip
Processing Xcode.munki...
...
PackageRequired
{'Input': {}}
{'Output': {}}
XcodeXIPUnpacker
{'Input': {'PKG': '/Users/nmcspadden/Downloads/Xcode_9.3_beta_2.xip'}}
XcodeXIPUnpacker: Xar unpacking /Users/nmcspadden/Downloads/Xcode_9.3_beta_2.xip
XcodeXIPUnpacker:
@nmcspadden
nmcspadden / bash_output
Last active Nov 28, 2017
Testing named vs. unnamed loggers
View bash_output
$ python named_logger.py
WARNING:root:warning
ERROR:root:error
CRITICAL:root:critical
Hi.
$ python unnamed_logger.py
2017-11-28 08:05:40 INFO: Writing verbose debug log to: /var/folders/th/3tqg05g54f73x0k_mstm5wy1_0g_xw/T/mm.XcXk7B.log
2017-11-28 08:05:40 INFO: info
2017-11-28 08:05:40 WARNING: warning
2017-11-28 08:05:40 ERROR: error
@nmcspadden
nmcspadden / ARD kickstart
Created May 8, 2013
Kickstarts ARD for admin user
View ARD kickstart
#!/bin/sh
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -configure -allowAccessFor -specifiedUsers
/System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -access -on -users "admin" -privs -all -restart -agent
View date_verification.py
#!/usr/bin/python
"""Verify the date because Apple can't."""
import datetime
import shell_tools
import sys_tools
current_year = int(datetime.datetime.now().year)
sys_tools.log('CPE-date_verification', 'Year is: %s' % current_year)
View Xerox WC 7556
#!/bin/sh
# Variables. Edit these.
printername="shhs_gabrielle".sacredsf.org
location="SHHS Gabrielle"
gui_display_name=$location
address=$printername
driver_ppd="/Library/Printers/PPDs/Contents/Resources/Xerox WC 7556.gz"
# Populate these options if you want to set specific options for the printer. E.g. duplexing installed, etc.
option_1="XRLanFax=False"
You can’t perform that action at this time.