Skip to content

Instantly share code, notes, and snippets.

@arubdesu
arubdesu / manu_dater.py
Last active October 19, 2015 01:28
How to nerd snipe me: make something useful, but have it be in bash.
#!/usr/bin/python
"""Estimates computers manufacture date, inspiration and data structures from:
https://github.com/isaacatmann/Casper-Born-on-Date
"""
import datetime
import objc
#pylint: disable=no-name-in-module
from Foundation import NSBundle
<?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>Description</key>
<string>Downloads the current release version of EndNote.</string>
<key>Identifier</key>
<string>com.github.jbaker10.download.EndNote</string>
<key>Input</key>
<dict>
@arubdesu
arubdesu / adhoc-osq.py
Last active February 8, 2016 17:49
All the things
#!/usr/bin/python
"""Collect inventory via osquery, etc"""
import csv
import datetime
import os
import platform
import plistlib
import subprocess
@arubdesu
arubdesu / ad-hoc_inventory.py
Last active October 15, 2015 03:28
For specific project, may mix in osquery
#!/usr/bin/python
"""
Manual inventory report - most functions borrowed from chilcote's pyfacts.
Writes unique csv to /tmp on each run. Created Allister Banks October 2015
"""
import csv
import datetime
#import json
<?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>Description</key>
<string>Downloads the current release version of CharlesProxy and builds a package.</string>
<key>Identifier</key>
<string>com.github.autopkg.pkg.CharlesProxy</string>
<key>Input</key>
<dict>
@arubdesu
arubdesu / SalModelLookup.py
Last active September 29, 2015 20:07
untested, but
#!/usr/bin/python
"""Performs lookup against Apple's online warranty check once every 28 days.
Stops performing checks a year from purchase date. """
import datetime
import dateutil.parser
import os.path
import pytz
import sys
@arubdesu
arubdesu / Info.plist
Last active September 23, 2015 15:15
data to cross-correlate between App Store JSON response and caching server debug log
<?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>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>DTCompiler</key>
<string>com.apple.compilers.llvm.clang.1_0</string>
@arubdesu
arubdesu / garagebandLauncher.plist
Created September 21, 2015 20:42
example OnDemand item
<?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>_metadata</key>
<dict>
<key>created_by</key>
<string>abanks</string>
<key>creation_date</key>
<date>2015-03-23T21:32:29Z</date>
@arubdesu
arubdesu / AddCodeSigVerificationToRecipeWiki.md
Last active September 24, 2015 20:33
New page for under the Autopkg->Recipes wiki heading

###Using CodeSignatureVerification in your recipe

The CodeSignatureVerifier processor was added to allow signature verification for both:

  1. Installer packages (.pkg or .mpkg).

  2. Application bundles (.app). This option is necessary since not all software is supplied as packages. Instead, software is commonly released for download 'bare' at the root of a zip archive. CodeSignatureVerifier can look inside a DMG mount, but zip's must use the Unarchiver processor first.

Take into account the fact that both the computer running autopkg and the one that genrates the required configuration settings should have the default spctl settings, meaning Gatekeeper allows apps from the App Store and those signed with an Apple-recognized Developer ID. ####Adding Application bundle (.app) verification to your recipe

@arubdesu
arubdesu / check_ad.py
Last active August 28, 2016 16:37
workflow step in DeployStudio to stop setting up for binding with hostname in a 'bad' (read= already used on a pc or some other mistakenly chosen) AD OU/container
#!/usr/bin/python
"""Checks if a computername already exists in a container we can't write to,
to prevent errors binding."""
import os
import subprocess
import sys