Skip to content

Instantly share code, notes, and snippets.

View headmin's full-sized avatar

Henry Stamerjohann headmin

View GitHub Profile
@headmin
headmin / pkgAndNotarize.sh
Created July 14, 2025 09:01 — forked from scriptingosx/pkgAndNotarize.sh
Script that builds, packages and notarizes an Xcode command line tool.
#!/bin/zsh
# pkgAndNotarize.sh
# 2019 - Armin Briegel - Scripting OS X
# place a copy of this script in in the project folder
# when run it will build for installation,
# create a pkg from the product,
# upload the pkg for notarization and monitor the notarization status

🧭 Get Started with the macOS Security Compliance Project (mSCP)

This guide provides a quick setup for the macOS Security Compliance Project (mSCP) using the uv tool by Astral, which simplifies dependency management and script execution.


✅ Prerequisites

  • macOS (tested with macOS 15.3 and later)
  • Git
<?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>PayloadDescription</key>
<string>Configures all Nudge preferences</string>
<key>PayloadDisplayName</key>
Category Identifier Version Release Date Days Between Releases Security Info
Current latest version macOS Sonoma 14 14.3.1 2024-02-08
macOS Release macOS Sonoma 14.3.1 14.3.1 2024-02-08 17 This update has no published CVE entries.
macOS Release macOS Sonoma 14.3 14.3 2024-01-22 34 https://support.apple.com/kb/HT214061
macOS Release macOS Sonoma 14.2.1 14.2.1 2023-12-19 8 https://support.apple.com/kb/HT214048
macOS Release macOS Sonoma 14.2 14.2 2023-12-11 11 https://support.apple.com/kb/HT214036
macOS Release macOS Sonoma 14.1.2 14.1.2 2023-11-30 23 https://support.apple.com/kb/HT214032
macOS Release macOS Sonoma 14.1.1 14.1.1 2023-11-07 13 This update has no published CVE entries.
macOS Release macOS Sonoma 14.1 14.1 2023-10-25 29 https://support.apple.com/kb/HT213984
macOS Release macOS Sonoma 14 14 2023-09-26 https://support.apple.com/kb/HT213940
<?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>Services</key>
<dict>
<key>SystemPolicyAllFiles</key>
@headmin
headmin / build_tf_script_checks.py
Last active October 26, 2023 22:21 — forked from np5/build_tf_script_checks.py
Tool to load a mSCP guidance file and output the Terraform Munki script check resources definitions
import argparse
import os
from yaml import load, SafeLoader
TEMPLATE = """resource zentral_munki_script_check "mcs-{section}-{rule}" {{
name = "{name}"
description = trimspace(<<EODESC
{description}
EODESC
@headmin
headmin / fancy_defaults_read.py
Created April 21, 2023 14:43 — forked from gregneagle/fancy_defaults_read.py
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,

How to install Ansible and Python on macOS - simply in minutes

Here we are going to install the latest Python (3.11.2 as of this writing) and Ansible on macOS Ventura in the most clever and simplistic way. All artifacts are installed in user and not system context.

How does it work? The awesome asdf-vm project is designed for version management of developer runtimes. Here we use a small feature to also directly install default-python-packages and pick Ansible as our choice (could be pipenv or others).

Some features here have been presented in my talk "Runtime and tools – version management on macOS" at the MDO:YVR 2022 conference.

Requirements

@headmin
headmin / bash_strict_mode.md
Created March 18, 2021 11:15 — forked from mohanpedala/bash_strict_mode.md
set -e, -u, -o pipefail explanation

set -e, -u, -o pipefail

The "set" lines These lines deliberately cause your script to fail. Wait, what? Believe me, this is a good thing. With these settings, certain common errors will cause the script to immediately fail, explicitly and loudly. Otherwise, you can get hidden bugs that are discovered only when they blow up in production.

set -euo pipefail is short for:

set -e
set -u