View lnd_connect.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
jq --help >/dev/null 2>&1 || { echo >&2 "Error: 'jq' is required but not installed."; exit 1; } | |
LIST=$(lncli listchannels | jq -r '.[]') | |
LENGTH=$(echo $LIST | jq 'length') | |
for (( i=0; i<$LENGTH; i++ )); | |
do | |
NODE_PUBKEY=$(echo $LIST | jq ".[$i].remote_pubkey" | tr -d '"') |
View grin.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Grin node | |
After=network.target | |
[Service] | |
WorkingDirectory=/home/satoshi/.grin/ | |
User=satoshi | |
Group=satoshi | |
PrivateDevices=yes |
View btcpayserver.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=BtcPayServer daemon | |
Requires=btcpayserver.service | |
After=nbxplorer.service | |
[Service] | |
ExecStart=/usr/bin/dotnet run --no-launch-profile --no-build -c Release -p "/home/satoshi/source/btcpayserver/BTCPayServer/BTCPayServer.csproj" -- $@ | |
User=satoshi | |
Group=satoshi | |
Type=simple |
View nbxplorer.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=NBXplorer daemon | |
Requires=bitcoind.service | |
After=bitcoind.service | |
[Service] | |
ExecStart=/usr/bin/dotnet "/home/satoshi/source/NBXplorer/NBXplorer/bin/Release/netcoreapp2.1/NBXplorer.dll" -c /home/satoshi/.nbxplorer/Main/settings.config | |
User=satoshi | |
Group=satoshi | |
Type=simple |
View install-lnd.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Get number of cores to speed up the compilation time | |
CORES=$(( $(lscpu | awk '/^Socket/{ print $2 }') * $(lscpu | awk '/^Core/{ print $4 }') )) | |
# Other vars | |
IP=$(dig +short myip.opendns.com @resolver1.opendns.com) | |
BTC_CONF=~/.bitcoin/bitcoin.conf | |
LND_DIR=~/.lnd | |
LND_CONF=lnd.conf |
View monerod.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Monero Full Node | |
After=network.target | |
[Service] | |
User=satoshi | |
Group=satoshi | |
Type=forking | |
PIDFile=/home/satoshi/.bitmonero/monerod.pid |
View lnd.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$1" = "start" ]; then | |
echo "Starting Lightning Network" | |
echo "=====================" | |
sudo service lnd start & | |
lncli unlock | |
elif [ "$1" = "stop" ]; then | |
echo "Stopping Lightning Network" |
View lnd.service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=LND Lightning Daemon | |
Requires=bitcoind.service | |
After=bitcoind.service | |
[Service] | |
ExecStart=/home/satoshi/go/bin/lnd | |
ExecStop=/home/satoshi/go/bin/lncli stop | |
PIDFile=/home/satoshi/.lnd/lnd.pid |
View gist:236a831c4e0dd4772ca866eb81f9cac5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.lpad = function(padString, length) { | |
var str = this; | |
while (str.length < length) | |
str = padString + str; | |
return str; | |
} | |
var blockHeight = 434695, | |
rawTx = '<raw transaction>', | |
blockLittleEndian = (blockHeight).toString(16).lpad('0', 8).match(/../g).reverse().join(''); |
View create-unattended-iso.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# file names & paths | |
tmp="/tmp" # destination folder to store the final iso file | |
hostname="ubuntu" | |
currentuser="$( whoami)" | |
# define spinner function for slow tasks | |
# courtesy of http://fitnr.com/showing-a-bash-spinner.html | |
spinner() |