Skip to content

Instantly share code, notes, and snippets.

View meeDamian's full-sized avatar
👨‍💻
Lightning Networking

Damian Mee meeDamian

👨‍💻
Lightning Networking
View GitHub Profile
@meeDamian
meeDamian / 10-uname
Last active September 7, 2018 07:42
This is a MOTD for a raspberry pi running bitcoind and either lnd or lightning (or both). To install, download and execute `install.sh` file.
#!/bin/sh
. /usr/local/lib/metrics/colors.sh
. /usr/local/lib/metrics/board.sh
echo
echo -n "${WHITE}Raspberry Pi ($(get_host), $(get_public_ip), $(get_local_ip))${RESET_STYLE} " && uname -rm
uptime
@meeDamian
meeDamian / bitcoind.sh
Last active September 21, 2018 07:12
This is a series of utility functions to interface with RBP metrics, bitcoind, lnd and lightningd. To install, download and execute `install.sh` file.
#!/bin/sh
. /usr/local/lib/metrics/utilities.sh
# BITCOIN CORE
# ------------
#
# * assumes default ~/.bitcoin folder location
# * tries to detect bitcoin-cli path
# * tries to determine user running bitcoind
#!/bin/sh
LN_PORT=9735
ROUTER_UPNP=http://192.168.0.1:1900/gatedesc.xml
IP="$(ip route get 1 | awk '{print $NF;exit}')"
SSH_PORT="22$(echo ${IP} | cut -d '.' -f4)"
# ssh
upnpc -u "${ROUTER_UPNP}" -e "$(hostname): ssh" -a ${IP} 22 ${SSH_PORT} TCP
#!/usr/bin/env zsh
# NOTE:
# Running this script requires:
# * bitcoind - full archival node,
# * jq - `sudo apt install jq`,
# * zsh - `sudo apt install zsh`.
FILE=~/block_data.txt
MAX=$(bitcoin-cli getblockcount)
#!/usr/bin/env bash
npm install -g qrcode
qrcode -w 300 -t png -o btc.png "bitcoin:bc1qs6zy42lee5sjnv7m8kl5e586jrpuwvnpcyekm9?amount=0.000001"
qrcode -w 300 -t png -o ln.png "LIGHTNING:LNBC1U1PD57K2HPP56PUL7UZCR38N3H7RH7ZEAGMWEFF4AN7A4X4G9TP6Q6UY86RQPQEQDQQCQZYSUNWZ2ZGRX6SS7GPLUH76QSS5ALZHGP3N8WJ32L8G7Y7S0GWMU4R40HKY8QXM80TJWVJ2K3EY39ZHJE7AHVGJGNAAUZLNXQ0NG4JAJ6CPHAN5ZF"
qrcode -w 300 -t png -o ln+btc.png "LIGHTNING:LNBC1U1PD57K2VPP5R2FGXQSQZHL20UZQN4R24N4AFND5AN0P77GGPM3S2AQFPWZN4GHQDQQCQZYSFPPQS6ZY42LEE5SJNV7M8KL5E586JRPUWVNPUH3KVLPW7VLGDU34SNELAF7P6D66HKEFUU2ATPUTMEQTC07L39TXJH55D0FWZ7VJMV6G4U870C36HVPM2ZDR0UNW09JEQRELT42A02SPYK3S68"
qrcode -w 300 -t png -o btc+ln.png "bitcoin:bc1qs6zy42lee5sjnv7m8kl5e586jrpuwvnpcyekm9?amount=0.000001&lightning=lnbc1u1pd57k2hpp56pul7uzcr38n3h7rh7zeagmweff4an7a4x4g9tp6q6uy86rqpqeqdqqcqzysunwz2zgrx6ss7gpluh76qss5alzhgp3n8wj32l8g7y7s0gwmu4r40hky8qxm80tjwvj2k3ey39zhje7ahvgjgnaauzlnxq0ng4jaj6cphan5zf"
qrcode -w 300 -t png -o btc+ln+improved.png "BITCOIN:bc1qs6zy42lee5sjnv7m8
@meeDamian
meeDamian / lnd.conf
Created July 13, 2018 13:19
lnd Tor-only configuration
[Application Options]
externalip=5ogfg2weyoj5bgbxh36tdwdpehvmqkq6aziqsuptak5uyqfuhi4wsmqd.onion:9735
listen=127.0.0.1:9735
# … all other stuff
[Tor]
tor.active=1
tor.streamisolation=true
tor.socks=127.0.0.1:9050
package main
import (
"bufio"
"flag"
"fmt"
"os"
"strings"
)
#!/bin/bash
logo="$(tput setaf 2)
.~~. .~~.
'. \ ' ' / .'$(tput setaf 1)
.~ .~~~..~.
: .~.'~'.~. :
~ ( ) ( ) ~
( : '~'.~.'~' : )
~ .~ ( ) ~. ~ $(tput sgr0)Raspberry Pi$(tput setaf 1)
( : '~' : ) $(tput sgr0)Bitcoin$(tput setaf 1)
(function () {
'use strict';
const DATA_SOURCE = 'https://meedamian.keybase.pub/btc_data.js';
const COLORS = {
'#': 3, // black
' ': 0, // white
'!': 1, // light grey
'%': 2, // dark grey
<html>
<head>
<!-- useless crap goes here… -->
</head>
<body>
<!-- some more of the useless crap… -->
<!-- … -->