Skip to content

Instantly share code, notes, and snippets.

View nmcspadden's full-sized avatar

Nick McSpadden nmcspadden

View GitHub Profile
#!/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)
<?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>
<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>
#!/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)
#!/bin/sh
# Set paths to our utilities
networksetup=/usr/sbin/networksetup
airport=/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport
# Determines which OS the script is running on
osvers=$(sw_vers -productVersion | awk -F. '{print $2}')
# On 10.7 and higher, the Wi-Fi interface needs to be identified.
@nmcspadden
nmcspadden / SignProfiles.sh
Last active December 6, 2022 23:33
Signs a folder full of profiles
#!/bin/bash
for profile in Profiles/*.mobileconfig
do
s=${profile##*/}
outName=${s%.*}
outName+="Signed.mobileconfig"
/usr/bin/security cms -S -N "Mac Developer Application" -i $profile -o "$outName"
done
* 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
#!/bin/sh
# Copyright 2008-2015, LastPass, LastPass.com
# ALL RIGHTS RESERVED
PACKAGE_PATH=$1
INSTALL_PATH=$2
INSTALL_VOLUME=$3
EXTRA_PARAMS=$4
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/
#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