Skip to content

Instantly share code, notes, and snippets.

View gubatron's full-sized avatar

Angel Leon gubatron

View GitHub Profile
@gubatron
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() (tornadoloop.py) may or may not have a list of peers to
boostrap the p2p connections, when it creates MarketApplication (still in tornadoloop.py),
which is the one listening.
@gubatron
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
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
gubatron / command_exists.sh
Created September 6, 2014 12:10
check if command exists (linux, mac)
function command_exists {
#this should be a very portable way of checking if something is on the path
#usage: "if command_exists foo; then echo it exists; fi"
type "$1" &> /dev/null
}
@gubatron
gubatron / openbazaar-networking-refactor-notes.md
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 crypto2crypto.py and p2p.py, hello connection.py and transport.py
  • 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 (crypto_util.py), 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.
  • kademlia.py 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.

MIGHT DO's

@gubatron
gubatron / help-libtorrent-python-bindings-macosx.md
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 simple_client.py, I get the following error:

@gubatron
gubatron / configure_libtorrent_macosx.sh
Created September 12, 2014 20:53
configure libtorrent (macosx)
export CC=clang
export CXX=clang
export CFLAGS="-O3 -DTORRENT_USE_IPV6=1"
export CXXFLAGS=-O3
./configure \
--enable-shared \
--enable-static \
--enable-debug \
--enable-tests \
@gubatron
gubatron / gist:f63fc586ee1b644e75c3
Created September 24, 2014 02:20
fetch gravatars and to be used when making gource video
#!/usr/bin/perl
#fetch Gravatars
use strict;
use warnings;
use LWP::Simple;
use Digest::MD5 qw(md5_hex);
my $size = 90;
@gubatron
gubatron / gist:5fb3ec87fbbb4745a6a6
Created September 24, 2014 05:30
gource invocation example
gource -2048x1152 --start-date 2014-08-17 --stop-date 2014-09-22 --colour-images --user-image-dir .git/avatar/
@gubatron
gubatron / frostwire-5.7.7-macosx-releasecandidate.md
Created October 2, 2014 01:50
FrostWire 5.7.7 release candidate for MacOSX

Download FrostWire 5.7.7 for Mac OSX now, give it a spin, lots of bug fixes and updates. http://dl.frostwire.com/frostwire/5.7.7/frostwire-5.7.7.dmg

frostwire (5.7.7) stable; urgency=high
  * New: VPN connection status indicator.
  * New: Stop media playback by long pressing play/pause button.
  * Fix: Freeze when opening FrostWire from the first time out of
    clicking on a magnet link or .torrent file.
  * Fix: Bug where files couldn't be played with the main player button.