This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
# Skip to the end to see what this can do. | |
# | |
# http://s.sudre.free.fr/Stuff/Ivanhoe/FLAT.html | |
# Flat packages are xar files with a particular structure | |
# We're looking for the PackageInfo file within the xar file | |
import urllib2, ctypes, zlib | |
import xml.etree.ElementTree as ET | |
class SimpleObj(object): |
#!/usr/bin/python | |
# As written, this requires the following: | |
# - OS X 10.6+ (may not work in 10.10, haven't tested) | |
# - python 2.6 or 2.7 (for collections.namedtuple usage, should be fine as default python in 10.6 is 2.6) | |
# - pyObjC (as such, recommended to be used with native OS X python install) | |
# Only tested and confirmed to work against 10.9.5 | |
# Run with root |
class ProgressDialog(object): | |
def __init__(self, message, title, use_bar=True): | |
super(self.__class__, self).__init__() | |
self.message = message | |
self.title = title | |
self.use_bar = use_bar | |
self.queue = None | |
self.process = None | |
def display(self): | |
# [ begin black magic ] |
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': [], |
import objc | |
from Foundation import NSBundle | |
CG_bundle = NSBundle.bundleWithIdentifier_('com.apple.CoreGraphics') | |
functions = [("CGSSessionCopyAllSessionProperties", b"@"),] | |
objc.loadBundleFunctions(CG_bundle, globals(), functions) | |
# example usage: graphical_security_sessions = CGSSessionCopyAllSessionProperties() |
import objc | |
from Foundation import NSBundle | |
login_bundle = NSBundle.bundleWithPath_('/System/Library/PrivateFrameworks/login.framework') | |
functions = [('SACLockScreenImmediate', '@'),] | |
objc.loadBundleFunctions(login_bundle, globals(), functions) | |
# Lock the screen regardless of security settings or who is logged in | |
result = SACLockScreenImmediate() |
# 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") |
#!/usr/bin/python | |
import xml.etree.ElementTree as ET | |
import requests | |
import uuid | |
params = {'cup2hreq': 'foo', 'cup2key': 'bar'} | |
platform = 'mac' | |
os_version = '10.12' |