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
#!/usr/bin/python | |
# Alternate example using subprocess.Popen and finding the NSRunningApplication by PID | |
import AppKit | |
from time import sleep | |
from Foundation import NSURL | |
proc = subprocess.Popen(['/Applications/Xcode.app/Contents/MacOS/Xcode']) |
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
from ctypes import CDLL, Structure, POINTER, c_int64, c_int32, c_int16, c_char, c_uint32 | |
from ctypes.util import find_library | |
import time | |
c = CDLL(find_library("System")) | |
# https://opensource.apple.com/source/Libc/Libc-1158.50.2/include/NetBSD/utmpx.h.auto.html | |
# https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man3/endutxent.3.html#//apple_ref/doc/man/3/endutxent | |
BOOT_TIME = 2 |
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 | |
# pylint: disable=C0103, W0612, E1101, E0602, E0611 | |
# pylint: disable=W0101, W0110, W0141 | |
''''Fix 802.1x When Using Config Profiles and EAP-TLS''' | |
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # | |
# | |
# This script will determine the profile ID that was used when | |
# installing the 802.1x Ethernet Identity preference and make | |
# a copy of the keychain entry to be used as a user identity preference | |
# so that any Ethernet can be used when a user is logged in. As of 10.12.3 |
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 | |
# | |
# Restore the machine's saved .MASManifest. | |
echo "===== restore_masmanifest =====" | |
VARDBPATH="{{target_volume}}/private/var/db" |
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 | |
# pylint: disable=locally-disabled, line-too-long | |
from __future__ import print_function | |
import os | |
import re | |
import sys | |
from glob import glob |
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
'''Routines for manipulating the Dock''' | |
import os | |
import subprocess | |
from Foundation import NSURL | |
from Foundation import CFPreferencesAppSynchronize | |
from Foundation import CFPreferencesCopyAppValue | |
from Foundation import CFPreferencesSetAppValue |
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 | |
# encoding: utf-8 | |
# | |
# Copyright 2009-2016 Greg Neagle. | |
# | |
# Licensed under the Apache License, Version 2.0 (the 'License'); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
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
# Tested on 10.11 | |
# Assumes your network is in a state to actually do the discovery and that you have | |
# automatic timezone discovery enabled in Date & Time and Location services enabled | |
# (Generally this means wifi enabled on your device and network stack is up) | |
# For enabling location services and auto, check Allister's work here: | |
# https://gist.github.com/arubdesu/b72585771a9f606ad800 | |
from Foundation import NSBundle | |
TZPP = NSBundle.bundleWithPath_("/System/Library/PreferencePanes/DateAndTime.prefPane/Contents/Resources/TimeZone.prefPane") |
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 | |
# | |
# Simple script to batch-rename attached iOS devices according to UUID to name mappings | |
# in a CSV file. | |
# | |
# Usage: rename_devices.py <csvfile> | |
# | |
# | |
# The CSV file should be comma-separated and contain at least the 'udid' and 'name' | |
# fields. Such a CSV can be exported from Configurator. Any additional field will simply |
NewerOlder