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 | |
# Scenario: | |
# - you have a local checkout of a github repo | |
# - you're looking at public forks of that repo | |
# - you want to add a remote to your local checkout for one of the forks | |
set -e | |
set PIPEFAIL |
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
#!python -u | |
import re | |
from datetime import datetime | |
import click | |
import subprocess | |
import json | |
""" | |
NOTE: this requires a log config profile that enables 'private data' logging. |
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
use scripting additions | |
use framework "Foundation" | |
tell application "Finder" | |
-- path to frontmost Finder window | |
set windowPath to POSIX path of (target of front window as alias) | |
-- selected items in Finder, if any | |
set itemlist to selection as alias list | |
if length of itemlist > 0 then | |
repeat with i from 1 to length of itemlist |
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 parselmouth | |
# import IPython | |
import os | |
import sys | |
import pandas as pd | |
# Feed me audio files as command line arguments | |
# uncomment this to stop pandas from being so coy in its repr()s | |
# pd.set_option("display.max_rows", None, "display.max_columns", None) |
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 http.server | |
import socketserver | |
import random | |
import os | |
import uuid | |
from http import HTTPStatus | |
''' | |
I wanted a quick way to spawn a bunch of Safari tabs with distinct favicons, so made a little webserver | |
to rotate through some PNGs. A substantially smaller program was sufficient for Chrome, which does what |
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
find /System/Library/LaunchDaemons /System/Library/LaunchAgents -name "*.plist" \ | |
| while read p ; do plutil -convert json -o - ${p} \ | |
| jq -r ' .. | objects | with_entries(select(.key == "Notification")) | select(. != {}).Notification' | |
done | sort -u > ~/Desktop/all-launchd-notifications.txt |
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>PayloadContent</key> | |
<array> | |
<dict> | |
<key>PayloadDisplayName</key> | |
<string>ManagedClient logging</string> | |
<key>PayloadEnabled</key> |
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
#!python | |
# To use this, you need Python 3 and also the pyobjc module. | |
# pip install pyobjc | |
import objc | |
from Foundation import NSBundle, NSString | |
import datetime | |
import time | |
import sys |
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
#!python3 | |
import re | |
import fileinput | |
import sys | |
import csv | |
# 2022-10-31 01:57:27 -0700 Wake Requests [*process=mDNSResponder request=Maintenance deltaSecs=7198 wakeAt=2022-10-31 03:57:25 info="upkeep wake"] [process=powerd request=TCPKATurnOff deltaSecs=316637 wakeAt=2022-11-03 17:54:44] [process=powerd request=UserWake deltaSecs=7850 wakeAt=2022-10-31 04:08:17 info="com.apple.alarm.user-visible-com.apple.CalendarNotification.EKTravelEngine.periodicRefreshTimer,14054"] | |
# 2024-01-18 18:18:15 -0800 Wake Requests [process=mDNSResponder request=Maintenance deltaSecs=2648 wakeAt=2024-01-18 19:02:23 info="DHCP lease renewal"] [*process=dasd request=SleepService deltaSecs=950 wakeAt=2024-01-18 18:34:05 info="com.apple.dasd:501:com.apple.proactive.ProactiveHarvesting.Harvest.DelayedBudgeted"] [process=powerd request=TCPKATurnOff deltaSecs=316858 wakeAt=2024-01-22 10:19:13] [process=powerd request=CSPNEvaluation deltaSecs=7253 wakeAt=2024-01-18 20:19:08] [process=powerd request=UserWake del |
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/zsh | |
TARGET=$1 | |
# to be used as an egrep pattern | |
SYMS='getprogname|NSGetArgv|NSGetArgc|optarg|optind|getopt|getopt_long' | |
sudo find ${TARGET} -type f -perm +111 \! -name "*.dylib" | \ | |
while read f ; do | |
sudo nm -u ${f} 2> /dev/null | \ |
NewerOlder