Skip to content

Instantly share code, notes, and snippets.

View jhbush's full-sized avatar

Jason Bush jhbush

  • Coffee Cats Consulting
  • San Francisco Bay Area
  • 21:27 (UTC -07:00)
  • X @jasonhbush
View GitHub Profile
@rtrouton
rtrouton / Sequoia-compatible Macs (regex)
Created June 12, 2024 20:58 — forked from talkingmoose/Sequoia-compatible Macs (regex)
Regex looks for all Mac models compatible with macOS Sequoia. May not be up-to-date with newly released models.
https://www.apple.com/macos/macos-sequoia-preview/
Published Date: June 10, 2024
Verification: https://regex101.com/r/bNOMXz/2
1) Exact regex — Matches major model identifier numbers based on Apple's knowledge base article (more accurate):
^(Mac(1[345]|BookPro1[5-8]|BookAir(9|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 / Retrieve LAPS Password.zsh
Last active April 30, 2024 21:58
Retrieves the Jamf Pro LAPS password for the current computer. The script assumes a desktop administrator is operating the computer. The administrator will open Self Service, authenticate, and run the policy with the script.
#!/bin/zsh
# set -x
:<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
#!/bin/sh
###
#
# Created : 2022-09-19
# Last Modified : 2022-11-12
# Version : 1.2
# Tested with : macOS 13.0.1
#
###
@talkingmoose
talkingmoose / Speed Dating for Mac Admins.md
Last active May 5, 2023 19:53
Resources for my Penn State 2022 MacAdmins Campfire presentation on June 2

Speed Dating for Mac Admins

Terminal Login Banner

Last login: Wed Jun  1 23:03:39 on ttys000


                        'c.            Logged in as: bill.smith
                     ,xNMM.            ---------------------------------
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-----------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/talkingmoose/15f055885b51cc8cb0bc7aad021acead
@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"
@talkingmoose
talkingmoose / RemoveUsersFromAdmin.zsh
Last active October 24, 2022 21:01
Removes all users with UIDs greater than 500 from local admin group.
#!/bin/zsh
# these local accounts will not be removed from admins
# one account name per line; keep the beginning and closing quotes
exceptionsList="talkingmoose
bill.smith
oszein
jamfadmin"
@talkingmoose
talkingmoose / Download macOS Monterey in Background.zsh
Last active October 6, 2022 12:04
Creates a launch daemon and script on target Macs in a Jamf Pro policy to download the specified macOS installer and update Jamf Pro's inventory. This is preferable to running a command directlt in policy, which can take 30+ minutes to complete, preventing other policies from running. The script self destructs once it sees the installer in the A…
#!/bin/zsh
:<<ABOUT_THIS_SCRIPT
-------------------------------------------------------------------------------
Written by:William Smith
Partner Program Manager
Jamf
bill@talkingmoose.net
https://gist.github.com/6b78ba3fc4a6623dbc8225e2df38d570
@talkingmoose
talkingmoose / Jamf Connect License.zsh
Created March 30, 2022 17:11
Checks for an existing Jamf Connect license installed on a Mac and reports license details similar to Jamf Connects' About window.
#!/bin/zsh
# Try to read the com.jamf.connect.login.plist file for license information
licenseInfo=$( /usr/bin/defaults read /Library/Managed\ Preferences/com.jamf.connect.login LicenseFile 2> /dev/null | /usr/bin/base64 --decode )
# If the file doesn't exist, try to read the com.jamf.connect.plist file for license information
if [ "$licenseInfo" = "" ]; then
licenseInfo=$( /usr/bin/defaults read /Library/Managed\ Preferences/com.jamf.connect LicenseFile 2> /dev/null | /usr/bin/base64 --decode )
@zhuowei
zhuowei / Ensemble.plist
Last active September 18, 2023 06:26
Put this file as /Library/Preferences/FeatureFlags/Domain/Ensemble.plist and reboot to (hopefully) turn on Universal Control on macOS 12
<?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>
<!-- not sure which one it is, so set both -->
<key>Ensemble</key>
<dict>
<key>Enabled</key>
<true/>
</dict>