Skip to content

Instantly share code, notes, and snippets.

Avatar

Nick McSpadden nmcspadden

View GitHub Profile
View BuildingMunkiDockerWithChef_ChefMunkiDockerfile
FROM nmcspadden/munki
RUN apt-get -yqq update
RUN apt-get -yqq install curl lsb-release
RUN curl -L https://getchef.com/chef/install.sh | bash -s -- -v 11.16.2 -P container
ADD client.rb /etc/chef/client.rb
ADD validation.pem /etc/chef/validation.pem
View gist:331c408b03af58e1a20f
#Create keys
keypair = OpenSSL::PKey::RSA.new 2048
#Create CSR
name = OpenSSL::X509::Name.parse("CN=chef/DC=sacredsf/DC=org")
csr = OpenSSL::X509::Request.new
csr.version = 0
csr.subject = name
csr.public_key = keypair.public_key
csr.sign keypair, OpenSSL::Digest::SHA256.new
View gist:19cd0e53acd0926078b2
Nick-Tech:chef-repo nmcspadden$ chef-shell -c /etc/chef/client.rb
loading configuration: /etc/chef/client.rb
Session type: standalone
Loading......done.
This is the chef-shell.
Chef Version: 12.0.3
http://www.opscode.com/chef
http://docs.opscode.com/
View gist:d77d17a82f867909e8f1
#!/bin/sh
# Copyright 2008-2015, LastPass, LastPass.com
# ALL RIGHTS RESERVED
PACKAGE_PATH=$1
INSTALL_PATH=$2
INSTALL_VOLUME=$3
EXTRA_PARAMS=$4
View gist:68069d5f7c72a052b499
* Processing manifest item AdobeAcrobatPro11 for optional install
Looking for detail for: AdobeAcrobatPro11, version latest...
Considering 1 items with name AdobeAcrobatPro11 from catalog testing
Considering item AdobeAcrobatPro11, version 11.0 with minimum os version required 10.6.8
Our OS version is 10.10.3
Found AdobeAcrobatPro11, version 11.0 in catalog testing
Looking for application Acrobat with bundleid: com.adobe.Acrobat.Pro, version 11.0.0...
Getting info on currently installed applications...
Looking for application Acrobat with bundleid: com.adobe.Acrobat.Pro, version 11.0.0...
Adding AdobeAcrobatPro11 to the optional install list
View Manifests.py
#!/usr/bin/python
import csv
import os
MUNKI_REPO = "/Users/Shared/munki/manifests"
with open('serials.csv', mode='r') as infile:
reader = csv.reader(infile)
keyDict = dict(reader)
View Format the volume only, no partitioning
<dict>
<key>name</key>
<string>Attempted Formatting</string>
<key>description</key>
<string>This will break everything you&apos;ve ever loved</string>
<key>restart_action</key>
<string>none</string>
<key>bless_target</key>
<false/>
<key>components</key>
View WPWeAreImagr_imagr_config.plist
<?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>password</key>
<string></string>
<key>workflows</key>
<array>
</array>
</dict>
View This is a whole bunch of bullshit.py
#!/usr/bin/python
import subprocess
import sys
printerName = "PRINTERNAME"
printerOptions = { "HPOption_Duplexer":"False",
"HPOption_500_Sheet_Feeder_Tray3":"False" }
# Only lpoptions needs to be checked - if the printer doesn't exist, lpoptions will fail anyway.
cmd = ['/usr/bin/lpoptions', '-p', printerName, '-l']
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
View gist:67abea3f550af2c30ee6
<?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>PayloadIdentifier</key>
<string>org.sacredsf.profile.chrome</string>
<key>PayloadRemovalDisallowed</key>
<true/>
<key>PayloadScope</key>
<string>System</string>
You can’t perform that action at this time.