Skip to content

Instantly share code, notes, and snippets.

Avatar
🍁

Timothy Sutton timsutton

🍁
View GitHub Profile
View list_unused_munki_pkgs.py
#!/usr/bin/python
#
# list_unused_munki_pkgs.py
# Tim Sutton
#
# Simple script to list all Munki pkgs not currently referenced in a specific list
# of catalogs.
# It does not delete anything.
#
# CATALOGS can be modified to a list of catalogs in your repo that should be indexed.
@timsutton
timsutton / rename_ios_devices.py
Created Aug 24, 2016
Simple script to rename connected iOS devices according to a CSV file, using Apple Configurator 2's cfgutil command.
View rename_ios_devices.py
#!/usr/bin/python
#
# Simple script to batch-rename attached iOS devices according to UUID to name mappings
# in a CSV file.
#
# Usage: rename_devices.py <csvfile>
#
#
# The CSV file should be comma-separated and contain at least the 'udid' and 'name'
# fields. Such a CSV can be exported from Configurator. Any additional field will simply
@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
@timsutton
timsutton / LoginDialog.xml
Last active Nov 27, 2019
Vectorworks 2017 deployment stuff - Munki pkginfos and a Luggage project for network licensing
View LoginDialog.xml
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<LoginDialog>
<Days>1</Days>
<AutoFindServer>0</AutoFindServer>
<AutoFindMaxTime>1</AutoFindMaxTime>
<DontShowAtStartup>1</DontShowAtStartup>
<Servers>
<Server>license-server.org.my:5053</Server>
</Servers>
<Modules>
@timsutton
timsutton / join_zoom.sh
Created Jun 7, 2019
shell alias to join the currently-scheduled Zoom meeting on my calendar
View join_zoom.sh
join_zoom() {
# Joins the first Zoom meeting URL found in events happening now on
# your calendar, by searching their descriptions/locations info for
# "zoom.us" URLs, and opening them using `open`
#
# Another option for launching Zoom is directly, via its own URL handler like
# zoommtg://zoom.us/join?confno=123456789, but not sure how this works
# with static meeting URLs like zoom.us/my/myusername, and seems it
# could change in Zoom app updates, whereas the web URLs will always know
# what to do.
@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 / mv1Password.sh
Created May 27, 2018
1P 'mv1Password' script
View mv1Password.sh
#!/bin/sh
# this script removes the binary before we install it to ensure that we don't end up with a hybrid of what was there and what we're installing
echo "Removing legacy helper startup items"
loggedInUser=$(stat -f%Su /dev/console)
bundleIds=( "2BUA8C4S2C.com.agilebits.onepassword4-helper"
"2BUA8C4S2C.com.agilebits.onepassword-osx-helper"
"com.agilebits.onepassword-osx-helper"
"ws.agile.1PasswordAgent"
@timsutton
timsutton / AdobeAcrobatProAndReader_Settings.mobileconfig.xml
Last active Nov 29, 2018
Profile package for setting Adobe Acrobat/Reader settings, using Luggage for packaging.
View AdobeAcrobatProAndReader_Settings.mobileconfig.xml
<?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>PayloadContent</key>
<array>
<dict>
<key>PayloadContent</key>
<dict>
<key>com.adobe.Reader</key>
@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 / TaskExecutor.py
Created Feb 21, 2013
TaskExecutor.py helper script from Adobe's abominable Reader 10 update pkg
View TaskExecutor.py
#!/usr/bin/python
import sys,os,plistlib,pwd,grp,stat,urllib,subprocess,traceback,re
taskPlist = unicode(sys.argv[2], sys.getfilesystemencoding())
appPath = unicode(sys.argv[3], sys.getfilesystemencoding())
patchStore = unicode(sys.argv[4], sys.getfilesystemencoding())
binaryPath = unicode(sys.argv[5], sys.getfilesystemencoding())
CLI_mode = sys.argv[6]
title = sys.argv[7]