Skip to content

Instantly share code, notes, and snippets.

@lontivero
lontivero / Monoid.cs
Last active July 15, 2020 14:58 — forked from reidev275/Monoid.cs
Monoid and Foldable for C#
public interface Monoid<A>
{
public A Empty => default(A);
A Append(A x, A y);
}
public static class Foldable
{
public static A Fold<A>(this IEnumerable<A> list, Monoid<A> M) =>
list.FoldMap(x => x, M);
@lontivero
lontivero / onion_bitcoin
Created April 17, 2019 18:38 — forked from hungryduck/onion_bitcoin
List active .onion bitcoin nodes (Bash)
#!/bin/bash
# Command to get a list of active bitcoin .onion addresses from bitnodes.21.co
curl -s https://bitnodes.21.co/api/v1/snapshots/latest/ | egrep -o '[a-z0-9]{16}\.onion:?[0-9]*' | sort -ru
@lontivero
lontivero / bitdump.sh
Created March 26, 2019 18:23 — forked from altamic/bitdump.sh
dumps Bitcoin network traffic
#!/usr/bin/env sh
# bitdump.sh
#
# captures Bitcoin network traffic
SELF=`basename $0`
if [[ $1 = "" ]]; then
DEFAULT="en1"
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
using Open.Nat;
namespace ConsoleApplication3
{
class Program