Skip to content

Instantly share code, notes, and snippets.

View nmcspadden's full-sized avatar

Nick McSpadden nmcspadden

View GitHub Profile
@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
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)
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
#!/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"
#!/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
#!/bin/bash
launchctl load /Library/LaunchDaemons/org.sacredsf.mcx.plist
<?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.mcx.plist</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/libexec/ChangeMCXLion.sh</string>
</array>
line_01='set logInUser to "USER"'
line_02='set logInPassword to "PASSWORD"'
line_03='tell application "System Events"'
line_04='tell application process "loginwindow"'
line_05='key code 53'
line_06='delay 1'
line_07='key code 125'
line_08='delay 1'
line_09='key code 36 using option down'
line_10='delay 1'
#!/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
exit 0
#!/bin/sh
open "$HOME/Library/Application Support/minecraftedu/startlauncher.jar"
exit 0