Skip to content

Instantly share code, notes, and snippets.

View bruienne's full-sized avatar

Pepijn Bruienne bruienne

View GitHub Profile
@bruienne
bruienne / byhost_batch_rename.sh
Last active December 18, 2015 17:19
Batch renaming a user's ByHost files - in case it's needed.
#!/bin/sh
if [ ! $1 ]; then
echo "Usage: byhost_batch_rename.sh <username>"
exit 1
else
user=$1
MYUUID=`system_profiler SPHardwareDataType | awk -F"\ " '/Hardware\ UUID/{print $3}'`
#Generated: 2013-06-19
# $Rev$ from $Date$
# Catalog assumes your InstallESD is the latest build available on the Mac App Store. If you are on an older build, uncomment the combo updater.
Installer Disc Builds: 12A269, 12B19, 12C60, 12D78, 12E55
Output Volume Name: Macintosh HD
Output File Name: 10.8_vanilla
OS Updates:
CC style installer
Setup/Adobe\ Dreamweaver\ CC_0/
├── Install.app
│   └── Contents
│   ├── Dylibs
│   ├── Frameworks
│   ├── Info.plist
│   ├── MacOS
│   ├── PkgInfo
@bruienne
bruienne / gist:7026822
Created October 17, 2013 15:19
completion handler sample
#!/usr/bin/python
from Cocoa import *
from Automator import *
from Foundation import NSURL
workflow_path = "/someplace/some.workflow"
file_url = NSURL.fileURLWithPath_(workflow_path)
class completionHandler:
def __call__(self):
@bruienne
bruienne / gist:7121036
Created October 23, 2013 15:37
Settings to modify to nix first boot dialogs for Mavericks, as I've figured them out so far.
#!/bin/bash
/usr/bin/touch "${2}/var/db/.AppleSetupDone"
/usr/bin/touch "${2}/var/db/.SetupRegComplete"
/usr/bin/defaults write "${2}/System/Library/User\ Template/Non_localized/Library/Preferences/com.apple.SetupAssistant" DidSeeCloudSetup -bool TRUE
/usr/bin/defaults write "${2}/System/Library/User\ Template/Non_localized/Library/Preferences/com.apple.SetupAssistant" GestureMovieSeen -bool TRUE
/usr/bin/defaults write "${2}/System/Library/User\ Template/Non_localized/Library/Preferences/com.apple.SetupAssistant" LastCacheCleanupProductVersion -string "10.9"
/usr/bin/defaults write "${2}/System/Library/User\ Template/Non_localized/Library/Preferences/com.apple.SetupAssistant" LastPreLoginTasksPerformedBuild -string "13A598"
/usr/bin/defaults write "${2}/System/Library/User\ Template/Non_localized/Library/Preferences/com.apple.SetupAssistant" LastPreLoginTasksPerformedVersion -string "10.9"
@bruienne
bruienne / ssh-secret.plist
Created October 31, 2013 19:49
Create service entry for alternate port SSH using /Local/Default DS entry. Drop file in /var/db/dslocal/nodes/Default/services
<?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>generateduid</key>
<array>
<string>D5E13A65-4CF4-4AD3-913D-46CC16C47E93</string>
</array>
<key>name</key>
<array>
@bruienne
bruienne / gist:7327076
Created November 5, 2013 21:58
Mavericks PDE sandboxing patch - pkginfo for Munki. Currently writes a small trigger file to /Library/Printers/pdefix.plist. Feel free to implemented a different (more elegant) method.
<?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>
</array>
@bruienne
bruienne / Generic Mavericks PDE security workaround
Created December 3, 2013 21:54
Pure Python version of fix for KM PDEs (and other affected printer makes). Works around sandboxing restrictions in Mavericks that affect non-compliant Print Dialog Extensions.
#!/usr/bin/python
import os
import sys
import plistlib
import json
import fnmatch
basepath = '/Library/Printers'
for root, dirs, files in os.walk(basepath):
if fnmatch.fnmatch(root, "*PDE*"):
@bruienne
bruienne / gist:ff4b53acb3c50d6d3f36
Created April 30, 2014 18:48
Patch for nuitka to use clang-compatible -rpath LINKFLAG vs. unsupported -R
# Set load libpython from binary directory default
if standalone_mode and gcc_mode and sys.platform != "darwin":
env.Append( LINKFLAGS = [ "-Wl,-R,'$$ORIGIN'" ] )
else:
print 'LINKFLAGS for Darwin used'
env.Append( LINKFLAGS = [ "-Wl,-rpath,'$$ORIGIN'" ] )
pkgutil --pkgs="com\.microsoft\.office\.[a-z]{2}\..*" | awk -F. '!seen[$4] {print $4} {++seen[$4]}'