Skip to content

Instantly share code, notes, and snippets.

View timsutton's full-sized avatar
🍁

Timothy Sutton timsutton

🍁
View GitHub Profile
@timsutton
timsutton / supported_major_os_upgrades.py
Created March 29, 2017 15:33
Munki conditional for checking eligible OS upgrades
#!/usr/bin/python
# encoding: utf-8
#
# Modified from Hannes Juutilainen's check-1012-sierra-compatibility.py
# and check-10.8-mountainlion-compatibility.py scripts from
#
# Hannes Juutilainen <hjuutilainen@mac.com>
# https://github.com/hjuutilainen/adminscripts
#
# Modified to return a single condition, `supported_major_os_upgrades`, which is
@timsutton
timsutton / gist:2c38c1fb90383e8093bec3d90b88929b
Last active May 26, 2021 17:26
Spotify Mac executable modes in 1.0.50 vs. 1.0.49
# In 1.0.50, no user besides the one who installed Spotify will be able to execute it. This means either other users on the system,
# or, if Spotify was deployed using any mass-deployment tool or installer package, and is owned by the root user, Spotify will not
# launch for anyone.
# Dir listing comparisons courtesy of https://github.com/poundbangbash
# 1.0.50
$ ls -l /Volumes/Spotify/Spotify.app/Contents/MacOS/
total 63160
-rwxr--r-- 1 homeadmin staff 30076384 Mar 1 13:36 Spotify
@timsutton
timsutton / sib75_sounds_repack.sh
Last active April 24, 2019 06:34
Repackage the Sibelius 7.5 sounds into a standard package
#!/bin/sh -eu
#
# Run the Sibelius 7.5 sounds installer, which will unpack sample data as well as some metadata, all into
# a 'Sibelius Sounds' directory. SOUNDS_SRC in this script points to this directory by default, but
# alternatively one could back up the Sibelius Sounds directory to a server and then change SOUNDS_SRC to
# that location.
#
# Note that 'Sibelius Sounds' is the top-level directory, and it contains another directory within with
# the same name (alongside 'Libraries').
#
@timsutton
timsutton / setup_mbam.sh
Last active February 22, 2017 16:24
Postinstall script to finish setting up Malwarebytes AntiMalware for Mac
#!/bin/sh
declare -r mbam_helper="/Applications/Malwarebytes Anti-Malware.app/Contents/Library/LaunchServices/com.malwarebytes.HelperTool"
declare -r privtools=/Library/PrivilegedHelperTools
declare -r launchd_plist=/Library/LaunchDaemons/com.malwarebytes.HelperTool.plist
# install helper tool
if [ ! -d ${privtools} ]; then
/bin/mkdir -p "${privtools}"
/bin/chmod 1755 "${privtools}"
@timsutton
timsutton / Garritan_Instruments_for_Finale.pkg.postinstall.sh
Created February 16, 2017 21:23
One of roughly a dozen scripts and binaries used to simply copy an application, some plugins, and some audio files to a fixed location
#!/bin/bash
#
# This postflight script echoes the values of the available
# arguments and environmental variables.
echo "BEGIN postlight script"
echo "$0"
echo "$1"
echo "$2"
@timsutton
timsutton / suppress_adobe_cc_signin.py
Last active February 7, 2017 23:02
Update all installed Adobe product install metadata to suppress the "Sign into Adobe CC" dialog box. This will likely make its way into https://github.com/timsutton/make-adobe-cc-license-pkg/
#!/usr/bin/python
# pylint: disable=locally-disabled, line-too-long
from __future__ import print_function
import os
import re
import sys
from glob import glob
@timsutton
timsutton / vmware-fusion.rb
Last active March 4, 2017 17:12
Custom VMware Fusion 8 Cask file patching an older vmnet-natd binary
require 'digest'
require 'tempfile'
VMNET_NATD_MD5 = 'e347f5c8d86640af5102852c897e31cc'
cask 'vmware-fusion' do
version '8.5.3-4696910'
sha256 '68d3f5b4379302138f3d1060ec270b960a531e28177f8b30c5431390912b6337'
url "https://download3.vmware.com/software/fusion/file/VMware-Fusion-#{version}.dmg"
appcast 'https://softwareupdate.vmware.com/cds/vmw-desktop/fusion.xml',
@timsutton
timsutton / make_unity_pkgs.sh
Created January 19, 2017 19:14
Simple Bash script that repackages and copies Unity 3d 5 packages to a Munki repo
#!/bin/bash -eu
# This script takes a directory containing flat packages. It expands
# them all, uses `xmlstarlet` to edit pkg-info 'version' attribute
# to the one given by VERSION, and flattens them back, saving them
# as "pkgname-VERSION.pkg"
# Use the Unity download assistant to download the packages in a VM
# to avoid actually installing them by accident on the machine, and
# then run this script. Currently we download:
@timsutton
timsutton / apfs_cli_tools.txt
Last active December 21, 2023 04:54
apfs tools in Sierra
➜ ~ sw_vers
ProductName: Mac OS X
ProductVersion: 10.12.1
BuildVersion: 16B2333a
➜ ~ ls -l /System/Library/Filesystems/apfs.fs/Contents/Resources
total 2088
-rwxr-xr-x 1 root wheel 349760 22 Sep 03:48 apfs.util
-rwxr-xr-x 1 root wheel 352880 22 Sep 03:48 apfs_invert
@timsutton
timsutton / ausst_sync_diff.sh
Created September 18, 2016 13:21
Utility for doing an AUSST sync run with actual diff output
#!/bin/sh
#
# Dumb script to output an actual diff of a run of Adobe's AUSST software update mirror tool,
# which provides no helpful summary of what changed in its last sync operation. It also runs
# the command with `time`.
#
# Requires the 'tree' command, available from your favourite package manager:
#
# Homebrew: https://github.com/Homebrew/homebrew-core/blob/master/Formula/tree.rb
# pkgsrc: https://github.com/joyent/pkgsrc/tree/trunk/sysutils/tree