This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| /usr/local/bin/autopkg run -v ${JOB_NAME}.munki MakeCatalogs.munki 2>&1 | tee /Users/Shared/Jenkins/tmp/${JOB_NAME}.log | |
| RESULT=`grep rebuilt /Users/Shared/Jenkins/tmp/${JOB_NAME}.log` | |
| if [ -n "$RESULT" ]; then | |
| echo "${JOB_NAME} added to Munki repository. Build successful." | |
| exit 0 | |
| else | |
| echo "Nothing added to munki. Failing the build even though all is well." | |
| exit 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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>tsutton</string> | |
| <key>creation_date</key> | |
| <date>2014-10-20T14:55:20Z</date> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| openssl smime -sign -nodetach -in "My Awesome.mobileconfig" -signer MyAwesomeCert.pem -inkey MyAwesome.key -outform DER -out "My Awesome Signed.mobileconfig" -certfile MyAwesomeCert.pem |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| ''' | |
| reposado update notification: reports changed Apple products between repo_sync runs | |
| Checks the current list of updates versus the previous list of updates and | |
| reports on the changes. Run this script after your repo_sync run to see the | |
| changes between syncs. You can then hand this report off in email if you wish. | |
| For example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import plistlib | |
| import CoreFoundation | |
| from Foundation import NSDate, NSMutableArray, NSMutableDictionary | |
| # read the current ManagedPlugInPolicies | |
| policy = CoreFoundation.CFPreferencesCopyAppValue("ManagedPlugInPolicies", "com.apple.Safari") | |
| if policy: | |
| # policy is an immutable dict, so we have to make a mutable copy | |
| my_policy = NSMutableDictionary.alloc().initWithDictionary_copyItems_(policy, True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| """Identify or remove files known to be involved in Adware/Malware | |
| infection. | |
| Most of the code applies to building a list of malware files. Thus, | |
| both extension attribute and removal handling are included. | |
| Cleans files as a Casper script policy; thus, it expects four total | |
| arguments, the first three of which it doesn't use, followed by | |
| --remove |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import tempfile, os.path, shutil, glob, os, subprocess, re | |
| debug = True | |
| # It should take the logs from tmp and clone them somewhere | |
| # It can then bunzip and combine them | |
| def log(s): | |
| global debug | |
| if debug: | |
| print s |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### | |
| # | |
| # Name: shard.sh | |
| # Description: This Jamf Pro extension attribute takes a Mac serial | |
| # number as input and uses that serial number to output a | |
| # number from 0 to 9. This can be useful in scoping Jamf | |
| # policies to a specific percentage of the fleet. | |
| # Author: Elliot Jordan <[email protected]> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def default_interface(): | |
| # 203.0.113.1 is reserved in TEST-NET-3 per RFC5737 | |
| # Should never be local, essentially equal to "internet" | |
| # This should get the 'default' interface | |
| s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
| try: | |
| # Uses UDP for instant 'connect' and port 9 for discard | |
| # protocol: http://en.wikipedia.org/wiki/Discard_Protocol | |
| s.connect(('203.0.113.1', 9)) | |
| client = s.getsockname()[0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| # As written, this requires the following: | |
| # - OS X 10.6+ (may not work in 10.10, haven't tested) | |
| # - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6) | |
| # - pyObjC (as such, recommended to be used with native OS X python install) | |
| # Only tested and confirmed to work against 10.9.5 | |
| # Run with root |