Skip to content

Instantly share code, notes, and snippets.

View clburlison's full-sized avatar

Clayton Burlison clburlison

View GitHub Profile
@clburlison
clburlison / update_CFBundleVersion_Xcode.sh
Created February 15, 2017 21:02
Update the CFBundleVersion based off of your git commits.
# based on http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode
if git rev-parse --is-inside-work-tree 2> /dev/null > /dev/null; then
echo "Setting CFBundleVersion to Git rev-list --count"
build_number=$(git rev-list HEAD --count)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $build_number" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
else
echo "Not in a Git repo, not setting CFBundleVersion"
fi
@clburlison
clburlison / preinstall_script
Created January 16, 2016 21:18
Office 2016 VL Serializer preinstall_script
#!/bin/bash
#
# Check for the existance of Microsoft's licensing file. If it exsits remove
# it prior to running Microsoft_Office_2016_VL_Serializer.pkg.
if [ -f '/Library/Preferences/com.microsoft.office.licensingV2.plist' ]; then
/bin/rm -f '/Library/Preferences/com.microsoft.office.licensingV2.plist'
fi
exit 0
@clburlison
clburlison / get_sys_info.scpt
Last active October 24, 2019 08:05
OS X Get Current Sys Info
# https://macadmins.slack.com/archives/general/p1449604450017318
set a to do shell script "defaults read /System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.meta.plist Version"
tell application "Finder" to set b to get creation date of (POSIX file "/System/Library/CoreServices/XProtect.bundle/Contents/Resources/XProtect.meta.plist" as alias)
set s to short date string of b
set t to time string of b
set c to do shell script "defaults read /private/var/db/gkopaque.bundle/Contents/version.plist CFBundleShortVersionString"
tell application "Finder" to set d to get creation date of (POSIX file "/private/var/db/gkopaque.bundle/Contents/version.plist" as alias)
set u to short date string of d
set v to time string of d
set e to do shell script "defaults read /System/Library/CoreServices/SystemVersion.plist ProductVersion"
@clburlison
clburlison / main.go
Created July 20, 2018 14:16
2018 Dallas Apple Meetup
package main // import "gitlab.com/clburlison/cfprefs"
// Huge credits to Tom Burgin (bur) & Victor Vrantchan (groob)
import (
"fmt"
"unsafe"
"reflect"
)
/*
@clburlison
clburlison / cfpref.go
Last active June 14, 2018 00:26
playing with cgo and CFPreferencesCopyAppValue. Currently supports reading Strings, NSData, and Booleans.
package main // import "gitlab.com/clburlison/cfprefs"
import (
"fmt"
"unsafe"
)
/*
#cgo LDFLAGS: -framework CoreFoundation
#include <CoreFoundation/CoreFoundation.h>
@clburlison
clburlison / vbox_verification.txt
Created March 15, 2018 06:03
ohai/pull/1164 - vbox & vmware
Last login: Wed Mar 14 22:54:07 on ttys000
vagrants-MacBook-Pro:embedded vagrant$ ohai hardware
[2018-03-14T22:54:39-07:00] INFO: The plugin path /etc/chef/ohai/plugins does not exist. Skipping...
{
"SMC_version_system": "2.3f35",
"apple_rom_info": "vboxVer_5.2.8vboxRev_121009",
"boot_rom_version": "VirtualBox",
"current_processor_speed": "2.71 GHz",
"l2_cache_core": "256 KB",
"l3_cache": "16 MB",
@clburlison
clburlison / office2016.xml
Last active March 6, 2018 03:34
Office 2016 Choice XML Example (this choice xml by default does not install Microsoft Autoupdate application) + Casper postinstall example. NOTE: Munki has a separate XML for copy/paste ability. https://clburlison.com/demystify-office2016
<?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>
@clburlison
clburlison / mwa2_ubuntu16.md
Last active February 28, 2018 19:36
A dirty mwa2 ubuntu 16 guide.

A dirty guide to setup MWA2 on Ubuntu 16. I want to convert this into a blog just haven't found the time.

Go full yolo sudo su

Install packages apt-get install git nginx python-pip python-dev

Let's create our mwa2 web config (no ssl so it's easier & using root because yolo)

@clburlison
clburlison / xcode_results_9.2.txt
Created February 19, 2018 17:39
Xcode 9.2 AutoPkg Results
Last login: Thu Feb 8 12:56:50 on ttys001
vagrant-17D47:~ vagrant$ autopkg
-bash: autopkg: command not found
vagrant-17D47:~ vagrant$ sudo installer -pkg /Users/vagrant/Downloads/autopkg-1.0.3.pkg -tgt /
installer: Package name is autopkg-1.0.3
installer: Installing at base path /
installer: The install was successful.
vagrant-17D47:~ vagrant$ autopkg repo-add https://github.com/facebook/Recipes-for-AutoPkg.git
Attempting git clone...
@clburlison
clburlison / fancy_defaults_read.py
Created July 19, 2017 17:09 — forked from gregneagle/fancy_defaults_read.py
fancy_defaults_read.py: Reads a preference, prints its value, type, and where it is defined.
#!/usr/bin/python
import os
import sys
from CoreFoundation import (CFPreferencesAppValueIsForced,
CFPreferencesCopyAppValue,
CFPreferencesCopyValue,
kCFPreferencesAnyUser,
kCFPreferencesAnyHost,