Skip to content

Instantly share code, notes, and snippets.

View nstrauss's full-sized avatar
🐍 🏫 📡

Nathaniel Strauss nstrauss

🐍 🏫 📡
View GitHub Profile
macshome /
Last active July 16, 2024 01:32
How to defang system protections on macOS

How to Defang macOS System Protections

If you want to change things on the root drive of a Mac you will need to take some steps to disable the built in security of the system. Most of these steps are the same regardless if you are on Intel or Apple Silicon. If there is a difference it is noted.

Note that all of these things put a Mac into an unsupported and less secure state.

Make sure you either perform these steps in a VM or that you reset the protections after you are done poking around

Protections and Terms

(This list is not exahustive on the details of each. Check the links at the end for more info.)

talkingmoose / Match Version Number or Higher.bash
Last active July 9, 2024 18:28
Generates a regular expression (regex) that matches the provided version number or higher. Useful for Jamf Pro's "matches regex" operator in searches and smart groups where the results need to be the current version of an app or higher.
Written by:William Smith
Professional Services Engineer
scriptingosx /
Created August 18, 2023 12:36
two scripts to set and read default app for url schemes (http, mailto, ssh, etc.) for use with Jamf Pro
# this script will return the current default application for a url scheme
# for use as a Jamf Extension attribute
# by Armin Briegel - Scripting OS X
# Permission is granted to use this code in any way you want.
# Credit would be nice, but not obligatory.
# Provided "as is", without warranty of any kind, express or implied.
weswhet /
Last active June 9, 2024 05:19
quit, update, and reopen all apps that have an update available in Managed Software Center.
import argparse
import os
import pathlib
import plistlib
import pprint
import pwd
import subprocess
from time import sleep
ipbastola /
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64


Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
haircut /
Last active June 5, 2023 16:27
Backs up authdb, then modifies them so users can modify Energy Saver, Network, Printers & Scanners, Date & Time, Time Machine
Modifies authorizations database to allow standard users to change select
system preferences.
A great guide to available authorization rights can be found at:
pudquick /
Last active August 18, 2022 21:02
Get Mac's serial number, hardware UUID, and board-id via python
import objc
from Foundation import NSBundle
IOKit_bundle = NSBundle.bundleWithIdentifier_('')
functions = [("IOServiceGetMatchingService", b"II@"),
("IOServiceMatching", b"@*"),
("IORegistryEntryCreateCFProperty", b"@I@@I"),
AndrewWCarson / Toggle macOS
Created March 29, 2019 23:05
Toggle between Light & Dark mode.
# This toggles the macOS appearance from Light mode to Dark mode and vice
# versa.
# Big thanks to Mike Lynn for his help. Esp. this gist:
# Still looking for the function to perfectly simulate changing themes via the
# System Prefs UI. iStat menus seems to not be getting the hint.