Skip to content

Instantly share code, notes, and snippets.

Avatar
🍁

Timothy Sutton timsutton

🍁
View GitHub Profile
@timsutton
timsutton / fetch-install-vmware-tools.sh
Created Apr 9, 2017
Use AutoPkg and Rich Trouton's VMware Tools recipe to download and install the 'darwin' VMware guest tools on a macOS system
View fetch-install-vmware-tools.sh
#!/bin/sh -e
# Downloading VMware Tools within guest automatically using AutoPkg and Rich Trouton's
# VMware Tools recipe - used within ESXi build to workaround complicated tools
# upload issues (https://github.com/timsutton/osx-vm-templates/pull/30)
tmpdir=$(mktemp -d /tmp/vmware-tools-XXXXXX)
(
cd "${tmpdir}"
@timsutton
timsutton / supported_major_os_upgrades.py
Created Mar 29, 2017
Munki conditional for checking eligible OS upgrades
View supported_major_os_upgrades.py
#!/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 Mar 10, 2017
Spotify Mac executable modes in 1.0.50 vs. 1.0.49
View gist:2c38c1fb90383e8093bec3d90b88929b
# 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 Apr 24, 2019
Repackage the Sibelius 7.5 sounds into a standard package
View sib75_sounds_repack.sh
#!/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 Feb 22, 2017
Postinstall script to finish setting up Malwarebytes AntiMalware for Mac
View setup_mbam.sh
#!/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 Feb 16, 2017
One of roughly a dozen scripts and binaries used to simply copy an application, some plugins, and some audio files to a fixed location
View Garritan_Instruments_for_Finale.pkg.postinstall.sh
#!/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 Feb 7, 2017
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/
View suppress_adobe_cc_signin.py
#!/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 Mar 4, 2017
Custom VMware Fusion 8 Cask file patching an older vmnet-natd binary
View vmware-fusion.rb
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 Jan 19, 2017
Simple Bash script that repackages and copies Unity 3d 5 packages to a Munki repo
View make_unity_pkgs.sh
#!/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 Feb 7, 2020
apfs tools in Sierra
View apfs_cli_tools.txt
➜ ~ 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