Skip to content

Instantly share code, notes, and snippets.

git bisect start
# bad: [440b9e2245740af0168cf27c1af6bc681bbe5754] src: node.cc use isolate->ThrowException
git bisect bad 440b9e2245740af0168cf27c1af6bc681bbe5754
# good: [b0e5f195dfce3e2b99f5091373d49f6616682596] src: lint lib/net.js
git bisect good b0e5f195dfce3e2b99f5091373d49f6616682596
# bad: [50cee6ecab869bd406a4a8806906c87a51b0b1b2] util: isObject should always return boolean
git bisect bad 50cee6ecab869bd406a4a8806906c87a51b0b1b2
# bad: [24ba9fdec8c4ba0fd367aef4a3f266f69d8655aa] punycode: update to v1.2.3
git bisect bad 24ba9fdec8c4ba0fd367aef4a3f266f69d8655aa
# bad: [4c1bb832afcb2c084e44f693e72bed2fbc12bfae] v8: reapply floating patches
import base64
import binascii
import hashlib
import hmac
import requests
import scrypt
import binascii
def hex2bin(hex):
return binascii.unhexlify(hex)
mkdir -p /vol/bitcoin0/src
cd src
export PRFX=/vol/bitcoin0/usr

# yum it up
sudo yum install boost-devel.x86_64 protobuf-devel

# download bitcoin source
@maxtaco
maxtaco / postal.iced
Created July 20, 2014 01:26
Adapter to use jQuery's ajax with IcedCoffeeScript
#-----------------------------------
# Like postal, but returns like request() on node.
$.postal = ({ url, params, dataType, ok_http_status_codes, ok_json_status_codes, ok_empty_body}, cb) ->
headers = {}
if (t = window.csrf_token)? and t.length
headers["X-CSRF-Token"] = t
ok_http_status_codes or= [ 200 ]
ok_json_status_codes or= [ 'OK' ]
@maxtaco
maxtaco / p3skb.iced
Created August 5, 2014 12:43
How to decode and decrypt P3SKB format into Standard PGP blocks
{unpack,pack} = require 'purepack'
{createHash} = require 'crypto'
{decrypt} = require 'triplesec'
assert = require 'assert'
{encode} = require('pgp-utils').armor
key = """hKRib2R5gqRwcml2gqRkYXRhxRgEHJTX3gAAAAOsc5gaUOoq7pdC2Co5YVQXH49bzq2YEAxmjlmGDysfrRbToJD41vpfCsWh1MC0fxV/+LopyzZqssbCuCiDOG5ZZqCHxqYZdTRZFD0WW1CQAOeiu8W7AOKSnaTaPKtrCxw01wpQqO0BXuFK+D91taE4voFQOdlQeynLut1YZvgYsW6DXln5zDECrxy2MZNYP8CqaTRVfr1WTXeloBsF+8sMx/6soVfmTSa+R66c/CZO0tLB5vfGTlfI5wWM+18umjp+0CNXVvTPOCcCmqVinoKGZoi/VqWgokK4Ku4WRRbfwlQVUi5CZFa/FEqJd2AWiUYWdP+X1In6uNG70jSO+PXaYBYBlEMuEbS8cq/3CWe4T/wP3ktYE8aZg1VKO6+jUbrAehK+EBzKe8OMFu+JOhN0XYepO9BzAs1DmHb7/23mzf/sgDyqRQQXOUcIFA3STULaJnXyHSamOh21hBTOVfBU/vSSCIjX8WIKxWBuRPEgMZ7X4INH3LF79RiTaxTHdorIxuc9g2bklSvF4pbiva2NqbPPtUwWKMbjff+Vp3fKCFxGhUqqXXjy2aippsvDn43+WJ93rsgE1DpLGc0tghZejmwUFopyJ1n23JIKqKArjSpOAJBM5wv1u0qV94uBNPP1pHGEvdukz3NNL11rwHRyoHY7ShdF//uwjI0Xqo7u2FvMatXUNWgcx2URWQpft6PfbGLvyjXdO893dhWn5Ig7Ee3Dg2wvSHfHWXU6V0BdrFv0rMZva9b4ecZsNd+61QHGkCw8Ga6yG0wqp+9Qe/zDlUQkV+/gKocoU6VEoUL9xw8
@maxtaco
maxtaco / kbRPC.coffee
Last active September 4, 2015 00:55
KB wrapper w/ session awareness on top of regular RPC
##
## Extremely rough & hacky pseudocode, but I guarantee we can get something
## like this to work. I believe this is the interface you wanted, but
## we can easily implement it on top of the interface we have.
##
class KbClient extends Client
# construct with a KbTransport below....
@maxtaco
maxtaco / p3skb.iced
Last active September 8, 2015 01:46
Some worked p3skb examples
{KeyManager} = require 'kbpgp'
{make_esc} = require 'iced-error'
passphrase = "foxtrot bananas"
main = (cb) ->
esc = make_esc cb
# generate, sign and lock...
@maxtaco
maxtaco / foo.avdl
Last active October 7, 2015 00:54
New RPC/Go interface idea.
@namespace("foo.1")
protocol bar {
A myfunc(b B, c C);
}
@maxtaco
maxtaco / gist:5080023
Last active December 14, 2015 11:38
Access hashed ssh known_hosts with paramiko.
import os.path
import paramiko
from hashlib import sha1
from hmac import HMAC
class KnownHostsRegistry (object):
"""
Read in the user's SSH known_hosts file, and perform lookups,
on either plaintext hostnames, or those that have been obscured
with known_hosts hashing (see here: http://nms.csail.mit.edu/projects/ssh/)
@maxtaco
maxtaco / gist:5207740
Last active December 15, 2015 05:19
A simple DB backup script that keeps weeklies, monthlies, and yearlies, and ages.
#!/bin/sh
#
# A very simple database backup and rotation script, in four stages:
#
# 1. dump
# 2. compress
# 3. link
# 4. age
#