This file contains 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 | |
import os | |
import sys | |
from CoreFoundation import (CFPreferencesAppValueIsForced, | |
CFPreferencesCopyAppValue, | |
CFPreferencesCopyValue, | |
kCFPreferencesAnyUser, | |
kCFPreferencesAnyHost, |
This file contains 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
--- | |
- name: Install MacOS Packages | |
hosts: localhost | |
become: false | |
vars: | |
brew_cask_packages: | |
- atom | |
- docker | |
- dropbox | |
- firefox |
This file contains 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 datetime | |
import logging | |
import requests | |
import urlparse | |
class JamfUAPIAuthToken(object): | |
def __init__(self, jamf_url, username, password): | |
""" | |
:param jamf_url: Jamf Pro URL | |
:type jamf_url: str |
This file contains 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 base64 | |
import getpass | |
import sys | |
import xml.etree.ElementTree as Et | |
import urllib | |
import urllib2 | |
reload(sys) | |
sys.setdefaultencoding('utf-8') |
This file contains 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 | |
# Culled from https://gist.github.com/arubdesu/05b4172890450fa2d9e6 | |
# Given a list of FW models and Thunderstrike patched FW versions, | |
# report on whether a machine has been patched. | |
import subprocess | |
import plistlib | |
This file contains 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 | |
# | |
# Trigger an update of MAS (and softwareupdate) apps | |
# | |
# This seems to be all that's needed to schedule an immediate update of | |
# MAS apps. This should be run as a normal user. You can run this and | |
# tail the install log to get an idea of what's happening. | |
# | |
# You can also take a look at this user's ~/Library/Caches/com.apple.storagent | |
# directory to get a report on what apps were available, installable, etc. |
This file contains 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 | |
function get_package_id { ( | |
readonly PKG_INFO=PackageInfo | |
local PKG=$(cd "$(dirname "$1")"; pwd)/$(basename "$1") | |
local EXCLUDES= | |
for FILE in $(xar -t -f "$PKG" | grep -v $PKG_INFO); do | |
EXCLUDES="$EXCLUDES --exclude $FILE" | |
done | |
local TEMP=$(mktemp -t hoge | tr -d '\r') |
This file contains 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
#!flask/bin/python | |
from flask import Flask, jsonify, abort, request, make_response, url_for | |
from flask_httpauth import HTTPBasicAuth | |
app = Flask(__name__, static_url_path = "") | |
auth = HTTPBasicAuth() | |
@auth.get_password | |
def get_password(username): | |
if username == 'miguel': |
This file contains 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 | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
NewerOlder