Skip to content

Instantly share code, notes, and snippets.

@yanik-ai
yanik-ai / Protocol.txt
Created February 17, 2016 13:52 — forked from ripper234/Protocol.txt
How to decode messages stored in the Bitcoin blockchain with btcmsg
BTCmsg Protocol v1 (2011-09-18)
===============================
Each message is represented by multiple payment which is calculated by
the following algorithm:
1. Two first chars for message type ('01' for md5, '02' for ascii).
2. Then the message in hex (python binascii.hexlify).
3. Split the long string to groups of 4 hex digits.
4. Each group of 4 hex (e.g. 2 ascii letters from the message) is
represented by a payment in satoshi (maximum 0xffff=65535).
@yanik-ai
yanik-ai / fix os x
Created January 20, 2016 13:58
Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
eval $(docker-machine env default)
@yanik-ai
yanik-ai / install_python3.sh
Last active September 11, 2015 12:38 — forked from chaosmail/install_python3.sh
Install Python 3.4.3 on Ubuntu
## Common Packages
# ---------------
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install software-properties-common libssl-dev openssl wget
## Install latest Python 3
# -----------------------
PY_VERSION=3.4.3
PY_URL="https://www.python.org/ftp/python/$PY_VERSION/Python-$PY_VERSION.tgz"
[Wed Aug 19 10:44:15 2015] [error] 2015-08-19 10:44:15,444 INFO [ckan.lib.base] /pages render time 0.074 seconds
[Wed Aug 19 10:44:15 2015] [error] 2015-08-19 10:44:15,519 INFO [ckan.lib.base] /api/i18n/en render time 0.001 seconds
[Wed Aug 19 10:44:17 2015] [error] [client 127.0.0.1] Error - <type 'exceptions.UnboundLocalError'>: local variable 'lxml' referenced before assignment
[Wed Aug 19 10:44:17 2015] [error] [client 127.0.0.1] URL: http://localhost/pages/ololo
[Wed Aug 19 10:44:17 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/weberror/errormiddleware.py', line 162 in __call__
[Wed Aug 19 10:44:17 2015] [error] [client 127.0.0.1] app_iter = self.application(environ, sr_checker)
[Wed Aug 19 10:44:17 2015] [error] [client 127.0.0.1] File '/usr/lib/ckan/default/lib/python2.7/site-packages/webob/dec.py', line 147 in __call__
[Wed Aug 19 10:44:17 2015] [error] [client 127.0.0.1] resp = self.call_func(req, *args, **self.kwargs)
[Wed Aug 19 10:44:17 2015] [err
8701.9208984375,
8001.811217727662,
7579.575804595947,
7852.544248886108,
7412.933835754395,
7619.973080825806,
7115.814327850341,
6290.871151046753,
6080.863765258789,
5832.461726150512,
# allow compare datetime.datetime and datetime.date types
def by_date_and_datetime(x):
if isinstance(x.date, datetime.datetime):
return x.date.date()
else:
return x.date
return sorted(profit_transactions + done_transactions,
key=by_date_and_datetime, reverse=True)