Skip to content

Instantly share code, notes, and snippets.

View gubatron's full-sized avatar

Angel Leon gubatron

View GitHub Profile
gubatron / gist:8890923
Last active August 29, 2015 13:56
replacing copyright headers on files changed in 2014 #quickNDirty
Run this script inside of src/ and it will look for all the files
that were changed this year that still have the last year in the
copyright headers, and it will fix the headers on that file using
a perl regex one liner.
For example: if it finds something like this and we're in 2014
// Copyright (c) 2009-2013 The Bitcoin developers

A pseudonymous trust system for a decentralized anonymous marketplace

Dionysis Zindros, National Technical University of Athens


pseudonymous anonymous web-of-trust identity trust bitcoin namecoin proof-of-burn timelock decentralized anonymous marketplace openbazaar


gubatron / gist:24c798a38360e6127f77
Created August 17, 2014 01:52
Testing the cost of invoking ioloop.instance()
#My theory is that if ioloop.instance() is to be called for every request the websocket might receive
#this is costly as the instance() method has a dictionary lookup in there.
#Plus there's also the cost of allocating memory for the stack of the instance() method and then returning back to
#the method which invokes it, vs just keeping the reference once and reusing it.
#So here's some test code
import cProfile
from zmq.eventloop import ioloop
gubatron / gist:be0a21a7d5b80825799b
Last active August 29, 2015 14:05
Understanding OpenBazaar p2p networking
@hoffmabc i hope you have the patience to read this, at least it'll be a nice trip back
through the code, a refresher, or perhaps you can clear any missunderstandings I have
made as I read the p2p code.
I see the following chain of events:
from the Genesis, start_node() ( may or may not have a list of peers to
boostrap the p2p connections, when it creates MarketApplication (still in,
which is the one listening.
gubatron / custom torrent creation notes
Last active August 29, 2015 14:05
Notes on FrostWire+Azureus aditional info properties.
Classes to look at when porting this to frostwire-jlibtorrent:
TorrentInfoManipulator - goes to TOTOrrentImpl and temporarily makes the field "additional_info_properties" accesible, and creates a reference to it that can be used from FrostWire's code base.
Azureus uses this "additional_info_properties" Map, at the end of torrent bencoding serialization and whatever is in it gets added to the info map.
With TorrentInfoManipulator we can add whatever we want to a torrent's info map.
CreateTorrentDialog: here is where it all ties up, after all the data has been gathered from the different complex ui tabs, this uses TorrentInfoManipulator to add the new properties.
gubatron / gist:795fab0dab8e2d0bf87e
Last active August 29, 2015 14:05
Thank you FrostWire Donors!
A million thanks to our donors, we really appreciate it!
Thanks to your support we've been able to do a lot of work, specially on android, your donations have
gone towards more hardware for testing, if you haven't upgraded we strongly suggest you do, here
are some of the fixes for Android:
FrostWire 1.3.4, 1.3.5, 1.3.6 - AUGUST/12/2014
- Improved cloud search results.
gubatron /
Last active August 29, 2015 14:06
[OpenBazaar] Networking Core Refactor Notes

Networking/P2P code reorganization/refactor notes.

  • All Peer Connection related classes will go to a module called 'connection'
  • All Transport related classes will go to a module called 'transport'
  • Bye bye and, hello and
  • All static functions found on these classes that are not core to what they do but to utilitarian tasks that can be reused by other classes will be moved out of these classes and into utility modules (, for example, cryptographic key handling functions don't belong on transport classes if they don't have any mention of self._properties in them, other classes can reuse, reducing the possibility of having a bug in multiple places.
  • was unused, there was only an exception class (TimeoutError) that was moved to the routingtable module.
  • major import cleanup. only importing the necessary, no unused imports.


gubatron /
Last active August 29, 2015 14:06
Help building libtorrent python bindings on MacOSX

Just compiled libtorrent 1.0.2 for development purposes.

$ ./configure --enable-tests --enable-examples --enable-python-binding --enable-debug

$ make

$ sudo make install

python bindings are there, but when I try to import libtorrent or run the, I get the following error:

gubatron /
Created September 12, 2014 20:53
configure libtorrent (macosx)
export CC=clang
export CXX=clang
export CXXFLAGS=-O3
./configure \
--enable-shared \
--enable-static \
--enable-debug \
--enable-tests \
gubatron / gist:f63fc586ee1b644e75c3
Created September 24, 2014 02:20
fetch gravatars and to be used when making gource video
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
my $size = 90;