Skip to content

Instantly share code, notes, and snippets.

View nmcspadden's full-sized avatar

Nick McSpadden nmcspadden

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>autoremove</key>
<true/>
<key>catalogs</key>
<array>
<string>testing</string>
</array>
def run(cmd):
'''Runs a command with subprocess, printing output in realtime'''
proc = subprocess.Popen(
cmd,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT
)
while proc.poll() is None:
l = proc.stdout.readline()
print l,
@nmcspadden
nmcspadden / gist:5091486
Last active December 14, 2015 13:09
AddWifi LaunchAgent.plist - the startup launchd item for the AddWifi script.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>org.sacredsf.wifi.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/libexec/add_wifi.sh</string>
</array>
@nmcspadden
nmcspadden / gist:5162560
Created March 14, 2013 15:58
Adobe CreativeSuite 5 repackage pkginfo
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>RestartAction</key>
<string>RequireRestart</string>
<key>autoremove</key>
<false/>
<key>catalogs</key>
<array>
@nmcspadden
nmcspadden / gist:5162585
Created March 14, 2013 16:00
Adobe Creative Suite 6 pkginfo, generated with AAMEE 3.1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AdobeSetupType</key>
<string>ProductInstall</string>
<key>adobe_install_info</key>
<dict>
<key>media_signature</key>
<string>{D8C642B6-A719-4234-8039-2654ED436D2A}</string>
@nmcspadden
nmcspadden / ARD installcheck_script
Last active December 15, 2015 00:28
ARD installcheck_script to make sure Admin is among the list of ARD users, but not everyone is.
#!/bin/sh
# Determines if the Remote Management settings are set
# for "All Users" or for "Only these users:" in System
# Preferences' Sharing preference pane
ARD_ALL_LOCAL=`/usr/bin/defaults read /Library/Preferences/com.apple.RemoteManagement ARD_AllLocalUsers`
# Lists all local user accounts on the Mac with a UID
# of greater or equal to 500 and less than 1024. This
/*global SpreadsheetApp: false, UiApp: false */
// Close the current UI
function exit() {
"use strict";
var ui = UiApp.getActiveApplication();
return ui.close();
}
// Callback action for button labelled "Generate Report"
osascript <<EndOfMyScript
set logInUser to "name"
set logInPassword to "password"
tell application "System Events"
tell application process "loginwindow"
key code 53
delay 1
key code 125
delay 1
key code 36 using option down
@nmcspadden
nmcspadden / Java7Update21.pkginfo
Last active December 16, 2015 07:29
Java 7 Update 21 pkginfo
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>testing</string>
</array>
/*global SpreadsheetApp: false, UiApp: false */
// Close the current UI
function exit() {
"use strict";
var ui = UiApp.getActiveApplication();
return ui.close();
}
// Callback action for button labelled "Generate Report"