Skip to content

Instantly share code, notes, and snippets.

View sweenzor's full-sized avatar

Matt Sweeney sweenzor

View GitHub Profile
@sweenzor
sweenzor / apple-notes-metadata.py
Created January 25, 2021 17:40
Extract created at and modified at dates from Apple Notes
import time
import datetime
import sqlite3
import json
# Based on https://github.com/ydkhatri/mac_apt/blob/master/plugins/notes.py
query = """
SELECT
n.ZNOTE as id,
c1.ZTITLE1 as title,
@sweenzor
sweenzor / s3etag.py
Created November 25, 2020 17:19
Calculating the S3 ETag for a local file
#!/usr/bin/env python3.6
import os
import sys
from hashlib import md5
from argparse import ArgumentParser
parser = ArgumentParser(description='Compare an S3 etag to a local file')
parser.add_argument('inputfile', help='The local file')
parser.add_argument('etag', help='The etag from s3')
@sweenzor
sweenzor / Info.plist
Created May 16, 2018 04:23
MacBookPro14,2 Bootcamp Assistant Unaltered Info.plist
<?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>32BitSupportedModels</key>
<array>
<string>MacBook7,1</string>
<string>MacBookAir5,2</string>
<string>MacBookPro10,1</string>
<string>MacPro5,1</string>
@sweenzor
sweenzor / md5walk.php
Created August 3, 2015 08:09
Walk directory and find md5 hashes
<?php
function md5sum($filenm)
{
$val = md5_file($filenm);
echo $filenm.":".$val."<br/>"."\n";
}
//read folder
@sweenzor
sweenzor / keybase.md
Created July 15, 2015 20:16
Keybase Verification

Keybase proof

I hereby claim:

  • I am sweenzor on github.
  • I am sweeney (https://keybase.io/sweeney) on keybase.
  • I have a public key whose fingerprint is 621C AD2A 3DF2 14B8 A97D 5B63 6399 783C 349C 36D4

To claim this, I am signing this object:

@sweenzor
sweenzor / tangle.sh
Created October 17, 2014 20:25
Kindle eink art example
#!/bin/sh
######################################
## tangle - triangle fun for the K3 ##
## version 1.0 by geekmaster ##
##----------------------------------##
## WARNING: K3 eips '' very slow... ##
## so use eips only in OUTER loops! ##
######################################
#=================================
@sweenzor
sweenzor / shapely-demo.ipynb
Last active January 19, 2022 14:45
Shapely ipython notebook example
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import random
import signal
import gevent
import redis
REDIS_URL = 'redis://127.0.0.1:6379'
REDIS_CHANNEL = 'pubsub_demo'
@sweenzor
sweenzor / auditlog.gs
Created December 24, 2013 07:10
Gmail inbox audit logging
/**
* Retrieves all inbox threads and tags them
* that way, when you accidentally archive something,
* you can figure out what it was!
* https://script.google.com/macros/
*/
function auditLogInbox() {
var threads = GmailApp.getInboxThreads();
var label = GmailApp.getUserLabelByName("auditlog");
label.addToThreads(threads);
@sweenzor
sweenzor / gist:7654326
Created November 26, 2013 06:46
Find all git controlled directories and list their remotes
find ~ -name .git | xargs -I % git --git-dir=% remote -v