Skip to content

Instantly share code, notes, and snippets.

{
AppleSoftwareUpdatesOnly = 0;
ClientIdentifier = "";
LastCheckDate = "2014-03-18 20:50:21 +0000";
LastCheckResult = 1;
LogFile = "/Library/Managed Installs/Logs/ManagedSoftwareUpdate.log";
LoggingLevel = 1;
ManagedInstallDir = "/Library/Managed Installs";
PackageVerificationMode = hash;
SoftwareRepoURL = "https://munki.grahamgilbert.com/repo";
@grahamgilbert
grahamgilbert / boot_rom_version.py
Created March 5, 2015 20:49
boot_rom_version.py
#!/usr/bin/python
# Written in 10 minutes and tested on 10.10.2 only. Use with caution.
import subprocess
import plistlib
import os
from Foundation import CFPreferencesCopyAppValue
def boot_rom_version():
@grahamgilbert
grahamgilbert / Techsupport.pp
Created May 15, 2012 18:46
Tech support user
user { 'techsupport':
ensure => 'present',
groups => 'admin',
comment => 'Tech Support',
gid => '20',
home => '/Users/techsupport',
password => $password,
shell => '/bin/bash',
uid => '404',
}
@grahamgilbert
grahamgilbert / gist:3240252
Created August 2, 2012 20:13
sign a package for mountain lion
productsign --sign "Developer ID Installer: Whatever your certname is" /path/to/input/package.pkg /path/to/signed/package.pkg
@grahamgilbert
grahamgilbert / init.pp
Created August 18, 2012 20:03
Location based printer setup
case $operatingsystem{
Darwin:{
##London is is on the 10.30.2.0 and 10.30.3.0 Subnets
if ($network_en0 == '10.30.2.0') or ($network_en1 == '10.30.2.0') or ($network_en0 == '10.30.3.0') or ($network_en1 == '10.30.3.0'){
printer { "Sharp_ARM316":
ensure => present,
uri => "lpd://sharparm316.ldn.example.com",
description => "Sharp ARM316",
shared => false,
ppd => "/Library/Printers/PPDs/Contents/Resources/SHARP AR-M316.PPD.gz", # PPD file will be autorequired
@grahamgilbert
grahamgilbert / init.pp
Created August 18, 2012 20:03
Location based printer setup
case $operatingsystem{
Darwin:{
##London is on the 10.30.2.0 and 10.30.3.0 Subnets
if ($network_en0 == '10.30.2.0') or ($network_en1 == '10.30.2.0') or ($network_en0 == '10.30.3.0') or ($network_en1 == '10.30.3.0'){
printer { "Sharp_ARM316":
ensure => present,
uri => "lpd://sharparm316.ldn.example.com",
description => "Sharp ARM316",
shared => false,
ppd => "/Library/Printers/PPDs/Contents/Resources/SHARP AR-M316.PPD.gz", # PPD file will be autorequired
@grahamgilbert
grahamgilbert / puppet_conf.py
Created August 29, 2012 16:15
Script to write the puppet.conf for a Mac client using the serial as the certname
#!/usr/bin/env python
import subprocess
import re
from os import close
##put your puppet server here:
puppetserver = "puppet.example.com"
##get the system serial number
@grahamgilbert
grahamgilbert / com.pebbleit.puppet.plist
Last active December 19, 2015 22:48
Our Puppet Launch Daemon
<?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>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/sbin:/usr/sbin:/bin:/usr/bin</string>
<key>RUBYLIB</key>
<string>/usr/lib/ruby/site_ruby/1.8/</string>
@grahamgilbert
grahamgilbert / Makefile
Created September 12, 2013 15:52
Luggage Makefile that makes a Mac reboot
include /usr/local/share/luggage/luggage.make
TITLE=Enable_Auto_Time_Zone
PACKAGE_NAME=Enable_Auto_Time_Zone
REVERSE_DOMAIN=com.pebbleit
PAYLOAD=\
pack-script-postflight
PM_RESTART=RequiredRestart