Terminology for reasoning about consistency and availability trade-offs in distributed data systems.
Proposed by Martin Kleppmann in A Critique of the CAP Theorem.
import ( | |
"bufio" | |
"errors" | |
"strings" | |
"time" | |
) | |
// Readln reads and returns a single line (sentinal: \n) from stdin. | |
// If a given timeout has passed, an error is returned. | |
// This functionality is similar to GNU's `read -e -p [s] -t [num] [name]` |
❯ ll | |
total 937M | |
-rw-r--r-- 1 uwe staff 8.8K Nov 20 23:38 CoreOS_Image_Signing_Key.asc | |
-rw-r--r-- 1 uwe staff 332 Nov 23 22:55 Dockerfile | |
-rw-r--r-- 1 uwe staff 3.7K Nov 23 22:35 Makefile | |
-rw-r--r-- 1 uwe staff 3.3K Nov 20 23:19 README.md | |
-rwxr-xr-x 1 uwe staff 2.1K Nov 23 23:05 build_ova.sh | |
-rwxr-xr-x 1 uwe staff 433 Nov 20 23:36 build_pdftables.com-ee.sh | |
-rw-r--r-- 1 uwe staff 496M Nov 23 22:30 coreos_production_vmware_image.vmdk | |
-rw-r--r-- 1 uwe staff 543 Nov 23 22:30 coreos_production_vmware_image.vmdk.bz2.sig |
Terminology for reasoning about consistency and availability trade-offs in distributed data systems.
Proposed by Martin Kleppmann in A Critique of the CAP Theorem.
#!/usr/bin/env python3 | |
import csv | |
import sys | |
def main(args): | |
if not args: | |
return 'Usage: goodreads-export FILE' |
#!/usr/bin/env python3 | |
import os | |
import plistlib | |
import sys | |
from datetime import datetime | |
def main(args): | |
books_path = '~/Library/Containers/com.apple.BKAgentService/Data/Documents/iBooks/Books/Books.plist' |
var gUnreadMails = new Set() | |
setInterval(checkUnread, 3000) | |
function checkUnread() { | |
updateBadge() | |
notify() | |
} | |
function updateBadge() { |
#!/bin/sh | |
PROFILE=Default | |
strings $HOME/Library/Application\ Support/Google/Chrome/$PROFILE/Current\ Session | sort | uniq | grep ^http |
#!/bin/sh -e | |
if [ "$#" -ne 2 ] ; then | |
echo "Usage: compact-vmdk <VM_NAME> <IMAGE_PATH>" | |
echo | |
echo "Compacts VMDK images by converting it temporarily to a VDI image, compacting it," | |
echo "and then converting it back." | |
echo | |
echo "Example:" | |
echo |
#!/bin/sh -e | |
cmd=connect | |
name=$(scutil --nc list | sed -n 's/^* \+.\+\? \+.\+\? \+IPSec \+"\(.\+\?\)" \+\[IPSec\]/\1/p') | |
password= | |
secret= | |
token= | |
_usage() { | |
echo "Usage: $(basename $0) <command> [-n name] [-p pass] [-s secret] [-t token] [-h]" |
#!/usr/bin/env python | |
import base64,hashlib,hmac,struct,time,sys | |
if not len(sys.argv[1:]): sys.exit('usage: totp <secret>') | |
digest = hmac.new(base64.b32decode(sys.argv[1]), struct.pack('>Q', int(time.time()) // 30), hashlib.sha1).digest() | |
offset = ord(digest[19]) & 15 | |
print '06d' % (struct.unpack('>I', digest[offset:offset+4])[0] & 0x7fffffff % 1000000) |