Skip to content

Instantly share code, notes, and snippets.

View bruienne's full-sized avatar

Pepijn Bruienne bruienne

View GitHub 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>PayloadContent</key>
<dict>
<key>my.org.push</key>
<?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>/Library/Managed Preferences/org.my.push.plist</key>
<true/>
#!/usr/bin/python
import os, sys
import subprocess
sys.path.append('/usr/local/munki/munkilib')
from munkicommon import FoundationPlist as plistlib
identifier = sys.argv[1]
pushpl = '/Library/Managed Preferences/%s.plist' % identifier
@bruienne
bruienne / gist:4369adc055f0c7eabf7b
Last active March 2, 2016 18:58
Munki wiki Apple items + SUS behavior clarification

Apple update behavior notes

Munki updates and Apple Software updates can appear and be installed in the same Munki session. To prevent possible conflicts, if any item to be installed or removed from the Munki server is an Apple item, Apple updates will not be processed in the same session. An item from the Munki server is identified as an Apple item if it has the optional apple_item key set toTrue in its pkginfo file.

Additionally, an item will be treated as an apple_item during an update check if the apple_item key is missing but the item contains either a receipts array with a packageid key that starts with com.apple or an installs array with a CFBundleIdentifier key that starts with com.apple.

It is important to note that any Apple application scheduled for install without an apple_item key explicitly set to False will cause the item to be treated as an apple_item during an update check. The implication of this is that if a user has an update waiting to be installed for P

@bruienne
bruienne / macaduk-oss-docker.txt
Created February 10, 2016 00:45
Mac AD UK 2016 URL-palooza
https://bitbucket.com/bruienne
https://github.com/bruienne
http://enterprisemac.bruienne.com
https://derflounder.wordpress.com/2015/02/04/free-tools-for-the-budget-minded-mac-admin/
https://github.com/autopkg/autopkg
https://github.com/sheagcraig/JSSImporter
https://github.com/tburgin/AbsoluteManageExport
https://github.com/sheagcraig/python-jss
https://github.com/ox-it/manana
https://github.com/nmcspadden/Sal-WHDImport
#!/usr/bin/env python
import subprocess
import plistlib
import sys
# Our read and write commands to the authorizationdb
readcmd = ['/usr/bin/security', 'authorizationdb', 'read', 'system.login.console']
writecmd = ['/usr/bin/security', 'authorizationdb', 'write', 'system.login.console']
r12 = [rbx fileExistsAtPath:@"/var/db/.MBSkipWiFiSetupIfPossible"];
rax = [rbx release];
rbx = [[self setupStateManager] retain];
r14 = [[rbx wifiManager] retain];
r13 = [r14 airportAvailable];
rax = [r14 release];
rax = [rbx release];
if ((var_29 != 0x0) && (((var_38 == 0x0) || (r12 != 0x0)))) {
rbx = @"CloudConfigurationWelcome";
}
@bruienne
bruienne / unsignprofile.py
Last active June 29, 2018 02:37
Remove signature (not encryption) from signed Apple configuration profiles
# To run, provide the path to a signed profile at the command line:
# ./unsignprofile.py SignedProfile.mobileconfig
from M2Crypto import SMIME, X509, m2, BIO
from plistlib import *
import sys
import logging
# Can be any file probably since we're not verifying.
certstore_path = "/etc/ssl/certs/ca-certificates.crt"
@bruienne
bruienne / gist:95fc1eef324e764f4542
Created December 2, 2015 21:41
snapctl plugin list
NAME VERSION TYPE SIGNED STATUS LOADED TIME
snap-collector-intel-node-manager 3 collector false loaded Wed, 02 Dec 2015 21:25:54 UTC
rabbitmq 6 publisher false loaded Wed, 02 Dec 2015 21:25:59 UTC
docker 1 collector false loaded Wed, 02 Dec 2015 21:25:52 UTC
Intel Fact Gathering Plugin (Facter) 4 collector false loaded Wed, 02 Dec 2015 21:25:54 UTC
psutil 5 collector false loaded Wed, 02 Dec 2015 21:25:56 UTC
hana 4 publisher false loaded Wed, 02 Dec 2015 21:25:57 UTC
mysql 5 publisher false loaded Wed, 02 Dec 2015 21:25:58 UTC
file 3 publisher false loaded Wed, 02 Dec 2015 21:26:00 UTC
mock2 2 collector false loaded Wed, 02 Dec 2015 21:25:51 UTC
@bruienne
bruienne / metric list
Created December 2, 2015 21:40
snapctl metric list
NAMESPACE VERSIONS
/intel/disk/sda/smart/availablereservedspace 5
/intel/disk/sda/smart/availablereservedspace/normalized 5
/intel/disk/sda/smart/casetemperature 5
/intel/disk/sda/smart/casetemperature/max 5
/intel/disk/sda/smart/casetemperature/min 5
/intel/disk/sda/smart/casetemperature/normalized 5
/intel/disk/sda/smart/casetemperature/overcounter 5
/intel/disk/sda/smart/crcerrors 5
/intel/disk/sda/smart/crcerrors/normalized 5