Skip to content

Instantly share code, notes, and snippets.


Andre LaBranche dreness

Block or report user

Report or block dreness

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
dreness / Uncloned.swift
Created May 1, 2019
Show something mumble mumble APFS cloned files mumble?
View Uncloned.swift
import Cocoa
func unclonedSize(of url: URL) throws -> off_t {
var list = attrlist(bitmapcount: UInt16(ATTR_BIT_MAP_COUNT),
reserved: 0,
commonattr: 0,
volattr: 0,
dirattr: 0,
fileattr: 0,
dreness /
Last active Feb 19, 2019
A script to apply bandwidth limits to specific traffic in OS X using pf and dummynet
# Create a file such as /Users/you/Documents/pftable to hold a list of IPs or subnets to throttle.
# Example file contents:
# Reset dummynet to default config
dnctl -f flush
dreness / mystery_routing.txt
Last active Dec 3, 2018
A routing puzzle for you
View mystery_routing.txt
Question: is there ever a reason to ARP for an IP outside of any local subnets?
Update: I like @bmastenbrook's answer:
# my subnet is a /24, and is totally not on the same /24 as
xomg% netstat -rn -f inet
Routing tables
Destination Gateway Flags Refs Use Netif Expire
default UGScI 3 0 en0
dreness /
Last active May 3, 2018
Graphical and statistical analysis of frame rate in a video
#!/usr/bin/env python
# dre at mac dot com
# Graphical and statistical analysis of frame rate in a video
# Requires ffmpeg and gnuplot
from sys import platform
from subprocess import check_output
from os import path
import json
import argparse
dreness /
Last active Mar 17, 2018
Examine shadowhash data from a DSLocal account record in macOS
if [ -z $1 ]
echo "Requires a username as the first and only argument."
exit 1
readShadowhash() {
dreness /
Created Feb 11, 2018
a few bash techniques for error handling
trap "echo inner ERR" ERR
trap "echo inner EXIT" EXIT
dreness /
Last active Jan 12, 2018
Reveal OverwatchLeague video URLs
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
Work in progress. For now, just show URLs to m3u8 files of match videos.
To use, first do:
pip install -r requirements.txt
TODO: pre-season VODs were split out by game; season1 VODs contain all games in a match
dreness /
Last active Dec 17, 2017
Somebody asked what their second-longest video is :)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import isodate
import time
import math
import json
import sys
import os
from ytdata import YTData
from datetime import datetime
dreness / filesink.rb
Last active Nov 7, 2017
Blather XMPP bot that receives file transfers that are sent using XEP 0096. Not at all complete, but wanted to post something that demonstrates working file transfer, since I couldn't find any.
View filesink.rb
require 'rubygems'
require 'blather/client'
require 'awesome_print'
require 'nokogiri'
require 'pretty-xml'
require 'nokogiri-pretty'
include PrettyXML
# This is a Blather bot that receives file transfers that are sent using
# XEP 0096, using either p2p SOCKS5 (XEP 0065), or through the server
dreness /
Last active Sep 13, 2017 — forked from pudquick/
Automatic symbol definition discovery for OS X binaries and their linked shared libraries
"""Usage: symfind BINARY_PATH SEARCH_STR
symfind automates the usage of otool and nm to attempt to find out which
binary a symbol is defined in that's used within BINARY_PATH's code.
import subprocess, os.path, sys, getopt
You can’t perform that action at this time.