Skip to content

Instantly share code, notes, and snippets.

View alexbosworth's full-sized avatar

Alex Bosworth alexbosworth

View GitHub Profile
@alexbosworth
alexbosworth / inotify-channel-backup.md
Last active March 29, 2024 01:33
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

Install Bitcoin Core

Get PPA

sudo add-apt-repository ppa:bitcoin/bitcoin
// PRESS ENTER TO CONTINUE
sudo apt update && sudo apt install -y bitcoind
// Copyright (c) 2017 Alex Bosworth
// Copyright (c) 2017 Pieter Wuille
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@alexbosworth
alexbosworth / setup_npm.md
Last active October 5, 2023 16:37
Setup NPM

Install make

You will probably need build essential tools

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

Install Node.js

@alexbosworth
alexbosworth / accepts_bos_ads.md
Created May 7, 2023 17:23
Nodes accepting bos ads
    - 03817596435f25a156da4a89c9dabf2a3e4f9a74418543f3de6b77cab780a473a1
    - 0293952cbf1be801ba5d73ff34a950affb64fcbfe2d0f46ed0b32c468874aa0d57
    - 0356c1091bb139ad3520eb370f1512ac2f4ed67b87d2687638252152fbf2b4575f
    - 03a93b87bf9f052b8e862d51ebbac4ce5e97b5f4137563cd5128548d7f5978dda9
    - 027b510a7c40bc1aab58345eedad23062578a5647d13a69ed5a2b90290de2faa81
    - 03d6f80df785288de2fe5de19f24ba8a1db3d20647a88d0a903be9de3e7bb8fce1
    - 0399d0b447f378db24fe5f4ecc7afb65bc074596a0fc8cf299d5cb8319ad299f8d

systemd

Edit:

sudo emacs /etc/systemd/system/lnd.service
[Service]
@alexbosworth
alexbosworth / KeychainService.swift
Last active January 5, 2021 08:26
Swift Keychain Class
import UIKit
import Security
let serviceIdentifier = "com.company"
let accessGroup = "com.company.app"
let kSecClassValue = kSecClass as NSString
let kSecAttrAccountValue = kSecAttrAccount as NSString
let kSecValueDataValue = kSecValueData as NSString
let kSecClassGenericPasswordValue = kSecClassGenericPassword as NSString
@alexbosworth
alexbosworth / yubikey4-ssh-macos.md
Created December 12, 2020 03:13 — forked from ixdy/yubikey4-ssh-macos.md
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 https://git.torproject.org/tor.git

# 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 https://github.com/bitcoin/bitcoin.git

# Enter the cloned repo dir