env GOOS=target-OS GOARCH=target-architecture go build package-import-path
# Example
env GOOS=darwin GOARCH=amd64 go build
env GOOS=darwin GOARCH=amd64 go build main.go
env GOOS=darwin GOARCH=amd64 go build github.com/zoo/york/foo/bar
#!/bin/bash | |
## Edit sudoers (add "NOPASSWD:" to the sudo line before ALL) | |
## Add optional: true to netplan and apply | |
## Add Google Kubernetes key | |
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys B53DC80D13EDEF05 | |
# Install Docker |
#!/bin/bash | |
# Do nothing if the WALLET_PASSWORD var is not set. | |
if [ -z "$PASSWORD" ]; then | |
echo "[lnd_unlock] Please set PASSWORD in order to unlock wallet automatically." | |
s6-pause | |
fi | |
# output script content for easier debugging. | |
# set -x | |
# exit from script if error was raised. | |
set -e |
Network views tend to be the view of the network from a single node, or small selection of nodes. They are not complete views of the network. This is impossible to achieve. Even if many node views were combined, it would still be incomplete.
These network views, or network maps, have been termed 'visualisers' by the LN community.
Screenshots may reflect older visual styles, and are dated accordingly.
Short script to monitor walletbalance and channelbalance for LND, and log to csv file for later graphing. You need a working LND, and jq installed.
first setup by editing balances.txt and add a header line
date,walletbalance,channelbalance
add the following script, edit lndbalances.sh
#!/bin/bash
^(?<timestamp>\w+\s+\d+,\s+\d+\s+\d+:\d+:\d+\.\d+)[^\]\n]*\]\s+(?<loglevel>\w+) - (?<full_message>(?:(?:Request: \[(?<request_ip>[^:]+).*Token \((?<username>[^)]+))?(?:\[?(?<status_source>[\w\s]+)((\]|: )))?(?:Adding (?<session_number>\d) sessions\.)?(?:Found session GUID of (?<session_guid>[^\s]+))??(?:Session (?<playback_session_guid>[^\s]+) \((?<playback_session_number>[^\)]+)\) is (?<placyback_session_status>\w+))?(?:using profile (?<transcode_profile>.*))?(?:.*\/transcode\/session\/(?<transcode_session_guid>[^\/]+))?(?:It took (?<time_taken>[\d\.]+) sec to (?<action_taken>.*))?)?(?:Content-Length of (?<file_path>.*\/(?<file_name>[\w\s]+\.(avi|mp4|mkv|m4v|wmv|mpg|mpeg|divx))(\s|$)))?.*)$ |
CTRL + A
— Move to the beginning of the lineCTRL + E
— Move to the end of the lineCTRL + [left arrow]
— Move one word backward (on some systems this is ALT + B)CTRL + [right arrow]
— Move one word forward (on some systems this is ALT + F)CTRL + U
— (bash) Clear the characters on the line before the current cursor positionCTRL + U
—(zsh) If you're using the zsh, this will clear the entire lineCTRL + K
— Clear the characters on the line after the current cursor positionESC + [backspace]
— Delete the word in front of the cursor#!/usr/bin/env sh | |
has_gid () { | |
cut -d: -f1,4 /etc/passwd | grep -q "^${1}:${2}" || return 1 | |
} | |
# example: ensure_user btsync 1000 1000 | |
ensure_user () { | |
local user=$1 | |
local uid=$2 |