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 | |
# | |
# Very quick and dirty script to make an unserialized, customized | |
# Acrobat Pro DC installer via the customization wizard, but | |
# in an automated fashion. | |
# This does the equivalent of the following in the wizard: | |
# - Accept EULA | |
# - Disable PDF Rendering in browsers | |
# - Enable Feature Lockdown (supplies a plist that disables the updater | |
# for 10/11/2015/DC) |
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 struct, objc | |
from Foundation import NSBundle | |
from Cocoa import NSAppleEventDescriptor | |
def OSType(s): | |
# Convert 4 character code into 4 byte integer | |
return struct.unpack('>I', s)[0] | |
# Create an opaque pointer type to mask the raw AEDesc pointers we'll throw around | |
AEDescRef = objc.createOpaquePointerType('AEDescRef', '^{AEDesc=I^^{OpaqueAEDataStorageType}}') |
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-msg=e1101,e0611 | |
import time | |
import AVFoundation as AVF | |
import Quartz | |
from Foundation import NSObject, NSURL | |
def main(): |
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/env python | |
# | |
# Pass any number of short hostnames to run cmd on all | |
# hosts in parallel and display the results nicely. | |
import sys | |
import subprocess | |
import multiprocessing | |
PROCESSES = 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
import os.path | |
from Foundation import NSData, NSKeyedUnarchiver, SFLListItem, NSURL, NSMutableDictionary, NSKeyedArchiver, NSString, NSDictionary, NSArray | |
def load_favservers(sfl_path): | |
if os.path.isfile(sfl_path): | |
# File exists, use it | |
sfl_decoded = NSKeyedUnarchiver.unarchiveObjectWithData_(NSData.dataWithContentsOfFile_(sfl_path)) | |
else: | |
# File doesn't exist, make a blank template | |
sfl_decoded = {u'items': [], |
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
<?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>itadmn</string> | |
<key>creation_date</key> | |
<date>2016-01-15T14:29:44Z</date> |
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
# Note: This _will_ GUI prompt a user for permission to locate them via python, even if run as root | |
from CoreLocation import CLLocationManager, kCLDistanceFilterNone, kCLLocationAccuracyThreeKilometers | |
from Foundation import NSRunLoop, NSDate, NSObject | |
is_enabled = CLLocationManager.locationServicesEnabled() | |
is_authorized = CLLocationManager.authorizationStatus() | |
class MyLocationManagerDelegate(NSObject): | |
def init(self): |
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/env python | |
import Cocoa | |
import sys | |
Cocoa.NSWorkspace.sharedWorkspace().setIcon_forFile_options_(Cocoa.NSImage.alloc().initWithContentsOfFile_(sys.argv[1].decode('utf-8')), sys.argv[2].decode('utf-8'), 0) or sys.exit("Unable to set file icon") |
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 objc | |
# Set up opaque types for undefined signatures so we don't have | |
# to deal with "PyObjCPointer created:" errors | |
ODNode = objc.createOpaquePointerType("ODNode", b"^{_ODNode=}", None) | |
ODRecord = objc.createOpaquePointerType("ODRecord", b"^{_ODRecord=}", None) | |
from OpenDirectory import ODNodeCreateWithNodeType, ODNodeCopyRecord, ODRecordVerifyPassword, kODNodeTypeAuthentication, kODRecordTypeUsers | |
directory_service, err = ODNodeCreateWithNodeType(None, None, kODNodeTypeAuthentication, None) |