Skip to content

Instantly share code, notes, and snippets.


Alex Bosworth alexbosworth

View GitHub Profile

Install make

You will probably need build essential tools

# Ubuntu install build tools:
sudo apt-get install -y build-essential

Install Node.js

alexbosworth /
Last active Mar 13, 2021
Backup channel.backup file using systemd and inotify

LND backup script for channel.backup using inotify

Install inotify

sudo apt install inotify-tools

Create script to watch for changes and copy on change

View KeychainService.swift
import UIKit
import Security
let serviceIdentifier = ""
let accessGroup = ""
let kSecClassValue = kSecClass as NSString
let kSecAttrAccountValue = kSecAttrAccount as NSString
let kSecValueDataValue = kSecValueData as NSString
let kSecClassGenericPasswordValue = kSecClassGenericPassword as NSString
alexbosworth /
Created Dec 12, 2020 — forked from ixdy/
Setting up ssh public key authentication on macOS using a YubiKey 4

Setting up ssh public key authentication on macOS using a YubiKey 4

I largely followed Florin's blog post, but have a few notes to add regarding issues I encountered:

Basic setup notes

  1. I used a YubiKey 4, while the blog describes using a YubiKey NEO. I'm sure a YubiKey 5 would also work. I'm also running macOS 10.13.6.
  2. I installed GPGTools as recommended. However, as I'll note later, it seems that gpg-agent only automatically starts when gpg is used; for ssh, you'll need to ensure it's running.
  3. Before generating your keys, decide what key size you want to use. If you run the list command inside gpg --edit-card, look for the Key attributes line to see what is currently selected. On my YubiKey 4, it defaulted to 2048 bits for all keys:
Key attributes ...: rsa2048 rsa2048 rsa2048




Build and Install Tor

# Install build tools
sudo apt-get install git build-essential automake libevent-dev libssl-dev pkg-config zlib1g-dev libzstd-dev

# Clone Tor
git clone

# Enter Tor dir

Installing Bitcoin from Source with APT

# Install build tools
sudo apt install git build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-program-options-dev libboost-test-dev libboost-thread-dev libminiupnpc-dev libzmq3-dev

# Clone the latest release
git clone -b v0.20.1

# Enter the cloned repo dir
View geohash.swift
// Geohash.swift
// mn_ios
// Created by Alex Bosworth on 11/26/14.
// Copyright (c) 2014 adylitica. All rights reserved.
import Foundation
import MapKit

Install LND

Install LND by cloning and building

Install Make

sudo apt-get install -y build-essential
View payment-stream.js
const sub = lnd.sendPayment();
sub.on('error', err => {
console.log("ERR", err);
sub.on('end', () => console.log("END"));
sub.on('status', status => console.log("STATUS", status));
sub.on('data', data => {
console.log("PAYMENT", data);