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
<key>_autopromotion_data<key> | |
<dict> | |
<key>2014-05-30</key> | |
<array> | |
<string>testing</string> | |
</array> | |
<key>2014-06-07<key> | |
<array> | |
<string>production</string> | |
</array> |
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
<key>_autopromotion_data<key> | |
<dict> | |
<key>4</key> | |
<array> | |
<string>testing</string> | |
</array> | |
<key>11<key> | |
<array> | |
<string>production</string> | |
</array> |
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>_autopromotion_catalogs</key> | |
<dict> | |
<key>7</key> | |
<array> | |
<string>production</string> | |
<string>firefox-testing</string> |
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 subprocess | |
output = subprocess.check_output(['/usr/bin/profiles', '-C']) | |
for line in output.splitlines(): | |
(stuff, label, profile_identifier) = line.partition(' profileIdentifier: ') | |
if label and profile_identifer.startswith('com.apple.mdm.mdm.educ.psu.edu'): | |
print profile_identifier |
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 urllib2 | |
url = 'http://www.macbartender.com/updates/Appcast.xml' | |
request = urllib2.Request(url=url) | |
request.add_header('user-agent', 'Mozilla/5.0') | |
url_handle = urllib2.urlopen(request) |
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>PayloadContent</key> | |
<array> | |
<dict> | |
<key>CalDAVAccountDescription</key> | |
<string>My Organization</string> | |
<key>CalDAVHostName</key> |
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>Description</key> | |
<string>Downloads and imports Munki 2 tools. Gets the latest build from https://munkibuilds.org/munkitools2-latest.pkg</string> | |
<key>Identifier</key> | |
<string>com.foo.autopkg.munki.munkitools2</string> | |
<key>Input</key> | |
<dict> |
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 | |
""" | |
Programmatically altering plists with Python, shooting to add support to ansible | |
""" | |
import optparse | |
import FoundationPlist | |
# from munkilib import FoundationPlist | |
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
Python 2.7.5 (default, Mar 9 2014, 22:15:05) | |
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> a = "AdobeDreamweaverCS5.5.png" | |
>>> import os | |
>>> os.path.splitext(a)[1] | |
'.png' | |
>>> os.path.splitext(a)[0] | |
'AdobeDreamweaverCS5.5' |
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 SystemConfiguration | |
prefs = SystemConfiguration.SCPreferencesCreate(None, "SystemConfiguration", None) | |
print SystemConfiguration.SCPreferencesGetValue(prefs, "System")["System"]["ComputerName"] |