Skip to content

Instantly share code, notes, and snippets.

View timsutton's full-sized avatar
🍁

Timothy Sutton timsutton

🍁
View GitHub Profile
@timsutton
timsutton / set_default_color_profile.py
Last active April 29, 2021 14:28
Very basic example to set a display device's default colorsync profile.
#!/usr/bin/python
import objc
import Foundation
import Quartz
# replace with url-encoded path to an icc profile
URL_ENCODED_ICC_PATH = 'file:///Library/Application%20Support/Adobe/Color/Profiles/SMPTE-C.icc'
# stripped bridge metadata of all we need for this sample:
#!/usr/bin/python
import objc
import Foundation
objc.parseBridgeSupport("""<?xml version='1.0'?>
<!DOCTYPE signatures SYSTEM "file://localhost/System/Library/DTDs/BridgeSupport.dtd">
<signatures version='1.0'>
<cftype name='ColorSyncProfileRef' type='^{ColorSyncProfile=}' tollfree='__NSCFType' gettypeid_func='ColorSyncProfileGetTypeID'/>
<constant name='kColorSyncDeviceDefaultProfileID' type='^{__CFString=}'/>
require "tempfile"
require "vagrant/util/template_renderer"
module VagrantPlugins
module GuestDarwin
module Cap
class ConfigureNetworks
include Vagrant::Util
@timsutton
timsutton / rme_postinstall.sh
Created August 6, 2013 18:47
RME Fireface driver installer
#!/bin/sh -
cd /tmp
sudo tar -xpf rme_fw_install.tar
cd /System/Library/Extensions
sudo rm -r FirefaceAudioDriver.kext
cd /Applications
sudo rm -r "Fireface Settings.app"
sudo rm -r "Fireface Mixer.app"
sudo rm -r "Totalmix.app"
cd /Library/LaunchAgents
@timsutton
timsutton / Dropbox_pkginfo.plist
Created August 8, 2013 14:19
As generated by this autopkg recipe: https://github.com/autopkg/recipes
<?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>autoremove</key>
<false/>
<key>catalogs</key>
<array>
<string>testing</string>
<string>production</string>
@timsutton
timsutton / postinstall.sh
Created August 8, 2013 17:19
printer postinstall script for WorkCentre 5755
#!/bin/sh
HOST=print.queue.org
TRAYS_OPTION="XRTrays=FiveExtraTrays"
QUEUE="5755_EV3_749"
MODEL="5755"
LOCATION="EV 3.749"
DESCRIPTION="Xerox $MODEL $LOCATION"
#!/usr/bin/python
import urllib
from xml.etree import ElementTree as ET
from distutils.version import LooseVersion
data = urllib.urlopen('https://softwareupdate.vmware.com/cds/vmw-desktop/fusion.xml').read()
xml = ET.fromstring(data)
updates = []
<?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 current release version of Carbon Copy Cloner and imports into Munki.</string>
<key>Input</key>
<dict>
<key>IDENTIFIER</key>
<string>com.github.keeleysam.autopkg.munki.CarbonCopyCloner</string>
@timsutton
timsutton / clone.sh
Last active December 21, 2015 10:49
Jenkins build steps to run all autopkg recipes. Assumes the job first does a git clone of https://github.com/autopkg/autopkg
# (set GIT to the git binary if needed)
$GIT clone https://github.com/autopkg/recipes autopkg-recipes
$GIT clone https://github.com/keeleysam/recipes keeleysam-recipes
#!/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.