Skip to content

Instantly share code, notes, and snippets.

Avatar
🍻

John Mahlman jmahlman

🍻
View GitHub Profile
@jmahlman
jmahlman / postinstall.sh
Last active Apr 12, 2019
depnotify post install script
View postinstall.sh
#!/bin/sh
## postinstall
#!/bin/sh
echo "disable auto updates ASAP" >> /var/log/jamf.log
defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist AutomaticDownload -bool NO
defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist ConfigDataInstall -bool NO
defaults write /Library/Preferences/com.apple.SoftwareUpdate.plist CriticalUpdateInstall -bool NO
defaults write /Library/Preferences/com.apple.commerce.plist AutoUpdateRestartRequired -bool NO
View final-com.uarts.DEPprovisioning.facstaff.sh
#!/bin/bash
#
#
# Created by John Mahlman, University of the Arts Philadelphia (jmahlman@uarts.edu)
# Name: com.uarts.DEPprovisioning.facstaff
#
# Purpose: Install and run DEPNotify at enrollment time and do some final touches
# for the users. It also checks for software updates and installs them if found.
# This gets put in the composer package along with DEPNotofy, com.uarts.launch.plist,
# and any supporting files. Then add the post install script to the package.
View com.uarts.DEPProvisioning.facstaff.sh
#!/bin/bash
# Get the logged in user
CURRENTUSER=$(/usr/bin/python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
# Setup Done File
setupDone="/var/db/receipts/com.uarts.provisioning.done.bom"
JAMFBIN=/usr/local/jamf/bin/jamf
if pgrep -x "Finder" \
&& pgrep -x "Dock" \
@jmahlman
jmahlman / com.uarts.launch.plist
Created May 10, 2018
launch daemon for DEP provisioning
View com.uarts.launch.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>GroupName</key>
<string>wheel</string>
<key>InitGroups</key>
<false/>
<key>Label</key>
<string>com.uarts.launch</string>
View sample-DEPNotify.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>Asset Tag</key>
<string>ua14lap1337</string>
<key>Assigned User</key>
<string>jmahlman</string>
<key>Computer Serial</key>
<string>XXXXXXXXXX</string>
View DEPNotify-UserInput-test.sh
#!/bin/bash
JAMFBIN=$(/usr/bin/which jamf)
CURRENTUSER=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
# Install DEPNotify first (set this up in your jamf server of course)
$JAMFBIN policy -event install_depnotify
DNLOG=/var/tmp/depnotify.log
# Setup DEPNotify prefs and starting GUI
View DEPNotify-Outline.sh
#!/bin/bash
JAMFBIN=$(/usr/bin/which jamf)
CURRENTUSER=$(python -c 'from SystemConfiguration import SCDynamicStoreCopyConsoleUser; import sys; username = (SCDynamicStoreCopyConsoleUser(None, None, None) or [None])[0]; username = [username,""][username in [u"loginwindow", None, u""]]; sys.stdout.write(username + "\n");')
# Install DEPNotify first (set this up in your jamf server of course)
$JAMFBIN policy -event install_depnotify
DNLOG=/var/tmp/depnotify.log
# Setup DEPNotify
@jmahlman
jmahlman / appleloops-install.sh
Last active Jan 31, 2018
script to check and install appleloops.py from jamf
View appleloops-install.sh
#!/bin/sh
if [ ! -f "/usr/local/bin/appleloops" ]; then
echo "Installing Apple-Loops-Install script from JSS"
/usr/local/jamf/bin/jamf policy -event apple-loops-installer
caffeinate -i /usr/local/bin/appleloops --mute-progress-bar --deployment $4 --pkg-server http://url.to.folder/appleloops
if [ ! -f "/usr/local/bin/appleloops" ]; then # Did the install work?
echo "Unable to install Apple-Loops-Install script, aborting!"
exit 1
fi
@jmahlman
jmahlman / keybase.md
Created Mar 29, 2017
Keybaase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am jmahlman on github.
  • I am johnmahlman (https://keybase.io/johnmahlman) on keybase.
  • I have a public key ASDUwqfrS4TIH-nt62JHtkf0kPY3D_xyE1huW8ZIbZgoxQo

To claim this, I am signing this object:

@jmahlman
jmahlman / com.autodesk.backburner_server.plist
Created Nov 18, 2016
Default backburner launchDaemon plist
View com.autodesk.backburner_server.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>KeepAlive</key>
<dict>
<key>PathState</key>
<dict>
<key>/usr/discreet/backburner/nrapi.conf</key>
<true/>