Skip to content

Instantly share code, notes, and snippets.

View Jaharmi's full-sized avatar
👋
You had me at ‘Hello World’!

Jeremy Reichman Jaharmi

👋
You had me at ‘Hello World’!
  • Landenberg, PA
  • 12:31 (UTC -04:00)
View GitHub Profile
@Jaharmi
Jaharmi / gist:7644523
Created November 25, 2013 16:54
Munki pkginfo “installs” key for the Microsoft Office and Microsoft Component Plugin frameworks on OS X to determine which version of Office 2011 is installed. See also http://www.officeformachelp.com/office/faqs/#faq4 and/or https://github.com/Jaharmi/extension_attribute/blob/master/microsoft_office_version.py
<?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>installs</key>
<array>
<dict>
<key>CFBundleShortVersionString</key>
<string>14.3.8</string>
<key>CFBundleVersion</key>
<?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">
<array>
<dict>
<key>attributeSetting</key>
<integer>1</integer>
<key>choiceAttribute</key>
<string>selected</string>
<key>choiceIdentifier</key>
@Jaharmi
Jaharmi / RecoveryHDExecutablesListMavericks
Created June 14, 2014 20:19
List of executables found via Terminal on OS X Mavericks Recovery HD volume
/usr/bin/arch
/usr/bin/asctl
/usr/bin/awk
/usr/bin/banner
/usr/bin/bsdtar
/usr/bin/c_rehash
/usr/bin/caffeinate
/usr/bin/chflags
/usr/bin/cksum
/usr/bin/codesign
@Jaharmi
Jaharmi / BundlePackageScriptVariablesCommentBlock
Created July 8, 2014 18:27
Apple Installer bundle-style package script variables as a comment block
# http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/SoftwareDistribution/Install_Operations/Install_Operations.html#//apple_ref/doc/uid/10000145i-CH14-SW1
# Arguments
# $1: Full path to the installation package the Installer application is processing.
# $2: Full path to the installation destination.
# $3: Installation volume (or mountpoint) to receive the payload.
# $4: The root directory for the system.
# Environment variables
# $SCRIPT_NAME: Filename of the operation executable.
# $PACKAGE_PATH: Full path to the installation package. Same as $1.
# $INSTALLER_TEMP: Scratch directory used by Installer to place its temporary work files. Install operations may use this area for their temporary work, too, but must not overwrite any Installer files. The Installer application erases this directory at the end of the install.
@Jaharmi
Jaharmi / extract_coretypes_icons.py
Created August 15, 2014 02:35
Extract icons from the OS X CoreTypes bundle while resizing them to 128×128 pixels and converting the images to PNG format.
#!/usr/bin/python
import os
import subprocess
import glob
image_format = "png"
# Get the paths to all icon files in the CoreTypes bundle
coretypes_path = '/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources'
#!/bin/sh
#
# This shell snippet will pre-set CrashReporter's setting for diagnostics submissions
# to Apple and app developers. This seems to also have the side effect of not showing
# the additional "Diagnostics & Usage" dialog at the end of the Setup Assistant,
# because the settings have already been configured in the
# DiagnosticMessagesHistory.plist file.
#
# Modify the SUBMIT_TO_* variables below to either YES or NO to configure the setting.
# They are currently set to the defaults suggested by Apple when the dialog is shown
#!/usr/bin/expect
log_user 0
set password s3kr1tp4ssw0rd
spawn fdesetup changerecovery -personal -key /path/to/keychain_with_both_private_and_public_keys_inside.keychain -outputplist > /path/to/new_recovery_key.plist
expect "keychain: "
send "$password\n"
log_file -a /path/to/new_recovery_key.plist
expect EOF
@Jaharmi
Jaharmi / gist:50951892c7bff21560bb
Created March 9, 2016 16:34
A Luggage makefile that specifies a Title with spaces.
USE_PKGBUILD=1
include /usr/local/share/luggage/luggage.make
TITLE=Title\ with\ Spaces
REVERSE_DOMAIN=com.pretendco
PACKAGE_ID=${REVERSE_DOMAIN}.titlewithoutspaces
PACKAGE_NAME=${TITLE}
PAYLOAD=\
...
@Jaharmi
Jaharmi / getosversionfromdmg.py
Last active September 26, 2017 03:05 — forked from bruienne/getosversionfromdmg.py
Get OS X version from DMG
#!/usr/bin/python
#
# getosversionfromdmg.py
#
# Copyright (c) 2014 The Regents of the University of Michigan
# Copyright (c) 2017 Jeremy Reichman
#
# Retrieves the OS version and build from the InstallESD.dmg contained in
# a typical "Install [Mac OS X|OS X|macOS] <Name>.app" bundle.
#