Skip to content

Instantly share code, notes, and snippets.

View RandyMcMillan's full-sized avatar
🛰️
Those who know - do not speak of it.

@RandyMcMillan RandyMcMillan

🛰️
Those who know - do not speak of it.
View GitHub Profile
@cwgem
cwgem / build_guide.md
Last active January 13, 2025 18:12
Building `dockerd` and `docker-cli` from source

Introduction

This guide looks at what it will take to build dockerd and docker-cli from source with Ubuntu. Ubuntu was chosen as the OS as it uses the same apt-get calls the standard Dockerfile method uses making the experience a bit more seamless. While the official method is building docker in a container, here are some reasons why you may want to build this way:

  • Custom source modifications for testing
  • System that does not yet have a docker(d) binary release
  • You want to test things on a non-standard toolchain
  • You just want to deep dive

As you can probably tell using this method means you're delving away from support. Please don't file issues/PRs unless you can reproduce in the official build environment. In fact unless you really have one of the strong needs above you're better off building off a container since this guide is mostly a lot of copy/paste from the Dockerfile used in the official build system.

@arik-so
arik-so / schnorr_signature.js
Last active November 5, 2022 17:48
Schnorr Experimenting
const ecurve = require('ecurve');
let secp256k1 = ecurve.getCurveByName('secp256k1');
const BigInteger = require('bigi');
const crypto = require('crypto');
const calculateHash = (R, P, message) => {
const hashPreimage = Buffer.concat([R.getEncoded(true), P.getEncoded(true), Buffer.from(message, 'utf-8')]);
return BigInteger.fromHex(crypto.createHash('sha256').update(hashPreimage).digest('hex')).mod(secp256k1.n);
};
@arik-so
arik-so / pedersen_commitment.js
Last active November 5, 2022 17:49
Javascript Pedersen Commitment Experiment
const BigInteger = require('bigi');
const _ = require('lodash');
const prova = require('prova-lib');
const crypto = require('crypto');
const ecurve = require('ecurve');
let secp256k1 = ecurve.getCurveByName('secp256k1');
/**
@laanwj
laanwj / moonphase.py
Last active September 15, 2022 14:46
#!/usr/bin/python3
import datetime
import bisect
import ephem
DAY = 1.0/29.33
MOONPHASE = [
(0.0/4.0 + DAY, '🌑', 'New moon'),
(1.0/4.0 - DAY, '🌒', 'Waxing crescent moon'),
(1.0/4.0 + DAY, '🌓', 'First quarter moon'),
@ecurrencyhodler
ecurrencyhodler / (Deprecated)LTC-Lightning-Network-lnd-Guide (Mac).md
Last active December 18, 2023 02:32
This is a step-by-step main net tutorial on how to setup a lightning network node for Litecoin on a Mac. It will take you from the beginning all the way through to becoming visible on a ln explorer. To send or recieve payments, refer to "Basic lnd Commands."

LTC-Lightning-Network-lnd-Guide

This is a step-by-step main net tutorial on how to setup a Lightning Network node for Litecoin on a Mac. It is specifically for the lnd client by the Lightning Labs. You can copy and paste most of the commands except for the times I've indicated in bold for you to input your own information. It would also be a good idea to backup your computer prior to starting just in case you need to start over.

Below is a legend. Refer to it as you come across terms or symbols you don’t understand. The first part of the tutorial is taken from the lnd github. However, everything else is written with the help of Patrick Walters taking me step by step through the process.

Legend

$ = This symbol means 1 line of code. Do not type “$” into your terminal. Simply input what follows then push enter.

Pubkey = Short for the public key that is generated from the private key w

@wolfmcnally
wolfmcnally / WolfMcNally.md
Last active April 30, 2025 09:39
A List-Oriented Summary of My Professional Background

Wolf McNally

A List-Oriented Summary of My Professional Background

(Turing Complete) Programming Languages In Which I Have Worked Professionally

  • 6502 assembly
  • 68000 assembly
  • Apple Integer BASIC
  • AppleScript
@MattSandy
MattSandy / app.js
Last active January 20, 2024 15:57
Tweet Scraper in Node.JS
var Twitter = require('node-tweet-stream')
, t = new Twitter({
consumer_key: '',
consumer_secret: '',
token: '',
token_secret: ''
});
var watch = [
"SB52",
"SBLII",
@tomdaley92
tomdaley92 / makefile
Last active January 25, 2025 09:24
Generic makefile for C/C++ programs
# Thomas Daley
# September 13, 2021
# A generic build template for C/C++ programs
# executable name
EXE = app
# C compiler
CC = gcc
@AlwaysBCoding
AlwaysBCoding / notes.js
Created December 3, 2017 22:49
DecypherTV (Youtube) - Bitcoin Screencast
// Create a new directory, install bitcore-explorers, and run the node shell
mkdir bitcoin && cd bitcoin
npm install --save bitcore-explorers
node
// Require the Bitcore libraries into the global namespace
var bitcore = require(“bitcore-lib”)
var explo = require(“bitcore-explorers”)
var shell = {}

Network partition resistance

For the Bitcoin network to remain in consensus, the network of nodes must not be partitioned. So for an individual node to remain in consensus with the network, it must have at least one connection to that network of peers that share its consensus rules. This document describes how we attempt to achieve this.

We can't rely on inbound peers to be honest, because they are initiated by others. It's impossible for us to know, for example, whether all our inbound peers are controlled by the same adversary.