Skip to content

Instantly share code, notes, and snippets.

View gilburns's full-sized avatar

Gil Burns gilburns

View GitHub Profile
@PicoMitchell
PicoMitchell / get_compatible_macos_versions-asls.sh
Last active March 13, 2025 03:32
Scripts to get compatible macOS versions from Apple Software Lookup Service (gdmf.apple.com/v2/pmv) or Software Update Catalog (swscan.apple.com[...]sucatalog).
#!/bin/bash
#
# Created by Pico Mitchell (of Random Applications) on 1/5/23
#
# https://gist.github.com/PicoMitchell/877b645b113c9a5db95248ed1d496243#file-get_compatible_macos_versions-asls-sh
#
# MIT License
#
# Copyright (c) 2023 Pico Mitchell (Random Applications)
@smithjw
smithjw / install_xcode_xip.sh
Created May 20, 2022 00:05
Install Xcode xip from Self Service
#!/bin/bash
XCODE_VERSION="$4"
XCODE_TRIGGER="$5"
XCODE_NAME="Xcode-${XCODE_VERSION}"
XCODE_XIP_CACHE="/Library/Application Support/JAMF/Waiting Room/${XCODE_NAME}.xip.pkg"
XCODE_XIP_PATH="/Library/Management/${XCODE_NAME}.xip"
UNXIP="/Library/Management/Tools/unxip"
LOG_FOLDER="/private/var/log"
#!/usr/bin/env bash
CLIENT_ID="_FALCON_API_CLIENT_ID_"
CLIENT_SECRET="FALCON_API_CLIENT_SECRET_"
CID="_FALCON_CID_"
TOKEN="_FALCON_INSTALL_TOKEN"
API_HOST="api.eu-1.crowdstrike.com"
function main() {

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@Cosmo
Cosmo / Microsoft-Teams-GPU-Fixer.sh
Last active August 11, 2022 00:25
Disable GPU usage for Microsoft Teams
APP=TeamsFixer
mkdir -vp ${APP}.app/Contents/MacOS ${APP}.app/Contents/Resources
PATH="$PATH:/usr/libexec"
printf '#!/usr/bin/env bash\nexec /Applications/Microsoft\ Teams.app/Contents/MacOS/Teams --disable-gpu' > ${APP}.app/Contents/MacOS/${APP}
chmod +x ${APP}.app/Contents/MacOS/${APP}
cp /Applications/Microsoft\ Teams.app/Contents/Resources/icon.icns ${APP}.app/Contents/Resources/icon.icns
PlistBuddy ${APP}.app/Contents/Info.plist -c "add CFBundleDisplayName string ${APP}"
PlistBuddy ${APP}.app/Contents/Info.plist -c "add CFBundleIconFile string icon.icns"
PlistBuddy ${APP}.app/Contents/version.plist -c "add ProjectName string ${APP}"
find ${APP}.app
@blakefrantz
blakefrantz / gatekeeper_status.sh
Created February 3, 2014 21:32
Determines the state of Gatekeeper on OSX 10.8 and 10.9. Differentiates between three modes: "Mac App Store", "Mac App Store and identified developers", and "Anywhere",
#!/bin/bash
#
# Determines the state of Gatekeeper on OSX 10.8 and 10.9. Differentiates between three modes:
#
# - Mac App Store
# - Mac App Store and identified developers
# - Anywhere
#
# DEV_REQ_[12] are certificate requirements stored in the SystemPolicy sqlite database.
# Each certificate requirement is disabled/enabled persuant to the 'disabled' field in