Skip to content

Instantly share code, notes, and snippets.

@gmarnin
gmarnin / gist:9a914bed429d7b276b7e
Created October 15, 2015 15:35
xcode munki postinstall
<key>postinstall_script</key>
<string>#!/bin/sh
# enable developer mode
/usr/sbin/DevToolsSecurity -enable
# make sure all users on this machine are members of the _developer group
/usr/sbin/dseditgroup -o edit -t group -a everyone _developer
# accept Xcode license
@gmarnin
gmarnin / gist:7c284bb297df11ea8958
Created November 11, 2014 20:57
last login time
#!/bin/sh
# Marnin, RU ITS, version .1, 11-2014
# Source: http://superuser.com/questions/65375/user-login-log-on-mac-os-x
echo
echo "Check the last login time for an account"
echo
@gmarnin
gmarnin / gist:e8e38d404eaf9a8158e02aa921417592
Created November 16, 2016 20:56
Bomber JC Scripts for Muni
<key>postinstall_script</key>
<string>#!/bin/sh
# Attach the Cached DMG from the Waiting Room
hdiutil attach -nobrowse -noverify /tmp/bomgar-scc-w0hdc308ewf5jf6z6eg7d8ewg5gx87yiizxxxwwc40jc90.dmg
# Install the client from the standard mount location for the bomgar-scc client installer.
/Volumes/bomgar-scc/Double-Click\ To\ Start\ Support\ Session.app/Contents/MacOS/sdcust&amp;
# If you want to run the hdiutil detach, add a wait command so that it finishes installing first
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.apple.assistant.support</key>
@gmarnin
gmarnin / gist:37265c0c37ebbcb9f14818033b78e2d2
Created December 18, 2018 17:07
T2 10.14.2 update, MSC log from 3.5.2.3630
Dec 18 2018 11:33:39 -0500 Using manifest: site_default
Dec 18 2018 11:33:39 -0500 DEBUG2: Catalog base URL is: https://domain/munki/catalogs/
Dec 18 2018 11:33:39 -0500 Getting catalog production...
Dec 18 2018 11:33:39 -0500 DEBUG2: Options: {'logging_function': <function display_debug2 at 0x108247aa0>, 'ignore_system_proxy': False, 'additional_headers': {u'Authorization': u'Basic aXRzXG1hY211bmtpOk1NMjAxNCNy', 'User-Agent': u'managedsoftwareupdate/3.5.2.3630 Darwin/18.2.0'}, 'file': u'/Library/Managed Installs/catalogs/production.download', 'cache_data': {
etag = "\"83f113e0c896d41:0\"";
"last-modified" = "Tue, 18 Dec 2018 11:57:39 GMT";
}, 'url': u'https://domain/munki/catalogs/production', 'follow_redirects': u'none', 'download_only_if_changed': True, 'can_resume': False}
Dec 18 2018 11:33:39 -0500 DEBUG2: URLSession_task_didReceiveChallenge_completionHandler_
Dec 18 2018 11:33:39 -0500 DEBUG2: Authentication challenge for Host: domain Realm: None AuthMethod: NSURLAuthenticationMethodSer
#!/bin/bash
# This script works well for removing local accounts that are older than 1 day.
# Obviously the 1 day timeframe can be modified (-mtime +1).
# Runs using Launch Daemon - /Library/LaunchDaemons/edu.org.deleteaccounts.plist
# version .7
@gmarnin
gmarnin / gist:615f7e8d209f6031e2960027582e9f80
Created April 4, 2016 13:04
Delete account after 30 days config profile
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadDisplayName</key>
<string>Mobility</string>
<key>PayloadEnabled</key>