Skip to content

Instantly share code, notes, and snippets.

Avatar

Graham Pugh grahampugh

View GitHub Profile
@grahampugh
grahampugh / AutoPkg-verify-trust-info.sh
Created Jun 10, 2020
Runs through a recipe list and verifies trust info. Creates a trusted recipe list and sends untrusted recipes to a Slack incoming web hook.
View AutoPkg-verify-trust-info.sh
#!/bin/bash
#
# AutoPkg verify trust of existing recipes
# by Graham Pugh
# server name, used as the username in Slack
server="$1"
# slack webhook, e.g. https://hooks.slack.com/services/ASBCDSDAD/SDFGASDF/SDFAvSDfASDFvsdfA
slack_webhook_url="$2"
@grahampugh
grahampugh / privileges-time-limited-elevation.sh
Created May 20, 2020
A script for Jamf Pro Self Service to grant time-limited elevated user rights
View privileges-time-limited-elevation.sh
#!/bin/bash
## Privileges time-limited elevation
## v. 0.1 - G. Pugh 2020-05-20
# Sets admin privileges for defined number of minutes
duration_minutes=$4
# Privileges installer policy trigger name
policy_trigger_name="Privileges-install"
View change_hostname.sh
#!/bin/bash
####################################################################################################
#
# Change host name
#
####################################################################################################
#
# HISTORY
#
# Version 1.0, 27-Mar-2018, Graham Pugh.
@grahampugh
grahampugh / Prism-postinstall.py
Last active Dec 10, 2019
Postinstall script to set configurations for Prism via Jamf Pro. Parameter 4 is the license key.
View Prism-postinstall.py
#!/usr/bin/python
import sys
import xml.etree.cElementTree as ET
'''
This is a postinstall script for Prism. It is used to generate the
prism-config.xml file that stores the serial number and other settings
ready for silent activation.
@grahampugh
grahampugh / Adobe CC Cleaner-postinstall.sh
Created Nov 18, 2019
A script to clean up properly the things that Adobe CC Cleaner fails to remove.
View Adobe CC Cleaner-postinstall.sh
#!/bin/bash
## postinstall script to remove CCDA applications
# remove any existing version of the tool
echo "Moving the CC Cleaner app to Utilities in case users need it later"
rm -rf /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app ||:
mv /Applications/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app /Applications/Utilities/Adobe\ Creative\ Cloud\ Cleaner\ Tool.app
# run the cleaner tool to remove EVERYTHING!
echo "Running the CC Cleaner app with 'removeAll=All' option"
@grahampugh
grahampugh / Atom.jss.recipe
Created Nov 9, 2019
JSS Recipe Override example
View Atom.jss.recipe
<?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>Identifier</key>
<string>local.jss.Atom</string>
<key>Input</key>
<dict>
<key>CATEGORY</key>
<string>Computer Science</string>
@grahampugh
grahampugh / slack-hourly-jamf-errors.py
Last active Oct 22, 2019
Generate hourly Slack error notifications from JAMFSoftwareServer.log files in a multi-context environment
View slack-hourly-jamf-errors.py
#!/usr/bin/python
#
# Copyright 2019 Graham Pugh
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@grahampugh
grahampugh / Uninstall OpenJDK 11.py
Last active May 2, 2019
Uninstalls OpenJDK 11 or any Oracle Java for that matter.
View Uninstall OpenJDK 11.py
#!/usr/bin/python
'''
Uninstall Java/OpenJDK
Deisgned to be run from Jamf Pro
Parameter 4 needs to be supplied - the version of Java/OpenJDK to remove
'''
@grahampugh
grahampugh / jdk_version.py
Created Apr 23, 2019
Print the JDK latest version
View jdk_version.py
#!/usr/bin/python
### JDK Version identifier
def version():
"""Returns the latest installed jdk version"""
import subprocess
import plistlib
jdk_home_output = "/usr/libexec/java_home -X"
java_arch = "x86_64"
@grahampugh
grahampugh / SPSSStatistics Node.pkg.recipe
Created Mar 29, 2019
AutoPkg recipe for packaging up SPSSStatistics with a License Code
View SPSSStatistics Node.pkg.recipe
<?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>Description</key>
<string>Downloads the latest version of SPSSStatistics and creates a package.</string>
<key>Identifier</key>
<string>com.github.grahampugh.recipes.pkg.SPSSStatisticsNode</string>
<key>Input</key>
<dict>
You can’t perform that action at this time.