Skip to content

Instantly share code, notes, and snippets.


Mike Solin flammable

View GitHub Profile
talkingmoose / Manage App Notifications.bash
Last active Jun 3, 2021
macOS Catalina will prompt users to allow Notifications from each app that makes a request. Administrators can manage these prompts using a Configuration Profile. If running Jamf Pro 10.19 or later, I suggest instead using this manifest:…
View Manage App Notifications.bash
Written by:William Smith
Professional Services Engineer
View random_sn
randomsn() {
python -c "import string; from random import randint, sample; print('VM' + ''.join(sample((string.ascii_lowercase + string.digits),10)))"
haircut /
Last active Sep 15, 2021
Completely reset TCC services database in macOS
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.
grahamgilbert /
Created May 9, 2018
Clean out old apple updates (older than 24 hours) because softwareupdate often refuses to install them
Removes cached apple updates that are older than 24 hours
import datetime
import os
import shutil
import sys
erikng /
Last active Apr 16, 2018
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')):
gregneagle /
Last active Mar 19, 2021 Reads a preference, prints its value, type, and where it is defined.
import os
import sys
from CoreFoundation import (CFPreferencesAppValueIsForced,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
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
gregneagle /
Last active Jun 1, 2018
import sys
import os
from Foundation import NSDate
from Foundation import NSPredicate
def doComparison(comp_string, obj):
print 'Comparison: %s' % comp_string