Skip to content

Instantly share code, notes, and snippets.

View bliotti's full-sized avatar
public key cryptography is pretty neat 🔑 🔐

Brian Liotti bliotti

public key cryptography is pretty neat 🔑 🔐
View GitHub Profile
@tkfm-yamaguchi
tkfm-yamaguchi / lang.map.diff
Last active February 5, 2024 19:51
source-highlight's language definition file for YAML
---/usr/share/source-highlight/lang.map.old
+++/usr/share/source-highlight/lang.map
@@ -169,3 +169,5 @@
groovy = groovy.lang
json = json.lang
feature = feature.lang
+yaml = yaml.lang
+yml = yaml.lang

Network partition resistance

For the Bitcoin network to remain in consensus, the network of nodes must not be partitioned. So for an individual node to remain in consensus with the network, it must have at least one connection to that network of peers that share its consensus rules. This document describes how we attempt to achieve this.

We can't rely on inbound peers to be honest, because they are initiated by others. It's impossible for us to know, for example, whether all our inbound peers are controlled by the same adversary.

@bliotti
bliotti / copy-ssd.sh
Last active February 6, 2023 08:58
copy ssd raspibolt
sudo systemctl stop btcrpcexplorer
sudo systemctl stop bos-telegram.service
sudo systemctl stop rtl
sudo systemctl stop thunderhub
sudo systemctl stop electrs
sudo systemctl stop lnd
sudo systemctl stop bitcoind
sudo systemctl disable btcrpcexplorer.service
sudo systemctl disable bos-telegram.service
@bliotti
bliotti / alias-list.md
Last active August 14, 2021 17:32
alias list for bitcoind, bitcoin-cli, lnd, lncli

These can be added to your .bashrc or .zshrc

some cmd's require jq tool.
  • linux - sudo apt-get install jq
  • mac - brew install jq
alias btcinfo='bitcoin-cli getwalletinfo | egrep "\"balance\""; bitcoin-cli getnetworkinfo | egrep "\"version\"|connections"; bitcoin-cli getmininginfo | egrep "\"blocks\"|errors"'
@BretCameron
BretCameron / LinkedList.js
Created September 30, 2019 09:16
The full LinkedList implementation from this tutorial: https://bit.ly/2mihZac
class LinkedListNode {
constructor(value, next) {
this.value = value;
this.next = next || null;
}
}
class LinkedList {
constructor(value) {
this.size = 0;
@bliotti
bliotti / QR Codes on LND.md
Created July 7, 2021 01:01
QR codes on LND.md

create QR codes on LND

sudo apt-get install qrencode jq
lncli newaddress np2wkh | jq -c -r .address |qrencode -t ASCII -m 5
[Application Options]
lnddir=/home/bitcoin/lnd_data
maxpendingchannels=10
alias=YOURALIAS
rpclisten=0.0.0.0:10009
[Bitcoin]
bitcoin.active=1
bitcoin.mainnet=1
bitcoin.node=bitcoind
@bliotti
bliotti / monitor-pi.sh
Created June 7, 2021 21:11
Monitors Ras Pi temp.
#!/bin/bash
Counter=14
DisplayHeader="Time Temp CPU Core Health Vcore PMIC"
while true ; do
let ++Counter
if [ ${Counter} -eq 15 ]; then
echo -e "${DisplayHeader}"
Counter=0
fi
Health=$(perl -e "printf \"%19b\n\", $(vcgencmd get_throttled | cut -f2 -d=)")
@bliotti
bliotti / cluster-issuer.yaml
Last active May 15, 2021 03:00 — forked from lvnilesh/cluster-issuer.yaml
DNS acme cluster-issuer.yaml - third time is a charm
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-staging
namespace: cert-manager
spec:
acme:
email: brian@liotti.io
server: https://acme-staging-v02.api.letsencrypt.org/directory
privateKeySecretRef:
@raine
raine / ramda
Last active May 4, 2020 12:14
Browse Ramda documentation in Terminal
#!/usr/bin/env bash
# Browse Ramda documentation in Terminal
# Requires jq and a tool such as fzf or peco for interactive filtering
LATEST="http://raine.github.io/ramda-json-docs/latest.json"
DOCS_URL="http://ramdajs.com/docs/"
json=$(curl -s $LATEST)
functions=$(echo "$json" | jq -r '.[] | if .sig and (.sig | length > 0) then .name + " :: " + .sig else .name end')