Skip to content

Instantly share code, notes, and snippets.

View jmahlman's full-sized avatar
🍻

John Mahlman jmahlman

🍻
View GitHub Profile
#!/bin/bash
# geoff repoli
# customize this variable with relatively unique + identifiable string that matches the process(es)
# you want to terminate. not case-sensitive. for example:
# for all microsoft applications + background services: application="microsoft"
# for microsoft outlook: application="outlook" OR application="microsoft outlook"
application="your string goes here"
# get pids of any running microsoft processes
@calum-github
calum-github / format_hd.sh
Last active August 10, 2020 21:20
Disk formatter
#!/bin/bash
########################################################################
# Author: Calum Hunter #
# Date: 21/12/2016 #
# Version: 0.7 #
# Purpose: Fusion Drive Detection and general HD formatting before #
# imaging tasks. #
# #
########################################################################
@homebysix
homebysix / shard.sh
Last active February 1, 2021 23:44
shard.sh
#!/bin/bash
###
#
# Name: shard.sh
# Description: This Casper extension attribute takes a Mac serial
# number as input and uses that serial number to output a
# number from 0 to 9. This can be useful in scoping Casper
# policies to a specific percentage of the fleet.
# Author: Elliot Jordan <elliot@elliotjordan.com>
<?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>
@sdagley
sdagley / RipOff-McAfee v2.1.sh
Last active April 1, 2021 17:09
Based on RipOff-McAfee.sh V2 by adam_scheblein@mcafee.comUpdated launchctl calls to use bootout instead of unloadRemoves Privileged HelperTool added with ENS 10.7.1Terminates McAfee Agent Status Monitor when unloading launch items
#!/bin/sh
## RipOff-McAfee.sh
## version 2.0
##
## Author: Adam Scheblein, McAfee IT
## E-Mail: adam_scheblein@mcafee.com
##
## version 2.1 mods by Steve Dagley <@sdagley Jamf Nation/Twitter/MacAdmins Slack>
## Updated launchctl calls to use bootout instead of unload
@talkingmoose
talkingmoose / Generate Random Firmware Password.bash
Last active July 20, 2021 15:30
Generate a randome EFI firmware password for each Mac and store in Jamf Pro. Note: This will be completely visible to all Jamf Pro users whose permissions allow access to Computers. Create an extension attritute with the first script.
#!/bin/bash
function logresult() {
if [ $? = "0" ] ; then
echo "$1"
else
echo "$2"
exit 1
fi
}
@sdagley
sdagley / Install McAfee Agent Status Monitor PrivilegedHelper.sh
Created September 29, 2020 02:26
Install PrivilegedHelper and LaunchDaemon for the McAfee ENS 10.7.1 version of McAfee Agent Status Monitor.app so users aren't prompted for admin credentials to do the install the first time they slect the app from the McAfee Menulet
#!/bin/sh
# Install PrivilegedHelper and LaunchDaemon for the McAfee ENS 10.7.1 version of
# McAfee Agent Status Monitor.app so users aren't prompted for admin credentials to
# do the install the first time they select the app from the McAfee Menulet
helperSourcePath="/Library/Application Support/McAfee/MSS/Applications/McAfee Agent Status Monitor.app/Contents/Library/LaunchServices/com.mcafee.agentMonitor.helper"
helperDestinationPath="/Library/PrivilegedHelperTools/com.mcafee.agentMonitor.helper"
if [ -f "$helperSourcePath" ] && [ ! -f "helperDestinationPath" ]; then
@sdagley
sdagley / McAfeeENS10.7.1postinstall.bash
Last active December 7, 2021 01:40
For use in a package containing all of the McAfee ENS 10.7.1 component ePO installer packages, this postinstall script will install the ENS components in the required order, in kextless mode, then install the PrivilegedHelper tool that was added in 10.7.1
#!/bin/bash
## postinstall
# McAfeeENS10.7.1postinstall.bash
# by Steve Dagley <@sdagley Jamf Nation/Twitter/MacAdmins Slack/GitHub>
# postinstall script for single install package for complete install of McAfee ENS 10.7.1
#
# Incorporate RipOff_Mcafee V2.1 script from MacAdmins Slack #mcafee channel
#
@talkingmoose
talkingmoose / "Early Adopter" extension attribute
Last active November 21, 2023 22:31
Self Service policy to enable end users to enroll their Macs into an "Early Adopter Program" or any other type of enrollment. Create a Smart Computer Group to identify early adopters and scope policies.
#!/bin/zsh
enrollmentStatus=$( /usr/bin/defaults read '/Library/Preferences/EarlyAdopter.plist' Enrolled )
echo "<result>$enrollmentStatus</result>"
@talkingmoose
talkingmoose / Sonoma-compatible Macs (regex)
Last active December 10, 2023 17:14
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: November 15, 2023
Verification: https://regex101.com/r/GCfKMt/9
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).