Skip to content

Instantly share code, notes, and snippets.

Avatar

Rusty Russell rustyrussell

View GitHub Profile
View gist:762297e84dc5239fe408c45e6811e1a9
"reckless install <url>"
- might turn simple names (.e.g summary) into references to the GH plugins repo
- allow URLs to inside repos for GH plugins.
Technical:
- if first run, creates ~/.lightning/reckless/, puts in empty "bitcoin.config" and 'include ../reckless/bitcoin.config' if not already in ~/.lightning/bitcoin/config
- download and unpack/move into ~/.lightning/reckless/<subdir>
- perform simple check (e.g. for Python, you can run the plugin normally and it should exit with status 0).
- start up dynamically
- if it works, add to reckless/bitcoin.config
@rustyrussell
rustyrussell / times-headlines.txt
Created Oct 29, 2021
The Times Headlines December 2008 and January 2009
View times-headlines.txt
Dec 2008:
1: Tory MP is accused of orchestrating leaks
2: Officials who failed Baby P are forced out
3: De Menezes coroner rules out unlawful killing verdict
4: Emergency rescue for mortgage defaulters
5: Rates cut again as recession deepens
6: Vauxhall in secret cash plea to save 5,000 jobs
8: Traditional subjects go in schools shake-up
9: Brown's recovery gathers pace with new poll boost
@rustyrussell
rustyrussell / permute-image.c
Created Feb 21, 2020
Quick code to scramble / unscramble an image given a key.
View permute-image.c
#include <ccan/array_size/array_size.h>
#include <ccan/asort/asort.h>
#include <ccan/crypto/sha256/sha256.h>
#include <ccan/err/err.h>
#include <ccan/str/hex/hex.h>
#include <ccan/short_types/short_types.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_pixels.h>
View foo.md
= Header
== Header 2
=== Header 3
View foo.md
= Header
== Header 2
=== Header 3
View dijkstra-hard-limit.patch
diff --git a/gossipd/gossip_wire.csv b/gossipd/gossip_wire.csv
index 63392d87b..7b36f9831 100644
--- a/gossipd/gossip_wire.csv
+++ b/gossipd/gossip_wire.csv
@@ -37,6 +37,7 @@ msgdata,gossip_getroute_request,fuzz,double,
msgdata,gossip_getroute_request,num_excluded,u16,
msgdata,gossip_getroute_request,excluded,short_channel_id_dir,num_excluded
msgdata,gossip_getroute_request,max_hops,u32,
+msgdata,gossip_getroute_request,hard_limit,bool,
View genaddress.c
#include "../lightning/external/libwally-core/include/wally_address.h"
#include "../lightning/external/libwally-core/include/wally_bip32.h"
#include "../lightning/external/libwally-core/src/secp256k1/include/secp256k1.h"
#include "../lightning/common/bech32.c"
#include <ccan/crypto/sha256/sha256.h>
#include <ccan/crypto/ripemd160/ripemd160.h>
#include <ccan/str/hex/hex.h>
#include <err.h>
#include <assert.h>
#include <stdio.h>
@rustyrussell
rustyrussell / build-release.sh
Created Oct 26, 2018
Release script for c-lightning
View build-release.sh
#! /bin/sh
set -e
if [ "$(git status --porcelain -u no)" != "" ]; then
echo "Not a clean git directory" >&2
exit 1
fi
VERSION=`git tag --points-at HEAD`
if [ "$VERSION" = "" ]; then
@rustyrussell
rustyrussell / Bbock.hex
Created Jul 4, 2018
bitcoin-cli getblock 0000000000000000000fda35b2a2a3e24009d64f043c9f0370825a7193667232 false
View Bbock.hex
This file has been truncated, but you can view the full file.
@rustyrussell
rustyrussell / siphash-route-bench.patch
Created Feb 23, 2018
Unfinished patch for switching from isaac to siphash...
View siphash-route-bench.patch
diff --git a/gossipd/routing.c b/gossipd/routing.c
index 69db3001..5798c239 100644
--- a/gossipd/routing.c
+++ b/gossipd/routing.c
@@ -5,7 +5,6 @@
#include <ccan/array_size/array_size.h>
#include <ccan/crypto/siphash24/siphash24.h>
#include <ccan/endian/endian.h>
-#include <ccan/isaac/isaac64.h>
#include <ccan/structeq/structeq.h>