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
dreness / cc_southpark.py
Last active Nov 13, 2019
cc_southpark.py uses #BeautifulSoup to produce a list of links to #SouthPark episodes
View cc_southpark.py
#!/usr/bin/env python3
import json
from beautifulscraper import BeautifulScraper
from pprint import pprint as pp
URL = "http://southpark.cc.com/feeds/carousel/video/08f60a6f-24a8-4d88-88a3-eb5588494cbc/30/1/json/views/season-"
# a sample item:
'''
@dreness
dreness / extract_certs_from_pkg.py
Created Nov 2, 2019
Extract x509 certificates found in xar table of contents
View extract_certs_from_pkg.py
#!/usr/bin/env python3
from xml.etree import ElementTree as ET
from os.path import abspath
from os import getenv
import subprocess
import textwrap
import zlib
import sys
@dreness
dreness / show_tcc_entries.sh
Created Oct 23, 2019
Show recent #TCC entries
View show_tcc_entries.sh
#!/bin/sh
# ** NOTE: probably requires that SIP is disabled **
# To show all entries, remove "limit 10" from the queries.
echo "Recent user TCC entries:"
sqlite3 -line ~/Library/Application\ Support/com.apple.TCC/TCC.db "SELECT service, client, allowed, prompt_count, Datetime(last_modified, 'unixepoch') as modified FROM access order by modified desc limit 10;"
echo "\n-----------------------------------------\n"
@dreness
dreness / recent_notifications.sh
Created Oct 22, 2019
Display 10 most recent notification center #notifications
View recent_notifications.sh
sqlite3 -line "$(getconf DARWIN_USER_DIR)/com.apple.notificationcenter/db2/db" "SELECT Datetime(delivered_date + 978328800, 'unixepoch', 'localtime') as delivered_at,
app.identifier,
record.presented,
record.style
FROM record
JOIN app
ON app.app_id = record.app_id
ORDER BY delivered_at DESC limit 10;"
@dreness
dreness / tickref.opy
Last active Oct 14, 2019
Displays overwatch instance stats: ticks dropped, ticks counted, ticks expected
View tickref.opy
#!define TICKS A
#!define COUNTING B
#!define NOW C
#!define STARTLAG D
#!define DROPPED E
#!define EXPECTED F
@Rule "fast assemble"
@Event global
if isAssemblingHeroes():
@dreness
dreness / heredoc-examples.md
Created Oct 8, 2019
Shell heredocs and related nestings
View heredoc-examples.md

Zsh: Heredoc inside a command substitution

note the helpful indenting in the prompt

zsh% A=$(
cmdsubst> cat <<EOF
cmdsubst heredoc> boep boewp
cmdsubst heredoc> dootles
cmdsubst heredoc> EOF
@dreness
dreness / VLCxcallbacker.py
Last active Sep 28, 2019
VLCxcallbacker: generate and host a web page of vlc-x-callback links to every video file in a given directory (for #VLC clients on iOS)
View VLCxcallbacker.py
# -*- coding: utf-8 -*-
from __future__ import print_function, unicode_literals
import os
import socket
from datetime import datetime
from urllib import parse
from klein import Klein
from twisted.web.static import File
from twisted.python.filepath import FilePath
@dreness
dreness / attachments-for-buddy.sql
Last active Sep 24, 2019
List all #iMessage attachments associated with a given buddy
View attachments-for-buddy.sql
-- sqlite3 ~/Library/Messages/chat.db < attachments-for-buddy.sql
-- dates in the DB are NSDate. NSDate.h says: NSTimeIntervalSince1970 978328800
-- To list attachments for a specific buddy, put their handle in the 'where' clause at the end.
SELECT Datetime(created_date + 978328800, 'unixepoch', 'localtime'),
mime_type,
total_bytes,
filename
FROM attachment
@dreness
dreness / LSFileInfo example
Last active Sep 24, 2019
Interrogate LaunchServices using #PyObjC to query file paths for default app handler, all possible app handlers, and the UTI
View LSFileInfo example
xomg% python LSFileInfo.py dylib-map.sqlite
('\n', u'/Users/andre/bin/dylib-map.sqlite')
('UTI: ', u'dyn.ah62d4rv4ge81g6pqrf4gn')
('default app: ', file:///Applications/DB%20Browser%20for%20SQLite.app/)
('all apps: ', (
"file:///Applications/DB%20Browser%20for%20SQLite.app/"
))
@dreness
dreness / mkbarcodes.py
Last active Sep 24, 2019
make a video of a bunch of generated barcodes using #ffmpeg
View mkbarcodes.py
#!/usr/bin/env python3
# make some barcodes, then use ffmpeg to make a video from the individual frames,
# to see how fast FirebaseML can recognize barcodes through the camera.
# https://github.com/azamsharp/FirebaseML.git
# barcode types
# code128 code39 ean ean13 ean14 ean8 gs1
# gtin isbn isbn10 isbn13 issn itf jan pzn upc upca
You can’t perform that action at this time.