Skip to content

Instantly share code, notes, and snippets.

@lontivero
lontivero / productivity.md
Created January 21, 2021 15:10
Productivity with git worktree

Productivity

Developers work with many branches at the same time because during any single day they review others' pull requests, try new crazy things, work on new features/bug-fixes and also fix somebody else's PRs. All this forces a combination of git stash [pop|save], git fetch, git checkout [-f] and again git stash [pop|apply]. No matter if this is done by command line or with a tool the problem of having only one copy of the code is an ugly constrain.

Wasabi Wallet folders organization (suggestion)

Create main local bare repository

First clone your existing repository as a bare repo (a repository without files) and do it in a .git directory.

@lontivero
lontivero / simul.py
Created August 10, 2020 16:07
Fee rates under mepool pressure simulation
import sys, random, math
def hours(hrs):
return hrs * minutes(60)
def minutes(mins):
return 60 * mins
def megabytes(mega):
return mega * 1024 * 1024
@lontivero
lontivero / WabiSabi.hs
Created August 3, 2020 18:17
WabiSabi toy impl in Haskell
module WabiSabi where
data GE = GE Integer Integer | Infinity
deriving Show
instance S.Semigroup GE where
(<>) = (⊕)
instance M.Monoid GE where
mempty = Infinity
@lontivero
lontivero / bundle.sh
Created August 3, 2020 05:03
Wasabi AppImage bundle
#!/bin/sh
set -e
rm -rf .AppDir
mkdir -p ./AppDir/usr/bin
dotnet publish \
--configuration Release
--force \
--output ./AppDir/usr/bin \
@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 / README.md
Last active April 8, 2022 10:25
Wasabi CLI

Wasabi CLI

A tiny bash script to effortless interaction with Wasabi RPC Server.

$ ./wcli.sh listkeys | head -10 

fullkeypath       internal  keystate  label  p2wpkhscript                              pubkey                                                              pubkeyhash
84'/0'/0'/1/0     true      2         0      b0ba6bb14314bacd1f908eb2b9ecc74e0b041717  039d67f2c7c3dd1ed0ac301e677fe3abf6f059067796553211d562f46f2e420043  b0ba6bb14314bacd1f908eb2b9ecc74e0b041717
84'/0'/0'/1/1     true      2         0      6b470de643697581b2717e6d2b878470a26d5e83  02efaf8fddc729e51826439ebac6e5782f60890262fd6c0702f537062bc4fe00f2  6b470de643697581b2717e6d2b878470a26d5e83
@lontivero
lontivero / Program.cs
Last active April 19, 2019 05:40
Get Bitcoin nodes on onion domains
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace seeds
{
@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"
@lontivero
lontivero / FilterCoinjoinCSV.csv
Last active May 2, 2019 04:07
Coinjoin bash lines
We can make this file beautiful and searchable if this error is corrected: Illegal quoting in line 3.
cat WasabiCoinjoins.csv | grep bc1qs604c7jv6amk4cxqlnvuxv26hv3e48cds4m0ew > payments.csv
cat payments.csv | sort -u > uniq-payments.csv
cat uniq-payments.csv | grep -E "4\/[0-9]{1,2}\/19" | cut -f1,2,4,8,9 > april2019.csv
# cat uniq-payments.csv | cut -d"," -f8 | paste -sd+ | bc