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:
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
### Updated to reflect changes introduced with 10.13.4. Update to 10.13.4 if needed before attempting to make | |
SecureToken-related changes. ### | |
sysadminctl is a tool Apple introduced in 10.10 for working with system user accounts. In 10.13, sysadminctl is Apple's | |
recommended tool for working with user accounts in the CLI, replacing functionality that has long been provided by dscl | |
and adds new features available only in 10.13. sysadminctl can be used to change user passwords, create new users or | |
check the status of a new-to-10.13 security feature named SecureToken. | |
SecureToken is a non-visible APFS file system attribute, unlike the SIP protected flag or file creation date, that triggers | |
the creation of a new AuthenticationAuthority entry in a user's local account record |
#!/usr/bin/python | |
""" | |
Completely reset TCC services database in macOS | |
Note: Both the system and individual users have TCC databases; run the script as both | |
a user and as root to completely reset TCC decisions at all levels. | |
2018-08-15: Resetting the 'Location' service fails; unknown cause | |
2018-08-16: Confirmed the 'All' service does not really reset _all_ | |
services, so individual calls to each service is necessary. |
#!/usr/bin/python | |
import os | |
import sys | |
from CoreFoundation import (CFPreferencesAppValueIsForced, | |
CFPreferencesCopyAppValue, | |
CFPreferencesCopyValue, | |
kCFPreferencesAnyUser, | |
kCFPreferencesAnyHost, |
by Bjørn Friese
Beautiful is better than ugly. Explicit is better than implicit.
I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.
from ctypes import CDLL, c_uint, byref, create_string_buffer | |
libc = CDLL('/usr/lib/libc.dylib') | |
def sysctl(name): | |
size = c_uint(0) | |
libc.sysctlbyname(name, None, byref(size), None, 0) | |
buf = create_string_buffer(size.value) | |
libc.sysctlbyname(name, buf, byref(size), None, 0) | |
return buf.value |
#!/usr/bin/python | |
approved_UUIDs = ['your-beacon-UUID-here'] # see line 64 | |
path_to_lock_sound = '/Users/frogor/Desktop/car_lock.m4a' | |
path_to_warn_sound = '/Users/frogor/Desktop/viper_warning.m4a' | |
import time | |
import objc | |
from objc import NO | |
from Foundation import NSBundle, NSClassFromString, NSObject, NSRunLoop, NSDate, NSUUID, NSMakeRange, NSURL | |
from AVFoundation import AVAudioPlayer |
Principles of Adult Behavior