This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gevent | |
from gevent import socket | |
from gevent import monkey | |
monkey.patch_socket() | |
import re, urllib2, httplib, logging | |
from urlparse import urlparse | |
from xml.dom.minidom import parseString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
# No plugin (without getattr 0.056s, with getattr 0.110s) | |
class Request(object): | |
def __init__(self): | |
pass | |
def route(self, req): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<style> | |
.bitcoinbar { | |
width: 150px; margin-top: 5px; display: inline-block; height: 20px; border-radius: 5px; position: relative; | |
font-family: Consolas, Monospace; background-color: #eee; color: black; vertical-align: bottom; text-decoration: none | |
} | |
.bitcoinbar .progress { | |
text-align: center; display: block; position: relative; | |
font-size: 11px; vertical-align: middle; line-height: 22px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plugined_cache = {} | |
plugins = {} | |
def plugined(base_class): | |
class_name = base_class.__name__ | |
if class_name in plugined_cache: | |
PluginedClass = plugined_cache[class_name] | |
else: | |
classes = plugins[class_name]+[base_class] | |
classes.reverse() | |
PluginedClass = type(class_name, tuple(classes), dict()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# key.py - OpenSSL wrapper | |
# Source: git://github.com/joric/brutus.git | |
# which was forked from git://github.com/samrushing/caesure.git | |
# | |
import ctypes | |
import ctypes.util | |
ssl = ctypes.cdll.LoadLibrary (ctypes.util.find_library ('ssl') or 'libeay32') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pybitcointools import bitcoin as btctools | |
import time, hashlib | |
priv = "5JsunC55XGVqFQj5kPGK4MWgTL26jKbnPhjnmchSNPo75XXCwtk" | |
address = "1N2XWu5soeppX2qUjvrf81rpdbShKJrjTr" | |
sign = btctools.ecdsa_sign("hello", priv) | |
import base64 | |
def VerifyMessage(address, hash, sig): | |
sig = base64.b64decode(sig) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
## | |
## @file contrib/verifymessage/python/terracoin_verifymessage.py | |
## @brief terracoin signed message verification sample script. | |
## @author unknown author ; found on pastebin | |
## | |
import ctypes | |
import ctypes.util | |
import hashlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# via http://pastebin.com/H1XikJFd | |
# -*- Mode: Python -*- | |
# This is a combination of http://pastebin.com/bQtdDzHx and | |
# https://github.com/Bitmessage/PyBitmessage/blob/master/src/pyelliptic/openssl.py | |
# that doesn't crash on OSX. | |
import ctypes | |
import ctypes.util | |
import hashlib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Program received signal SIGSEGV, Segmentation fault. | |
0x00007ffff62452eb in BN_bin2bn () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 | |
#0 0x00007ffff62452eb in BN_bin2bn () from /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.0 | |
#1 0x00007ffff484e834 in ffi_call_unix64 () from /usr/lib/python2.7/lib-dynload/_ctypes.so | |
#2 0x00007ffff484e2af in ffi_call () from /usr/lib/python2.7/lib-dynload/_ctypes.so | |
#3 0x00007ffff483bfd1 in _call_function_pointer (argcount=3, resmem=0x7fffffffa8e0, restype=<optimized out>, atypes=<optimized out>, avalues=0x7fffffffa8b0, | |
pProc=0x7ffff62452a0 <BN_bin2bn>, flags=4353) at /home/jmm/py/python2.7-2.7.3/Modules/_ctypes/callproc.c:827 | |
#4 _ctypes_callproc (pProc=pProc@entry=0x7ffff62452a0 <BN_bin2bn>, argtuple=argtuple@entry= | |
("TC\xdb\xc6_(8\x0ct\xdf\xc3i\xb5\xb9e\x03\x9f\x1c'\x07\xc2kg\xb5\x89\x99\xc8\xee\x10\xdc\x15\x1e", 32, -334573824), flags=4353, argtypes=< at remote 0x8d30a0>, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import msgpack | |
import cStringIO as StringIO | |
print "Msgpack Version", msgpack.version | |
print "Testing simple data" | |
data = "A"*10 | |
for i in range(1,20): | |
print "- %skb..." % len(data), | |
print "Packing", |
OlderNewer