Skip to content

Instantly share code, notes, and snippets.

@apizz
apizz / com.google.Chrome.plist
Created September 19, 2019 00:54
Example of preferences we enforce via profile in our MDM
<?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>ExtensionSettings</key>
<dict>
<!-- uBlock Origin -->
<key>cjpalhdlnbpafiamejdnhcphjbkeiagm</key>
<dict>
<key>installation_mode</key>
@apizz
apizz / com.google.Chrome.plist
Created September 19, 2019 00:28
Our administrative default settings for the Chrome web browser
<?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>BookmarkBarEnabled</key>
<true/>
<key>HomepageIsNewTabPage</key>
<false/>
<key>HomepageLocation</key>
<string>https://www.mastersny.org</string>
@apizz
apizz / TeamViewerHost-Extended-Attribute-postinstall.sh
Last active February 11, 2020 17:57
Writes the supplied TeamViewer Host configuration ID to the TeamViewer Host app. For use with munki.
#!/bin/sh
ATTR="com.TeamViewer.ConfigurationId"
CONFIG_ID="<your_custom_config_id>"
TVHOST="/Applications/TeamViewerHost.app"
STATUS=$(/usr/bin/xattr -l "$TVHOST")
# If no extended attribute present, write it
if [ "$STATUS" = "" ]; then
/bin/echo "Writing TeamViewer Host configuration ID ..."
@apizz
apizz / docker_snipeit_dbbackup.sh
Last active September 25, 2024 23:43
Backup a specified Snipe-IT Docker container and cleanup any old backups
#!/bin/bash
#
# Script for running automated backups for Snipe-IT Docker containers and removing old backups
#
# Mean to be used as part of a crontab
#
# Limits its search for backups to clean up to those in the 'BACKUP_DIR' folder, so
# you can create folders in this location to keep any manual backups for historical purposes
#
@apizz
apizz / TeamViewerHost_Install.sh
Created May 2, 2019 14:36
Downloads and installs the desired TeamViewer Host major version
#!/bin/bash
# Downloads the latest TeamViewer Host package, effectively going to
# get.teamviewer.com/YOURCUSTOMHOSTURL in a browser.
########################################################
LOGFILE="/Library/Logs/TeamViewerInstall.log"
DOWNLOADDIR="/Users/Shared"
# Ex. 12, 13, or 14
MAJORVERSION="13"
@apizz
apizz / com.google.Chrome.plist
Created January 15, 2019 00:24
Template /Library/Preferences.com.google.Chrome.plist file
<?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>BookmarkBarEnabled</key>
<true/>
<key>HomepageIsNewTabPage</key>
<false/>
<key>HomepageLocation</key>
<string>https://yourhomepage.com</string>
@apizz
apizz / EA_Clear_Failed_MDM_Commands.sh
Last active May 17, 2023 20:08
Jamf extension attribute for checking for and removing any failed macOS MDM commands
#!/bin/bash
jssurl="https://yourjss.com"
apiuser="yourapiuser"
apipass="yourapiuserpass"
serial=$(/usr/sbin/ioreg -rd1 -c IOPlatformExpertDevice | /usr/bin/awk -F'"' '/IOPlatformSerialNumber/{print $4}')
####### FUNCTIONS
clearfailedmdmcommands () {
@apizz
apizz / Uninstall_Wacom_Drivers.sh
Created December 6, 2018 21:33
For uninstalling Wacom driver software before installing a newer version
#!/bin/sh
OLD_APP="/Applications/Pen Tablet.localized/Pen Tablet Utility.app"
APP="/Applications/Wacom Tablet.localized/Wacom Tablet Utility.app"
OLD_EXE="${OLD_APP}/Contents/Resources/uninstall.pl"
EXE="${APP}/Contents/MacOS/Wacom Tablet Utility"
# If this app is installing, munki has detected we have a newer version. Therefore, if Wacom Tablet Utility already exists then we need to uninstall first
if [ -d "$OLD_APP" ]; then
sudo "$OLD_EXE"
@apizz
apizz / RunManagedAppleSoftwareUpdate.sh
Last active June 8, 2018 04:12
Run managed Apple software update download & install with munki
#!/bin/sh
MUNKI="/usr/local/munki/managedsoftwareupdate"
MUNKI_CACHE=$($MUNKI --show-config | /usr/bin/awk -F "'" '/ManagedInstallDir/{print $2}')
APPLESU_FILE="${MUNKI_CACHE}AppleUpdates.plist"
# Verify munki is installed
if [ ! -f "$MUNKI" ]; then
/bin/echo "Munki not installed. Exiting."
exit 1
@apizz
apizz / com.yourorg.reposado-reposync.plist
Last active May 17, 2018 12:18
LaunchDaemon to trigger a repo_sync for the sphen/reposado Docker container every day at 5am
<?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>Label</key>
<string>com.yourorg.reposado-reposync</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/docker</string>
<string>exec</string>