Skip to content

Instantly share code, notes, and snippets.

View pierwill's full-sized avatar

pierwill

View GitHub Profile
@pierwill
pierwill / export-all-voice-memos.bash
Created July 14, 2023 15:55
Export all iCloud voice memos
#! /bin/bash
newdir="allvoicememos"
mkdir $newdir
cd $newdir
OIFS=$IFS
IFS='|'
sqlite3 ~/Library/Application\ Support/com.apple.voicememos/Recordings/CloudRecordings.db "SELECT ZPATH, ZCUSTOMLABEL, ZDATE FROM ZCLOUDRECORDING" | while read line; do
thisline=($line)
location=${thisline[0]}
name=${thisline[1]}
@pierwill
pierwill / sysmanpdf
Created January 26, 2020 18:30
sysmanpdf
i=1
while read line; do
# echo $line
man -t 2 $line | ps2pdf - $i-$line.pdf
i=$((i+1))
done < syscall_64-names

Packing

For air travel: conferences, 10-day trips, etc. (Based on https://github.com/b-meson/packing.)

Before you travel

  • Double check: Date, Time (a.m. or p.m.), location of airport
  • Is a passport or visa needed?
  • Is FX (foreign currency) needed?
  • Check travel situation on the ground (light rail, trains, availablity of Uber / Lyft, etc)
#!/usr/bin/env python
# run as a cron job (every 24 hours?)
# the longer you wait, the longer the chain
import tweepy
from secrets import consumer_key, consumer_secret, access_token, access_token_secret
auth = tweepy.OAuthHandler(consumer_key, consumer_secret)
auth.set_access_token(access_token, access_token_secret)
#!/usr/bin/env python
# set to executabable with chmod +x
# and place somewhere in your path
from time import sleep
from sys import argv
from subprocess import Popen
# should match the name of the system preferences window
@pierwill
pierwill / keybase.md
Created February 23, 2018 07:08
keybase.md

Keybase proof

I hereby claim:

  • I am pierwill on github.
  • I am pierwill (https://keybase.io/pierwill) on keybase.
  • I have a public key ASDhHfgf_n8RYwIF2ChU2Cpo7u7YrlpPjH7Tp_PmUtJzUQo

To claim this, I am signing this object:

@pierwill
pierwill / SIPRI-arms-transfer.md
Last active December 11, 2017 13:56 — forked from jsvine/SIPRI-arms-transfer.md
How to download SIPRI arms transfer data as a CSV file instead of a rich-text file.

The Stockholm International Peace Research Institute's Arms Transfers Database provides a tool to download the data. By default, that output is an .rtf rich-text file — not so easy to analyze with your favorite spreadsheet or statistics software. Luckily, getting a CSV of the data isn't very difficult. Here's how.

To get all transfers for 2016, by seller, run this command in your terminal:

curl http://armstrade.sipri.org/armstrade/html/export_trade_register.php --compressed \
    --data 'low_year=2016' \
    --data 'high_year=2016' \
    --data 'seller_country_code=' \
 --data 'buyer_country_code=' \