Skip to content

Instantly share code, notes, and snippets.

View david415's full-sized avatar
💭
♥️Ⓐλ😼

David Stainton david415

💭
♥️Ⓐλ😼
View GitHub Profile
@david415
david415 / gist:a3a5b5adde8bba7d6be5
Created June 28, 2015 00:31
leekspin make me an onion
diff --git a/leekspin/crypto.py b/leekspin/crypto.py
index c759b2b..262a30f 100644
--- a/leekspin/crypto.py
+++ b/leekspin/crypto.py
@@ -280,6 +280,22 @@ def generateOnionKey():
return (secretOnionKey, publicOnionKey, onionKeyLine)
+def fufu():
+ from Crypto.Util.asn1 import DerSequence
@david415
david415 / gist:120f157f62d20b11e39f
Last active November 14, 2015 19:29
secret onion git http repo! fuck github. no masters. no sys admins. only the secret police know how cool i am.
virtualenv virtenv-txtorcon
. ./virtenv-txtorcon/bin/activate
pip install txtorcon
export project=myproject
export secret=`pwgen 64`
mkdir -p public_html/$secret
cp -a $project public_html/$secret
touch public_html/index.html
@david415
david415 / gist:be36195beff358e36644
Created January 17, 2016 19:52
leif's new magic-folder proposal
multi-party conflict detection
==============================
The current Magic-Folder remote conflict detection design does not properly detect remote conflicts
for groups of three or more parties. This design is specified in the "Fire Dragon" section of this document:
https://github.com/tahoe-lafs/tahoe-lafs/blob/2551.wip.2/docs/proposed/magic-folder/remote-to-local-sync.rst#fire-dragons-distinguishing-conflicts-from-overwrites
This Tahoe-LAFS trac ticket comment outlines a scenario with
three parties in which a remote conflict is falsely detected:
@david415
david415 / gist:e541d4f1d70a7e06161128490f52462b
Created December 14, 2016 06:11
rust lioness error handling?
extern crate crypto;
use std::error::Error;
use std::fmt;
use crypto::mac::Mac;
use crypto::blake2b::Blake2b;
const LIONESS_KEY_SIZE: u32 = 208;
@david415
david415 / mixnet_graph.dot
Last active February 18, 2017 22:01
mixnet logo
# dot mixnet_graph.dot -Tpng -o rgb_mix.png -Tpng -o rgb_mix.png
digraph rgb_mixnet {
ratio = fill;
size="3,3";
rank = min;
nodesep=1.4;
subgraph cluster0 {
#rankdir = RL;
node [shape = doublecircle, fillcolor=black, style="filled", width=1,height=1]; e;
node [shape = circle, fillcolor="black", width=1, height=1];
@david415
david415 / detect_tor_network_partitions
Last active September 22, 2017 01:52
how to scan the tor network for partitions
how to scan the tor network for partitions
------------------------------------------
1. setup a machine running Tor and expose its control port as either a tcp port or unix domain socket
with no authentication
*edit* /etc/tor/torrc
blah blah easy rtfm
Congestion Control
[E2ECONGESTION] Floyd, S., Fall, K.,
"Promoting the Use of End-to-End Congestion Control in the Internet",
IEEE/ACM Transactions on Networking, May 1999,
<https://www.icir.org/floyd/papers/collapse.may99.pdf>.
[RFC896] Nagle, J., "Congestion Control in IP/TCP Internetworks",
@david415
david415 / gist:e3966d18db55c193c418059bca71af5e
Created April 5, 2019 01:41
rust server listen on unix domain socket
use std::thread;
use std::os::unix::net::{UnixStream, UnixListener};
fn handle_client(stream: UnixStream) {
// ...
}
@david415
david415 / gist:bb9918f199c009dabdd9e64ce889a63d
Created April 5, 2019 01:44
rust hyperlocal attempt at low level server unix socket listener.. fail not working
extern crate hyper;
extern crate hyperlocal;
use std::os::unix::net::UnixListener;
use hyper::{Response, rt::{Future, Stream}, service::service_fn};
use hyperlocal::server::{Http, Incoming};
fn main () {
if let Err(err) = std::fs::remove_file("hyperlocal_test_echo_server_2.sock") {
[UpstreamProxy]
Type = "socks5"
Network = "tcp"
Address = "127.0.0.1:9050"
[Logging]
Disable = false
Level = "DEBUG"
File = "/home/user/catshadow_testnet/bob/catshadow.log"