Skip to content

Instantly share code, notes, and snippets.

@jamesob
jamesob / rangediff.diff
Created November 18, 2021 21:55
git range-diff --color=never upstream/master jonasschnelli/2020/12/filterblocks_rpc HEAD
-: ---------- > 1: 608d8b4a62 rpc: move-only: consolidate blockchain scan args
1: 6a69dd267e ! 2: d836ce3f2f Add scanblocks RPC call - scan for relevant blocks with descriptors
@@ Metadata
Author: Jonas Schnelli <dev@jonasschnelli.ch>
## Commit message ##
- Add scanblocks RPC call - scan for relevant blocks with descriptors
+ rpc: add scanblocks - scan for relevant blocks with descriptors
+
+ Co-authored-by: James O'Beirne <james.obeirne@gmail.com>
@jamesob
jamesob / install-steps.sh
Last active April 6, 2024 21:22
Getting to Android and react-native development in Arch Linux (2024)
# This (very scant) guide allows you to do Android and react-native development on Linux by
# running the android emulator in a container.
# install yay via AUR
git clone https://aur.archlinux.org/yay.git && cd yay && makpkg -si
# install all android dev packages per https://wiki.archlinux.org/title/Android
yay -Sy android-sdk-cmdline-tools-latest android-sdk-build-tools android-sdk-platform-tools android-platform
# add to .zshrc
@jamesob
jamesob / devops_checklist.md
Created November 25, 2014 03:14
DevOps checklist

Security

  • no credentials kept in codebase
    • use consul/zookeeper/etc., then have code load credentials from environment variables
  • using a bastion box to safeguard access to servers
    • in conjunction with, e.g., AWS security groups

Development

$ make clean && ./configure && make clean && make && SECP256K1_BENCH_ITERS=200000 ./bench verify sign
Benchmark , Min(us) , Avg(us) , Max(us)
ecdsa_verify , 71.5 , 71.5 , 71.5
ecdsa_sign , 54.8 , 54.9 , 54.9
schnorrsig_sign , 41.9 , 41.9 , 41.9
schnorrsig_verify , 72.6 , 72.6 , 72.6
@jamesob
jamesob / instructions.md
Created January 2, 2022 02:33
Install Spotify to run under Debian/Sway natively
  1. Install Spotify in the usual way:
curl -fsSL https://download.spotify.com/debian/pubkey_5E3C45D7B312C643.gpg | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/spotify.gpg
sudo apt update && sudo apt install spotify-client
  1. Compile stubs for X-specific calls that Spotify makes:
$ cat xstub.c
@jamesob
jamesob / load-all.js
Created September 30, 2023 10:20
Load all comments in a Github PR
// Open Inspect -> Console, copy-paste this in.
function load_all_gh_comments() {
let buttons = Array.from(document.querySelectorAll('button'));
let get_with_text = (text) => buttons.filter((b) => b.textContent.includes(text));
let load_more_buttons = get_with_text("Load more");
let nothing_loading = get_with_text("Loading…").length === 0;
if (load_more_buttons.length === 0 && nothing_loading) {
console.log("done loading comments");
@jamesob
jamesob / vault-txns.md
Last active September 22, 2023 15:50
Transaction examples for the OP_VAULT proposal

OP_VAULT transaction examples

The following output was generated by the OP_VAULT functional test suite.

Normal spend, 1 input [NoRecoveryAuth]

Initialize (94 vB)
@jamesob
jamesob / observations.txt
Created May 23, 2023 14:47
Header-to-tip observations
In [17]: for h in HeaderToTipEvent.objects.order_by('-header_to_tip_secs')[:50]:
...: print(f'{h.saw_header_at.date()} {h.host.name:<14} {h.host.bitcoin_version:<24} headtotip = {h.header_to_tip_secs:<6.3f}s headtoblock = {h.header_to_block_secs:<6.3f}s blocktotip = {h.block_to_tip_secs:<6.3f}s {h.blockhash} ({h.height})')
...:
2023-05-21 b-04.slug 25.0rc2 headtotip = 67.749s headtoblock = 65.571s blocktotip = 2.178 s 00000000000000000004f0919e965cabf33b76f80ce8d69354edbdca5c7507bf (790720)
2023-05-19 b-04.slug 25.0rc2 headtotip = 47.833s headtoblock = 46.867s blocktotip = 0.966 s 000000000000000000003c3aff2eb3e0022c2c9444acbf591db4cd25bfb91377 (790493)
2023-05-18 b-04.slug 25.0rc2 headtotip = 36.867s headtoblock = 36.725s blocktotip = 0.142 s 000000000000000000007069e5b2d84598c731e6d6f4098c73cc2161c5f03f63 (790376)
2023-05-16 ssd-1.ccl 25.99.0-d7700d3a2647 headtotip = 31.581s headto
@jamesob
jamesob / bmon.log
Created May 31, 2023 14:15
Mempool is bogus
tx: https://mempool.space/tx/7bea4b346f6143dd824f8db8b739e93e414b29c2b2b9c06c9b2edf395e46fff9
block: https://mempool.space/block/000000000000000000003a3e1ed4bced6c52acb1a684d00607b00944e79ce3aa
10:12:34 james@tacoma src/bmon (?± master 3062ef8) % bmon-infra rg "(7bea4b346f6143dd824f8db8b739e93e414b29c2b2b9c06c9b2edf395e46fff9|000000000000000000003a3e1ed4bced6c52acb1a684d00607b00944e79ce3aa)"
10:13:00.149217 I fscm.remote: connecting to host bitcoin-01; may prompt for credentials
10:13:00.149566 I fscm.remote: connecting to host b-01.slug; may prompt for credentials
10:13:00.149942 I fscm.remote: connecting to host b-02.slug; may prompt for credentials
10:13:00.150279 I fscm.remote: connecting to host b-03.slug; may prompt for credentials
10:13:00.151181 I fscm.remote: connecting to host b-04.slug; may prompt for credentials
10:13:00.151781 I fscm.remote: connecting to host ssd-1.ccl; may prompt for credentials
@jamesob
jamesob / build-err.txt
Created May 28, 2023 14:17
master 7d33ae755de2bff806fe600bdaebedbd7fa67aba
#11 114.6 /usr/bin/ld: libbitcoin_util.a(libbitcoin_util_a-settings.o): in function `util::ReadSettings(fs::path const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, UniValue, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, UniValue> > >&, std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >&)':
#11 114.6 /usr/include/c++/8/bits/fs_ops.h:121: undefined reference to `std::filesystem::status(std::filesystem::__cxx11::path const&)'
#11 114.6 collect2: error: ld returned 1 exit status