Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
talkingmoose / Sonoma-compatible Macs (regex)
Last active June 15, 2024 19:47
Regex looks for all Mac models compatible with macOS Sonoma. May not be up-to-date with newly released models.
https://support.apple.com/en-us/HT213772
Published Date: March 8, 2024
Verification: https://regex101.com/r/GCfKMt/11
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^(Mac(1[345]|BookPro1[5-8]|BookAir([89]|10)|Pro7)|iMac(Pro1|(19|2[01]))|Macmini[89]),\d+$
2) Current or higher regex — Matches model identifiers based on Apple's knowledge base article and may match higher versions before this regex is updated (more future-proof).
@talkingmoose
talkingmoose / Match Version Number or Higher.bash
Last active May 6, 2024 20:13
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.
#!/bin/bash
<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Professional Services Engineer
Jamf
bill@talkingmoose.net
https://gist.github.com/2cf20236e665fcd7ec41311d50c89c0e
@talkingmoose
talkingmoose / Send Jamf Pro Mobile Device Command via API.bash
Created April 9, 2019 20:32
Sample script for sending a remote management command to multple iOS devices via the Jamf Pro API.
#!/bin/bash
# server connection information
URL="https://talkingmoose.jamfcloud.com"
userName="api-editor"
password="P@55w0rd"
command="UpdateInventory"
# XML data to upload
THExml="<mobile_device_command>
@mhofman
mhofman / get_lutron_cert.sh
Created October 13, 2017 09:48
Generate a signed certificate valid to connect locally to a Lutron Caseta Smart Bridge
#!/bin/sh
# Usage: get_lutron_cert.sh [bridge_ip] | tee cert.pem
function error() {
echo "Error: $1" >&2
exit 1
}
login_server="device-login.lutron.com"
@pythoninthegrass
pythoninthegrass / remove_mcafee.sh
Last active October 29, 2020 22:18 — forked from mikedamm/gist:d0ef2291a3c4eecdc35a
Remove McAfee Agent and McAfee Endpoint Security for Mac
#!/usr/bin/env bash
# See McAfee KBs:
# https://kc.mcafee.com/corporate/index?page=content&id=KB88461 # Remove ENS for Mac (ENSM)
# https://kc.mcafee.com/corporate/index?page=content&id=KB61125 # Remove McAfee Agent
# Exit upon failed command
# set -e
@chilcote
chilcote / get_msa_videos.py
Last active April 17, 2018 20:55
Download MacSysAdmin2016 videos
#!/usr/bin/env python
'''
download macsysadmin videos
requires:
pip install requests
pip install beautifulsoup4
'''
@poundbangbash
poundbangbash / com.microsoft.Excel
Last active February 16, 2017 19:31
Suppress What's New - Excel
<?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.microsoft.Excel</key>
@pdostal
pdostal / .bashrc
Last active December 24, 2023 23:03
Mac OS X WIFI advanced settings
alias airport='sudo /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport'
@mikedamm
mikedamm / gist:d0ef2291a3c4eecdc35a
Created September 25, 2014 00:20
Remove McAfee Endpoint Security for Mac without uninstall password
rm -f /Library/LaunchAgents/com.mcafee.menulet.plist
rm -f /Library/LaunchAgents/com.mcafee.reporter.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.Eupdate.plist
rm -f /Library/LaunchDaemons/com.mcafee.ssm.ScanFactory.plist
rm -f /Library/LaunchDaemons/com.mcafee.virusscan.fmpd.plist
rm -rf /Library/Application\ Support/McAfee
rm -rf /usr/local/McAfee
shutdown -r now