Skip to content

Instantly share code, notes, and snippets.

View nmcspadden's full-sized avatar

Nick McSpadden nmcspadden

View GitHub Profile
#!/bin/sh
# This script sets up and configures LocalMCX
# this version 16 May 2012 Greg Neagle
# updated for Mountain Lion compatibility
# these GUIDs must match those referred to in the /ComputerGroups groupmembership
local_desktop_GUID="B4247B97-F249-4409-8EA3-BA8E168BA0DA"
local_laptop_GUID="15BEE70A-A32D-4A33-B740-93CBE95F75A4"
changedMCX=false
bash-3.2# dscl -plist /Local/MCX -read ComputerGroups/office2008 dsAttrTypeStandard:MCXSettings
<?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>dsAttrTypeStandard:MCXSettings</key>
<array>
<string>3c3f786d 6c207665 7273696f 6e3d2231 2e302220 656e636f 64696e67 3d225554 462d3822 3f3e0a3c 21444f43 54595045 20706c69 73742050 55424c49 4320222d 2f2f4170 706c652f 2f445444 20504c49 53542031 2e302f2f 454e2220 22687474 703a2f2f 7777772e 6170706c 652e636f 6d2f4454 44732f50 726f7065 7274794c 6973742d 312e302e 64746422 3e0a3c70 6c697374 20766572 73696f6e 3d22312e 30223e0a 3c646963 743e0a09 3c6b6579 3e6d6378 5f617070 6c696361 74696f6e 5f646174 613c2f6b 65793e0a 093c6469 63743e0a 09093c6b 65793e4f 66666963 65504944 3c2f6b65 793e0a09 093c6469 63743e0a 0909093c 6b65793e 466f7263 65643c2f 6b65793e 0a090909 3c617272 61793e0a 09090909 3c646963 743e0a09 09090909 3c6b6579 3e6d6378 5f707265 66657265 6
bash-3.2# ./mcxToProfile.py --dsobject /Local/MCX/computergroups/office2008 --identifier Office2008
Traceback (most recent call last):
File "./mcxToProfile.py", line 450, in <module>
main()
File "./mcxToProfile.py", line 441, in main
mcx_data = getMCXData(options.dsobject)
File "./mcxToProfile.py", line 304, in getMCXData
mcx_item_data = readPlistFromString(str(mcx_item))
File "./mcxToProfile.py", line 229, in readPlistFromString
raise NSPropertyListSerializationException(error)
@nmcspadden
nmcspadden / Get Flash
Created July 17, 2013 17:06
Automunki Flash
#!/bin/bash -ex
pwd="`pwd`"
# download latest
ftp -o flash.dmg http://fpdownload.macromedia.com/get/flashplayer/current/licensing/mac/install_flash_player_11_osx.dmg
# Mount disk image on temp space
mountpoint=`hdiutil attach -mountrandom /tmp -nobrowse flash.dmg | awk '/private\/tmp/ { print $3 } '`
echo Mounted on $mountpoint
/*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"
@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>
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
/*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"
@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
@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>