Skip to content

Instantly share code, notes, and snippets.

# dump all the launchd services
launchctl print gui/$UID
# dump details of the service
launchctl print gui/$UID/com.blakegarner.vault
# stop service and unload from launchd
launchctl bootout gui/$UID/com.blakegarner.vault
# start the servcie and load plist from disk
#!/usr/local/autopkg/python
import os
import plistlib
from glob import glob
from Foundation import CFPreferencesCopyAppValue
# Input keys we don't care about comparing.
EXCLUDED_KEYS = (
@steipete
steipete / OSLogTest.swift
Created August 24, 2020 10:35
Sample code to access OSLogStore on iOS and macOS.
let subsystem = "com.steipete.LoggingTest"
func getLogEntries() throws -> [OSLogEntryLog] {
// FB8269189: OSLogStore does not work iOS.
let logStore = try OSLogStore(scope: .currentProcessIdentifier)
let oneHourAgo = logStore.position(date: Date().addingTimeInterval(-3600))
#if os(macOS)
let allEntries = try logStore.getEntries(at: oneHourAgo)
#else
@gregneagle
gregneagle / Makefile
Created March 5, 2020 18:35
Make your own PPPC/TCC avoidance wrapper!
CC=gcc
CFLAGS=
SIGNINGIDENTITY="insert signing identity here"
IDENTIFIER=com.someorg.fudo.changeme
fudo: main.c
$(CC) -o fudo main.c
codesign -s $(SIGNINGIDENTITY) -i $(IDENTIFIER) fudo
@zakes-it
zakes-it / AirportKiller.py
Last active May 18, 2020 15:32
Use with crankd turn off AirPort when on an Ethernet connection and turn AirPort back on when Ethernet disconnects
#! /usr/bin/python
import syslog
import objc
from Foundation import NSAppleScript, CFPreferencesCopyAppValue,\
CFPreferencesSetAppValue, CFPreferencesAppSynchronize
from SystemConfiguration import SCDynamicStoreCreate, SCDynamicStoreCopyValue
BUNDLE_ID = 'AirportKiller'
@pudquick
pudquick / fdsetup-for-crypt.mobileconfig
Created July 17, 2019 01:31
Enable fdesetup for Crypt
<?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>Privacy Preferences Policy Control</string>
<key>PayloadIdentifier</key>
require 'base64'
require 'plist'
module Chef::Provider::User::DsclMojaveUserExtensions
# new for 10.14+
def mac_osx_version_greater_than_10_13?
Gem::Version.new(node['platform_version']) > Gem::Version.new('10.13.99')
end
# updated for 10.14+
#
# Demonstrating kSecKeyAlgorithmECIESEncryptionCofactorX963SHA256AESGCM
#
# David Schuetz (@DarthNull)
# May 2018
#
# see also: https://darthnull.org/security/2018/05/31/secure-enclave-ecies
#
###############################################################
@grahamgilbert
grahamgilbert / clean_old_apple_updates.py
Created May 9, 2018 16:35
Clean out old apple updates (older than 24 hours) because softwareupdate often refuses to install them
#!/usr/bin/python
"""
Removes cached apple updates that are older than 24 hours
"""
import datetime
import os
import shutil
import sys
@tombigel
tombigel / README.md
Last active May 6, 2024 03:23 — forked from a2ikm/limit.maxfiles.plist
How to Change Open Files Limit on OS X and macOS Sierra (10.8 - 10.12)

How to Change Open Files Limit on OS X and macOS

This text is the section about OS X Yosemite (which also works for macOS Sierra) from https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/#mac-os-x

The last time i visited this link it was dead (403), so I cloned it here from the latest snapshot in Archive.org's Wayback Machine https://web.archive.org/web/20170523131633/https://docs.basho.com/riak/kv/2.1.4/using/performance/open-files-limit/

Mac OS X

To check the current limits on your Mac OS X system, run: