Skip to content

Instantly share code, notes, and snippets.

@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 / SnowLeoAndLionPrintDrivers.catalog
Created July 23, 2012 10:30
Updated Apple printer drivers for InstaDMG
# Please comment-out unneeded updates as necessary (as this would add multiple GBs to your image)
# It is possible not all of these are 10.6-compatible, please test as applicable
# via https://github.com/thisisdave/instaCATS/blob/master/printers.catalog
# and https://raw.github.com/n8felton/Mac-OS-X-Scripts/master/InstaDMG/CatalogFiles/printers.catalog
Apple Updates:
Brother Printer Drivers 2.9 for OS X http://support.apple.com/downloads/DL894/en_US/BrotherPrinterDrivers2.9.dmg sha1:ced12cc349a6990094796395f8da579ba07ec5b7
Canon Printer Drivers v2.9 for OS X http://support.apple.com/downloads/DL899/en_US/CanonPrinterDrivers2.9.dmg sha1:d6dc46eeaf3d976966fa6c413b817314df867b38
Epson Printer Drivers v2.11 for OS X http://support.apple.com/downloads/DL1398/en_US/EPSONPrinterDrivers2.11.dmg sha1:40861b8d791ecb692612e9e2aff698a3cfbae982
FujiXerox Printer Drivers v2.3 for OS X http://support.apple.com/downloads/DL904/en_US/FujiXeroxPrinterDrivers.dmg sha1:e6275c6b766dc657255d8356766c8f5f3949a634
@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
#!/usr/bin/env bash
#
# This bootstraps an OS X Puppet Client
#
# Your Puppet server here
PUPPETSERVER='puppet.grahamgilbert.dev'
TESTURL='https://raw.github.com'
PUPPET_VER=`puppet --version`
@grahamgilbert
grahamgilbert / com.grahamgilbert.crypt.launcher.plist
Created December 12, 2013 17:19
LaunchDaemon, LaunchAgent and script to run Crypt as root at login without using a loginhook. The user can click on the desktop and quit the app, but it does get around any networking issues that might happen when running before login is finished.
<?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>Label</key>
<string>com.grahamgilbert.crypt.launcher</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/crypt/Crypt.app/Contents/MacOS/Crypt</string>
</array>