Skip to content

Instantly share code, notes, and snippets.

@kanzure
kanzure / pip.error.log
Created March 4, 2014 22:35
stormpath-sdk is doing weird things?
View pip.error.log
Downloading/unpacking unittest2py3k (from stormpath-sdk->-r ./requirements/requirements.txt (line 40))
Running setup.py egg_info for package unittest2py3k
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/tmp/pip_build_root/unittest2py3k/setup.py", line 12, in <module>
from unittest2 import __version__ as VERSION
File "unittest2/__init__.py", line 61, in <module>
from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf,
File "unittest2/case.py", line 539
def assertAlmostEqual(self, first, second, *, places=None, msg=None,
@kanzure
kanzure / coercion.py
Created March 13, 2014 21:26
sqlalchemy type coercion
View coercion.py
"""
Type coercion for sqlalchemy prior to committing to some database.
http://stackoverflow.com/questions/8980735/how-can-i-verify-column-data-types-in-the-sqlalchemy-orm
"""
from sqlalchemy import (
Column,
Integer,
String,
@kanzure
kanzure / dumplogs.py
Created April 15, 2014 18:56
dump IRC logs from some mysql table
View dumplogs.py
"""
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
@kanzure
kanzure / btctx.py
Last active August 29, 2015 14:04
some bitcoin tx functions from counterparty and counterpartyd
View btctx.py
"""
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 / haproxy.log
Created August 8, 2014 06:26
haproxy log madness
View haproxy.log
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 / log
Created August 15, 2014 23:20
bitcoind rpc port response
View log
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 / ezproxyportal.py
Created August 24, 2014 19:39
http server to fetch content through ezproxy servers
View ezproxyportal.py
from flask import (
Flask,
request,
)
app = Flask(__name__)
@app.route("/plsget")
def plsget():
data = request.get_json(force=True)
@kanzure
kanzure / log.txt
Created November 3, 2014 22:03
new zotero translators since last update
View log.txt
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 / strace.log.txt
Created November 3, 2014 22:10
zotero translation server log
View strace.log.txt
[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 / wei-dai-snooper.py
Created November 24, 2014 01:17
just snooping around the blockchain, don't mind me
View wei-dai-snooper.py
from bitcoin.core import (
lx,
b2lx,
CTransaction,
)
import bitcoin.rpc
proxy = bitcoin.rpc.Proxy()