Skip to content

Instantly share code, notes, and snippets.

@kanzure
kanzure / wei-dai-snooper.py
Created November 24, 2014 01:17
just snooping around the blockchain, don't mind me
from bitcoin.core import (
lx,
b2lx,
CTransaction,
)
import bitcoin.rpc
proxy = bitcoin.rpc.Proxy()
@kanzure
kanzure / strace.log.txt
Created November 3, 2014 22:10
zotero translation server log
[pid 2710] munmap(0xf76d9000, 4096) = 0
[pid 2710] gettimeofday({1415052462, 101172}, NULL) = 0
[pid 2710] write(1, "zotero(3)(+0000000): HTTP server"..., 54zotero(3)(+0000000): HTTP server listening on *:1969
) = 54
[pid 2710] gettimeofday({1415052462, 101468}, NULL) = 0
[pid 2710] gettimeofday({1415052462, 101526}, NULL) = 0
[pid 2710] gettimeofday({1415052462, 101615}, NULL) = 0
[pid 2710] gettimeofday({1415052462, 101671}, NULL) = 0
[pid 2710] gettimeofday({1415052462, 101738}, NULL) = 0
@kanzure
kanzure / log.txt
Created November 3, 2014 22:03
new zotero translators since last update
create mode 100644 Bundesgesetzblatt.js
create mode 100644 CCfr (BnF).js
create mode 100644 CSV.js
delete mode 100644 CanLII (English).js
create mode 100644 CanLII.js
create mode 100644 DAI-Zenon.js
create mode 100644 Eastview.js
create mode 100644 Hispanic-American Periodical Index (Beta).js
create mode 100644 National Library of Belarus.js
create mode 100644 OhioLINK.js
@kanzure
kanzure / gumroadserver.py
Last active October 25, 2020 11:56
gumroad oauth debugger
"""
Simple HTTP server to authenticate with gumroad. This is useful for getting
a permanent auth token even if your application isn't a web app. Just use the
auth token when making requests in the future.
Start the process by visiting:
https://gumroad.com/oauth/authorize?client_id=CLIENT_ID&redirect_uri=http://YOURSERVER:7980/callback&scope=edit_products
"""
@kanzure
kanzure / ezproxyportal.py
Created August 24, 2014 19:39
http server to fetch content through ezproxy servers
from flask import (
Flask,
request,
)
app = Flask(__name__)
@app.route("/plsget")
def plsget():
data = request.get_json(force=True)
@kanzure
kanzure / log
Created August 15, 2014 23:20
bitcoind rpc port response
root@d7dcfd34bd4a:~# telnet 172.17.1.250 8332
Trying 172.17.1.250...
Connected to 172.17.1.250.
Escape character is '^]'.
HTTP/1.1 403 Forbidden
Date: Fri, 15 Aug 2014 23:19:05 +0000
Connection: close
Content-Length: 0
Content-Type: application/json
Server: bitcoin-json-rpc/v0.9.2.1-g354c0f3-beta
@kanzure
kanzure / haproxy.log
Created August 8, 2014 06:26
haproxy log madness
00000219:httpstuff.accept(0005)=0438 from [172.17.0.155:55870]
00000219:httpstuff.clireq[0438:ffffffff]: GET / HTTP/1.1
00000219:httpstuff.clihdr[0438:ffffffff]: User-Agent: curl/7.35.0
00000219:httpstuff.clihdr[0438:ffffffff]: Host: localhost:9304
00000219:httpstuff.clihdr[0438:ffffffff]: Accept: */*
0000021a:httpstuff.accept(0005)=043a from [172.17.0.155:55871]
00000219:httpstuff.clireq[043a:ffffffff]: GET / HTTP/1.1
00000219:httpstuff.clihdr[043a:ffffffff]: User-Agent: curl/7.35.0
00000219:httpstuff.clihdr[043a:ffffffff]: Host: localhost:9304
00000219:httpstuff.clihdr[043a:ffffffff]: Accept: */*
@kanzure
kanzure / btctx.py
Last active August 29, 2015 14:04
some bitcoin tx functions from counterparty and counterpartyd
"""
Use python-bitcoinlib to do these things instead of whatever's below.
"""
import binascii
import hashlib
ADDRESSVERSION_MAINNET = b'\x00'
ADDRESSVERSION_TESTNET = b'\x6f'
ADDRESSVERSION = ADDRESSVERSION_MAINNET
@kanzure
kanzure / bitcoin_spray.py
Created May 29, 2014 04:26
Send bitcoin from coinbase.com to a deterministic wallet by "spraying", so as to achieve a better distribution of eggs in baskets or something equally tasty.
"""
Bitcoin spray: distribute BTC from a coinbase.com account into many addresses
generated by a deterministic wallet (an electrum wallet).
1.0 BTC ->
0.01 BTC
0.01 BTC
0.01 BTC
etc..
@kanzure
kanzure / dumplogs.py
Created April 15, 2014 18:56
dump IRC logs from some mysql table
"""
Dump IRC logs from MySQL to stdout.
"""
import sys
channel = sys.argv[-1]
filename = channel.split("#")[-1] + ".log"
password = raw_input("root pw: ")
from sqlalchemy import create_engine