This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>PayloadType</key> | |
<string>com.apple.applicationaccess.new</string> | |
<key>PayloadVersion</key> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import subprocess | |
import plistlib | |
cmd = ['/usr/sbin/system_profiler', '-xml', 'SPApplicationsDataType'] | |
proc = subprocess.Popen(cmd, shell=False, bufsize=-1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
output, err = proc.communicate() | |
plist = plistlib.readPlistFromString(output) | |
items = plist[0]['_items'] | |
for item in sorted(items, key=lambda x: x.get('path')): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Removes cached apple updates that are older than 24 hours | |
""" | |
import datetime | |
import os | |
import shutil | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
randomsn() { | |
managed_python3 -c "import string; from random import randint, sample; print('VM' + ''.join(sample((string.ascii_lowercase + string.digits),10)))" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/munki/munki-python | |
import sys | |
import os | |
from Foundation import NSDate | |
from Foundation import NSPredicate | |
def doComparison(comp_string, obj): | |
print('Comparison: %s' % comp_string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import ctypes, ctypes.util | |
# Import CoreGraphics as a C library, so we can call some private functions | |
c_CoreGraphics = ctypes.CDLL(ctypes.util.find_library('CoreGraphics')) | |
def disable_beam_sync(doDisable): | |
if doDisable: | |
# Disabling beam sync: | |
# 1st: Enable Quartz debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
<<ABOUT_THIS_SCRIPT | |
----------------------------------------------------------------------- | |
Written by:William Smith | |
Professional Services Engineer | |
Jamf | |
bill@talkingmoose.net | |
https://gist.github.com/talkingmoose/9faf50deaaefafa9a147e48ba39bb4b0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import os | |
import sys | |
from CoreFoundation import (CFPreferencesAppValueIsForced, | |
CFPreferencesCopyAppValue, | |
CFPreferencesCopyValue, | |
kCFPreferencesAnyUser, | |
kCFPreferencesAnyHost, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Completely reset TCC services database in macOS | |
Note: Both the system and individual users have TCC databases; run the script as both | |
a user and as root to completely reset TCC decisions at all levels. | |
2018-08-15: Resetting the 'Location' service fails; unknown cause | |
2018-08-16: Confirmed the 'All' service does not really reset _all_ | |
services, so individual calls to each service is necessary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/munki/munki-python | |
import argparse | |
import os | |
import pathlib | |
import plistlib | |
import pprint | |
import pwd | |
import subprocess | |
from time import sleep |
OlderNewer