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 | |
# Demo of determinining if a Google account has 2FA active | |
# Needs a Google account ID (email address) and a password | |
# If the password is the "main" password (not an app-specific password) | |
# and "Two-factor authentication required" is returned; then 2FA is active | |
import urllib | |
import urllib2 |
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 | |
# Master login hook script | |
# | |
# runs each script found in the login hooks directory | |
LOGINHOOKSDIR="/etc/hooks/login" | |
if [ -d ${LOGINHOOKSDIR} ]; then | |
for script in ${LOGINHOOKSDIR}/* ; do |
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
# sudo managedsoftwareupdate -vvvv --applesus | |
Managed Software Update Tool | |
Copyright 2010-2014 The Munki Project | |
http://code.google.com/p/munki | |
Starting... | |
Performing preflight tasks... | |
preflight stdout: Preflight report submmitted for Greg-Neagle--tic. | |
NOTE: managedsoftwareupdate is configured to process Apple Software Updates only. | |
Checking Apple Software Update catalog... |
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 Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>catalogs</key> | |
<array> | |
</array> | |
<key>conditional_items</key> | |
<array> | |
<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
% ./autopkg run Firefox.install -v | |
Processing Firefox.install... | |
MozillaURLProvider | |
MozillaURLProvider: Found URL http://ftp.mozilla.org/pub/mozilla.org//firefox/releases/latest/mac/en-US/Firefox%2031.0.dmg | |
URLDownloader | |
URLDownloader: Storing new Last-Modified header: Thu, 17 Jul 2014 03:38:41 GMT | |
URLDownloader: Storing new ETag header: "4b25e62-3c17d83-4fe5b607b1240" | |
URLDownloader: Downloaded /Users/gneagle/Library/AutoPkg/Cache/com.github.autopkg.install.Firefox_EN/downloads/Firefox.dmg | |
EndOfCheckPhase | |
AppDmgVersioner |
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"] |
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
#!/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
<?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
<?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> |