Skip to content

Instantly share code, notes, and snippets.

View timsutton's full-sized avatar
🍁

Timothy Sutton timsutton

🍁
View GitHub Profile
@timsutton
timsutton / system_profiler_config_profile.txt
Created May 26, 2013 16:47
Output of system_profiler SPConfigurationProfileDataType
system_profiler SPConfigurationProfileDataType
Profiles:
Device Configuration Profiles:
Settings for Finder: Show Disks on Desktop:
Organization: MyOrg
Installation Date: Wednesday, 22 May, 2013 5:14:26 PM Eastern Daylight Time (2013-05-22 21:14:26 +0000)
@timsutton
timsutton / system_profiler_managed_client.txt
Created May 26, 2013 16:48
Sample output of system_profiler SPManagedClientDataType
system_profiler SPManagedClientDataType
Managed Client:
com.apple.finder:
ShowHardDrivesOnDesktop:
Value: 1
State: always
@timsutton
timsutton / profile_install.sh
Created May 26, 2013 16:50
sample profile installations with /usr/bin/profiles
sudo profiles -I -F ~/Downloads/Settings_for_Finder-_Show_Disks_on_Desktop.mobileconfig
sudo profiles -I -F ~/Downloads/Settings_for_Finder-_Show_servers_on_desktop.mobileconfig
@timsutton
timsutton / system_profiler_managedclient_missing.txt
Created May 26, 2013 16:51
Sample system_profiler output with a missing ManagedClient setting
Managed Client:
com.apple.finder:
ShowHardDrivesOnDesktop:
Value: 1
State: always
Source: com.apple.finder (Computer)
@timsutton
timsutton / handle_sp_error.diff
Created June 5, 2013 12:52
Small fix to possibly handle broken system_profiler by dying immediately, instead of only timing out.
diff --git a/code/client/munkilib/munkicommon.py b/usr/local/munki/munkilib/munkicommon.py
index 428bc14..999947d 100755
--- a/code/client/munkilib/munkicommon.py
+++ b/usr/local/munki/munkilib/munkicommon.py
@@ -2032,7 +2032,11 @@ def getSPApplicationData():
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
try:
- output, unused_error = proc.communicate(timeout=60)
+ output, err = proc.communicate(timeout=60)
<?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 / packer_panic.txt
Last active December 19, 2015 03:19
debug output for packer issue #52: https://github.com/mitchellh/packer/issues/52
2013/06/28 20:47:15 Packer config: &{PluginMinPort:0 PluginMaxPort:0 Builders:map[amazon-ebs:packer-builder-amazon-ebs digitalocean:packer-builder-digitalocean virtualbox:packer-builder-virtualbox vmware:packer-builder-vmware] Commands:map[build:packer-command-build validate:packer-command-validate] PostProcessors:map[compress:packer-post-processor-compress] Provisioners:map[shell:packer-provisioner-shell]}
2013/06/28 20:47:15 Setting cache directory: /Users/tsutton/packer/packer_cache
2013/06/28 20:47:15 Environment.Cli: []string{"build", "osx_3gb.json"}
2013/06/28 20:47:15 command + args: []string{"build", "osx_3gb.json"}
2013/06/28 20:47:15 Loading command: build
2013/06/28 20:47:15 Creating plugin client for path: /usr/local/packer/packer-command-build
2013/06/28 20:47:15 /usr/local/packer/packer-command-build: 2013/06/28 20:47:15 Preparing to serve a command plugin...
2013/06/28 20:47:15 /usr/local/packer/packer-command-build: 2013/06/28 20:47:15 Plugin minimum port: 10000
2013/06/28 20:47:15 /usr/local/
@timsutton
timsutton / packer_osx_template_example.json
Last active December 19, 2015 21:59
Sample Packer template for OS X. ISO was built using prepare_veewee_iso.sh script available in the Veewee OS X template: https://github.com/jedi4ever/veewee/tree/master/templates/OSX/prepare_veewee_iso
{
"builders": [
{
"boot_wait": "2s",
"disk_size": 20480,
"guest_os_type": "darwin12-64",
"http_directory": "http",
"iso_checksum_type": "md5",
"iso_checksum": "50d9327a222ea08fda43475cb901f937",
"iso_url": "file:///Users/tsutton/git/github/veewee/iso/OSX_InstallESD_10.8.3_12D78.dmg",
@timsutton
timsutton / OmniGraffleAppcast.plist
Last active December 20, 2015 05:59
Sample OmniGroup autopkg recipes using Sparkle provider
<?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>Input</key>
<dict>
<key>IDENTIFIER</key>
<string>com.googlecode.autopkg.munki.OmniGraffleAppcast</string>
<key>NAME</key>
<string>Omnigraffle</string>
#!/bin/sh
PREFS_SRC="/Library/CDA/Files/google_chrome_preferences"
PREFS_TGT_DIR="$HOME/Library/Application Support/Google/Chrome/Default"
PREFS_TGT_FILE="$PREFS_TGT_DIR/Preferences"
# make our user's chrome profile dir if one doesn't already exist
[ -d "$PREFS_TGT_DIR" ] || mkdir -p "$PREFS_TGT_DIR"
# if prefs file doesn't already exist, copy it