Skip to content

Instantly share code, notes, and snippets.

@rtrouton
rtrouton / set_dns_search_domains_on_wifi_interfaces
Created June 5, 2015 22:08
This script will set specified DNS search domains on a Mac's wireless interface(s).
#!/bin/bash
# For the SearchDomains variable, change the search domains
# to be the ones you need, separated by spaces. For example,
# if you needed to set verizon.com and comcast.com as DNS
# search domains, SearchDomains would be set like this:
#
# SearchDomains="verizon.com comcast.com"
#
@rtrouton
rtrouton / gist:11221544
Last active February 27, 2018 14:44
Script that checks for JAMF's Casper agent and verifies that it's communicating properly with the Casper server. Script assumes that the user has a web server where a Casper QuickAdd package is available for download as a .zip file.
#!/bin/bash
#
# User-editable variables
#
# For the fileURL variable, put the complete address
# of the zipped Casper QuickAdd installer package
fileURL="http://server_name_here.domain.com/quickadd_name_goes_here.zip"
@rtrouton
rtrouton / resize_vm_boot_partition.sh
Created March 3, 2017 21:01
Resize boot volume using diskutil to occupy all available space on the partition
#!/bin/bash
# Resize boot volume to occupy all available space on the partition
/usr/sbin/diskutil resizeVolume / R
@rtrouton
rtrouton / DisableAllPoliciesInCategory.sh
Created November 17, 2017 20:18
This script disables all polices in a specified category on a Jamf Pro server
#!/bin/bash
clear
# This script enables all polices in a specified category
# Script is adapted from purgeAllPoliciesInCategory.bash by Jeffrey Compton, https://twitter.com/igeekjsc
# https://github.com/igeekjsc/JSSAPIScripts/blob/master/purgeAllPoliciesInCategory.bash
#Authenticate
read -p "Please enter your JSS URL (e.g. https://myJSS.myCompany.com:8443/) : " jssURL
@rtrouton
rtrouton / EnableAllPoliciesInCategory.sh
Created November 17, 2017 20:18
This script enables all polices in a specified category on a Jamf Pro server
#!/bin/bash
clear
# This script enables all polices in a specified category
# Script is adapted from purgeAllPoliciesInCategory.bash by Jeffrey Compton, https://twitter.com/igeekjsc
# https://github.com/igeekjsc/JSSAPIScripts/blob/master/purgeAllPoliciesInCategory.bash
#Authenticate
read -p "Please enter your JSS URL (e.g. https://myJSS.myCompany.com:8443/) : " jssURL
@rtrouton
rtrouton / gist:9a90b10c669323df65eec8eb8956cc5d
Created April 28, 2017 16:14
Xcode tvOS simulator download URLs (as of Xcode 8.3.1)
tvOS 10.1 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK10_1-10.1.1.1484185528.dmg
tvOS 10.0 Simulator: https://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK10_0-10.0.1.1474488730.dmg
tvOS 9.2 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK9_2-9.2.1.1460407064.dmg
tvOS 9.1 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK9_1-9.1.1.1451953694.dmg
tvOS 9.0 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK9_0-9.0.1.1446152618.dmg
@rtrouton
rtrouton / gist:3c1032e9454ceda0ad66
Created May 12, 2015 20:31
Installer postinstall script that installs two Office 2011 installers (the Office 2011 14.4.2 full installer and the 14.5.0 update) and automatically fixes an issue with the volume license being wiped out by the 14.5.0 update
#!/bin/sh
# Determine working directory
install_dir=`dirname $0`
# Location of Microsoft Office Volume License file
office_license="$3/Library/Preferences/com.microsoft.office.licensing.plist"
@rtrouton
rtrouton / gist:cc3130e314ecb4f4284e05c9f17fd4fc
Created April 28, 2017 16:14
Xcode watchOS simulator download URLs (as of Xcode 8.3.1)
watchOS 2.2 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.WatchSimulatorSDK2_2-2.2.1.1460407064.dmg
watchOS 2.1 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.WatchSimulatorSDK2_1-2.1.1.1451948363.dmg
watchOS 2.0 Simulator: https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/com.apple.pkg.WatchSimulatorSDK2_0-2.0.1.1446084258.dmg
@rtrouton
rtrouton / gist:04b6c31762b84b85eb44d0c59d8e1cd2
Created August 30, 2016 15:58
Mac models not compatible with macOS Sierra
'MacBookPro4,1'
'MacPro2,1'
'MacBookPro5,1'
'MacBookPro1,1'
'MacBookPro5,3'
'MacBookPro5,2'
'iMac8,1'
'MacBookPro5,4'
'iMac5,1'
'iMac5,2'
@rtrouton
rtrouton / gist:5303232
Created April 3, 2013 17:19
MCX debug reporting script
#!/bin/sh
PATH=/bin:/usr/bin:/sbin:/usr/sbin export PATH
# Define the recipient.
RECIP="email@address.here"
# That should be it for the necessary configuration part. The rest can be pretty much as-is.
NAME=`hostname`
LOGS="/tmp/tomcat-restart.txt"
HWLOGDATE=$(printf "`date "+%a %h %e"` \n")