Skip to content

Instantly share code, notes, and snippets.

View grahampugh's full-sized avatar

Graham Pugh grahampugh

View GitHub Profile
@grahampugh
grahampugh / AdobeReaderInstaller.sh
Created February 27, 2017 12:59
Adobe Reader latest "full" install URL provider and downloader/installer
#!/bin/bash
# Adobe Reader installer
# Based on https://github.com/mm2270/CasperSuiteScripts/blob/master/install_Latest_AdobeReader.sh
# Requires a downloaded Adobe Reader DMG
# Proxy if required
#export http_proxy="http://proxy.my.org:2010/"
#export https_proxy=$http_proxy
# Python file that determines the download URL
@grahampugh
grahampugh / Remove Application.sh
Last active February 17, 2025 18:15
A Jamf Pro script to remove applications in the Applications folder.
#!/bin/bash
#######################################################################
#
# Remove Application Script for Jamf Pro
#
# This script can delete apps that are sandboxed and live in /Applications
#
# The first parameter is used to kill the app. It should be the app name or path
# as required by the pkill command.
@grahampugh
grahampugh / make_icns.zsh
Last active January 13, 2025 13:32
Create iconset from a PNG
#!/bin/zsh
## Makes an icon set from a PNG. A 512x512 or 1024X1024 PNG is best.
## Taken from http://stackoverflow.com/a/31150333
## Usage: ./make_icns.zsh </path/to/image.png>
NAME=$(basename $1 .png); DIR="$NAME.iconset"
mkdir -pv $DIR
for m r in 'n' '' '((n+1))' '@2x'; do
for n in $(seq 4 9 | grep -v 6); do
@grahampugh
grahampugh / Adobe CC Cleaner-postinstall.sh
Created November 18, 2019 15:06
A script to clean up properly the things that Adobe CC Cleaner fails to remove.
#!/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 / mysqldump_cron.sh
Created January 15, 2019 18:40
Script to create daily, weekly and monthly mysqldumps and delete old ones
#!/bin/bash
# original source Lyman Lai
# http://002.yaha.me/item/22728a58-c967-46d5-93eb-2649d684a9aa/
# edited by G Pugh 2019-01-15
STORE_FOLDER="/home/MySQL-Backups"
TODAY=$(date +"%Y-%m-%d")
@grahampugh
grahampugh / api_test_pkg_jcds2.sh
Last active March 25, 2024 23:25
JCDS2 package upload script
#!/bin/bash
: <<DESCRIPTION
JCDS2 package upload script
by Graham Pugh (@grahamrpugh)
1. Get a bearer token
2. Check for an existing package from the Classic API
3. Check for an existing package from the JCDS endpoint
4. Check that the checksum matches our local pkg
@grahampugh
grahampugh / pkg_upload_aws_cdp.sh
Created March 6, 2024 20:40
A script to upload packages to a Jamf Pro Cloud Distribution Point hosted on AWS S3. Use --help for options.
#!/bin/bash
: <<DESCRIPTION
AWS S3 CDP package upload script
by Graham Pugh (@grahamrpugh)
1. Check for an existing package from the Classic API
2. Upload package to CDP if it's new or changed (this is tested by aws-cli using the sync command)
3. Upload the package metadata
@grahampugh
grahampugh / pkg_upload_jcds2.py
Created August 21, 2023 15:32
Upload a package to Jamf's JCDS2
#!/usr/bin/env python3
"""
A script to upload a package to the Jamf Cloud Distribution Point S3 bucket (JCDS 2.0)
Requirements from pip
boto3
requests
"""
@grahampugh
grahampugh / JamfSmartGroupTemplate.xml
Created May 13, 2022 08:35
SmartGroupTemplate for a "standard" .jamf recipe
<?xml version="1.0" encoding="UTF-8"?>
<computer_group>
<name>%GROUP_NAME%</name>
<is_smart>true</is_smart>
<criteria>
<criterion>
<name>Application Title</name>
<priority>0</priority>
<and_or>and</and_or>
<search_type>is</search_type>
@grahampugh
grahampugh / JamfPolicyTemplate.xml
Created May 13, 2022 08:45
PolicyTemplate for a "standard" .jamf recipe
<?xml version="1.0" encoding="UTF-8"?>
<policy>
<general>
<name>%POLICY_NAME%</name>
<enabled>true</enabled>
<frequency>Ongoing</frequency>
<category>
<name>%POLICY_CATEGORY%</name>
</category>
</general>