Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Tahoe-compatible Macs (regex)
Last active June 24, 2025 21:48
Regex looks for all Mac models compatible with macOS 26 Tahoe. May not be up-to-date with newly released models.
https://www.apple.com/os/macos/
Published Date: June 9, 2025
Updated: June 24, 2025
Verification: https://regex101.com/r/YXAchM/3
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^Mac((BookPro1(6,[124]|[78],\d)|(1[3-6]|BookAir10|mini9|Pro7),\d+))|iMac2[01],\d+$
@smashism
smashism / ea-external-intelligence-integration-status.sh
Created October 25, 2024 17:58
Designed for Jamf Pro computer extension attribute configuration. Checks for presences of com.apple.siri.generativeassistentsettings in the local preferences of the logged in user and reports the status. For macOS 15.2 and later.
#!/bin/bash
# determine if current user has opted-in for Generative Assistant settings for Apple Intelligence & Siri on macOS 15.2 or later
# ekw 2024-10-24
# built at time of macOS 15.2 beta 1
currentUser=$( echo "show State:/Users/ConsoleUser" | scutil | awk '/Name :/ { print $3 }' )
# global check if there is a user logged in
if [ -z "$currentUser" -o "$currentUser" = "loginwindow" ]; then
echo "no user logged in, cannot proceed"
exit 1
fi
#!/bin/zsh
TARGET=$1
# to be used as an egrep pattern
SYMS='getprogname|NSGetArgv|NSGetArgc|optarg|optind|getopt|getopt_long'
sudo find ${TARGET} -type f -perm +111 \! -name "*.dylib" | \
while read f ; do
sudo nm -u ${f} 2> /dev/null | \
@erikng
erikng / changes in profiles command on 10.13.4 and higher
Last active March 6, 2019 18:54
10.13.4 profile install failure
To prevent unintended installations, profiles containing certain payloads (specifically com.apple.Safari) will require a manual verification even when running as root.
Example:
sudo profiles install -path ~/Desktop/safari.mobileconfig
Enter the admin user name:
sudo profiles -IvF ~/Desktop/safari.mobileconfig
profiles: verbose mode ON
profiles install profile ~/Desktop/safari.mobileconfig for user: (null)
Enter the admin user name:
@MagerValp
MagerValp / Kernel Extension Policy.mobileconfig
Last active May 2, 2020 15:27
Sample kernel extension whitelist for 10.13.4+
<?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>AllowUserOverrides</key>
<true/>
<key>AllowedTeamIdentifiers</key>
### Updated to reflect changes introduced with 10.13.4. Update to 10.13.4 if needed before attempting to make
SecureToken-related changes. ###
sysadminctl is a tool Apple introduced in 10.10 for working with system user accounts. In 10.13, sysadminctl is Apple's
recommended tool for working with user accounts in the CLI, replacing functionality that has long been provided by dscl
and adds new features available only in 10.13. sysadminctl can be used to change user passwords, create new users or
check the status of a new-to-10.13 security feature named SecureToken.
SecureToken is a non-visible APFS file system attribute, unlike the SIP protected flag or file creation date, that triggers
the creation of a new AuthenticationAuthority entry in a user's local account record
@gregneagle
gregneagle / startosinstall_10.12.6_normalboot.txt
Last active February 6, 2024 07:28
Comparison of startosinstall's available options depending on boot OS environment
bash-3.2$ /Applications/Install\ macOS\ Sierra.app/Contents/Resources/startosinstall --usage
Usage: startosinstall --applicationpath <install macOS.app path>
Arguments
--applicationpath, a path to copy of the OS installer application to start the install with.
--license, prints the user license agreement only.
--agreetolicense, agree to license the license you printed with --license.
--rebootdelay, how long to delay the reboot at the end of preparing. This delay is in seconds and has a maximum of 300 (5 minutes).
--pidtosignal, Specify a PID to which to send SIGUSR1 upon completion of the prepare phase. To bypass "rebootdelay" send SIGUSR1 back to startosinstall.
--usage, prints this message.
@erikng
erikng / xcode9.plist
Created September 28, 2017 16:05
xcode9.plist (for munki)
<?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>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>production</string>
</array>
@gregneagle
gregneagle / fancy_defaults_read.py
Last active December 5, 2024 10:38
fancy_defaults_read.py: Reads a preference, prints its value, type, and where it is defined.
#!/usr/bin/python
import os
import sys
from CoreFoundation import (CFPreferencesAppValueIsForced,
CFPreferencesCopyAppValue,
CFPreferencesCopyValue,
kCFPreferencesAnyUser,
kCFPreferencesAnyHost,
## REMOVE FIRST CHARACTER FROM STRING
sed '/^.//'
== Example ==
$ echo "foo" | sed 's/^.//'
oo
____________________________________________________________________