Skip to content

Instantly share code, notes, and snippets.

View carlashley's full-sized avatar
🎯
Focusing on life.

Carl carlashley

🎯
Focusing on life.
View GitHub Profile
<?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>PayloadContent</key>
<dict>
<key>com.apple.touristd</key>
@carlashley
carlashley / recovery_boot.txt
Created February 6, 2020 00:00
macOS Recovery Boot Mode Commands
# Local
sudo /usr/sbin/nvram recovery-boot-mode=unused # Boot to local recovery partition.
# Internet
sudo /usr/sbin/nvram internet-recovery-mode=RecoveryModeNetwork # Internet Recovery (same as SHIFT+OPT+CMD+R)
sudo /usr/sbin/nvram internet-recovery-mode=RecoveryModeDisk # Local Recovery Partition (Same as CMD+R)
sudo /usr/sbin/nvram internet-recovery-mode=DiagsModeDisk # Local Hardware Diagnostics (Same as D)
sudo /usr/sbin/nvram internet-recovery-mode=DiagsModeNetwork # Internet Hardware Diagnostics (Same as OPT+D)
# Sourced from
@carlashley
carlashley / createchoices.py
Created July 6, 2020 23:13
Create Choices XML for munki
#!/usr/local/bin/python3
"""Creates the required Choices XML for munki."""
from __future__ import print_function
import argparse
import os
import plistlib
import subprocess
import sys
@carlashley
carlashley / ccimporter.py
Created November 27, 2020 04:11
Adobe CC Munki Import
#!/usr/local/bin/python3
"""This process unzipped Adobe CC packages and imports them into munki.
No copyright. Free for use, but no support provided.
This contains some fairly specific behaviour with regards to naming conventions:
- Converts filenames to lowercase, and replaces all space characters with '-'.
- Appends 'adobe-cc.' to the start of each package filename.
- Changes 'install' and 'uninstall' to 'installer' and 'uninstaller'.
- Optionally appends a suffix to the filenames and display titles in munki.
@carlashley
carlashley / add_hostArchitectures.py
Last active November 27, 2020 08:52
Bulk add the arm64,x86_64 host architecture value to Packages .pkgproj files.
#!/usr/local/bin/python3
"""Bulk adds the 'arm64,x86_64' value as and advanced option for '.pkgproj' files.
Walks all sub directories specified at '[path]' for '.pkgproj' files, makes a backup
file in the same destination.
Does not add the value if a value already exists.
Usage: ./add_hostArchitectures.py [path]
Tested with Python 3.7.9.
"""
@carlashley
carlashley / pythondeprecation.sh
Created November 11, 2021 02:42
Search logs for Python Deprecation Warnings - macOS Monterey
#!/bin/zsh
# Thanks to @golby on Slack:
sudo log show --info --debug --predicate 'process == "pythonprompt" AND eventMessage contains[cd] "Showing alert"'