Skip to content

Instantly share code, notes, and snippets.

@jpmens
jpmens / schema.md
Created Mar 24, 2019
Sierra AddressBook schema
View schema.md
echo '.schema' | sqlite3 ~/Library/Application\ Support/AddressBook/AddressBook-v22.abcddb
CREATE TABLE ZABCDCUSTOMPROPERTY ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZVALUETYPE INTEGER, ZRECORDTYPE VARCHAR, ZPROPERTYNAME VARCHAR );
CREATE TABLE ZABCDDELETEDRECORDLOG ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZADDRESSBOOKSOURCE INTEGER, ZDELETEDRECORDUNIQUEID VARCHAR, ZUNIQUEID VARCHAR );
CREATE INDEX ZABCDDELETEDRECORDLOG_ZADDRESSBOOKSOURCE_INDEX ON ZABCDDELETEDRECORDLOG (ZADDRESSBOOKSOURCE);
CREATE TABLE ZABCDSERVICE ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZSERVICENAME VARCHAR );
CREATE TABLE ZABCDSHARINGACCESSCONTROLENTRY ( Z_ENT INTEGER, Z_PK INTEGER PRIMARY KEY, Z_OPT INTEGER, ZORDERINGINDEX INTEGER, ZISPRIVATE INTEGER, ZREADACLSOURCE INTEGER, ZOWNER INTEGER, ZREADWRITEACLSOURCE INTEGER, ZISPRIMARY INTEGER, ZLABEL VARCHAR, ZUNIQUEID VARCHAR, ZACCOUNTNAME VARCHAR );
@jpmens
jpmens / gist:7bb668b1e1c59b07f9118a0d599a1383
Created Mar 23, 2019
signature count UK Article 50 petition
View gist:7bb668b1e1c59b07f9118a0d599a1383
Sat Mar 23 17:43:01 UTC 2019
via https://petition.parliament.uk/petitions/241584
signature_count country_name
1 Comoros
1 Djibouti
1 Equatorial Guinea
1 Eritrea
View gist:67a9242ccc9df9364c63d22c3cb7babf
; <<>> DiG 9.11.2 <<>> loremipsum.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 56224
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 5446a4f6a596d0b4528915085c9665641d36ed9a62e429cd (good)
@jpmens
jpmens / github_backup_gists.sh
Last active Mar 23, 2019 — forked from mbohun/github_backup_gists.sh
simple and easy github gist backup
View github_backup_gists.sh
#!/usr/bin/env bash
for url in `./githubapi-get.sh $GIST_TOKEN /gists | jq -r '.[]|.git_pull_url'`
do
git clone ${url};
done
View sponge.c
FILE *open_tmpfile (void) {
struct cs_status cs;
int tmpfd;
FILE *tmpfile;
mode_t mask;
char *tmpdir;
char const * const template="%s/sponge.XXXXXX";
trapsignals();
cs = cs_enter();
View sponge.txt
SPONGE(1) moreutils SPONGE(1)
NAME
sponge - soak up standard input and write to a file
SYNOPSIS
sed '...' file | grep '...' | sponge [-a] file
View gist:41616833360bc29fd7d42375dd2072ae
$ vi
dyld: Library not loaded: /usr/local/opt/ruby/lib/libruby.2.4.1.dylib
Referenced from: /usr/local/bin/vim
Reason: image not found
Abort trap: 6
@jpmens
jpmens / systemd-output.txt
Created Mar 19, 2019
daemon.log for `ssh -l jpm deb96 pwd'
View systemd-output.txt
Mar 19 09:30:56 deb96 systemd[1]: Created slice User Slice of jpm.
Mar 19 09:30:56 deb96 systemd[1]: Started Session 3775 of user jpm.
Mar 19 09:30:56 deb96 systemd[1]: Starting User Manager for UID 1000...
Mar 19 09:30:56 deb96 systemd[27117]: Reached target Timers.
Mar 19 09:30:56 deb96 systemd[27117]: Listening on GnuPG cryptographic agent (ssh-agent emulation).
Mar 19 09:30:56 deb96 systemd[27117]: Listening on GnuPG cryptographic agent and passphrase cache (restricted).
Mar 19 09:30:56 deb96 systemd[27117]: Listening on GnuPG cryptographic agent and passphrase cache.
Mar 19 09:30:56 deb96 systemd[27117]: Listening on GnuPG cryptographic agent (access for web browsers).
Mar 19 09:30:56 deb96 systemd[27117]: Reached target Paths.
Mar 19 09:30:56 deb96 systemd[27117]: Reached target Sockets.
View tsig-keygen.md

old

$ /usr/sbin/dnssec-keygen -a HMAC-SHA512 -b 128 -n HOST example.org
Kexample.org.+165+46294

$ cat Kexample.org.+165+46294.key
example.org. IN KEY 512 3 165 ZKiFXX3Q3Nj7TALud8n0fQ==

# <insert: copy/paste all sorts of stuff>
View acme_dns_tiny.py.patch
--- acme_dns_tiny.py.orig 2019-03-05 20:18:14.000000000 +0100
+++ acme_dns_tiny.py 2019-03-05 14:31:21.000000000 +0100
@@ -264,7 +264,7 @@
raise ValueError("Finalizing order {0} got errors: {1}".format(http_response.status_code, result))
if 'link' in http_response.headers:
- log.info(" - Certificate links given by server: {0}", http_response.headers['link'])
+ log.info(" - Certificate links given by server: {0}".format(http_response.headers['link']))
log.info("Certificate signed and chain received: {0}".format(order["certificate"]))
You can’t perform that action at this time.