This is a SCRIPT-8 cassette.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function LFSR(len, seed, mask=0x80000057) { | |
/** == Linear Feedback Shift Register == | |
* Javascript implementation of a LFSR function using bitwise operators. | |
* Default mask uses optimal XOR taps for a 32-bit integer, which is the | |
* limit for bitwise operations in javascript. | |
* | |
* | |
* @param {Number} [length] : Length of number in bytes. | |
* @param {Number} [seed] : The starting seed for the shift register. | |
* @param {Number} [mask] : Mask to use for mapping XOR taps. Default is 0x80000057, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" [Install Nvim] | |
" wget --quiet https://github.com/neovim/neovim/releases/download/nightly/nvim.appimage --output-document nvim | |
" [Set permissions and move to bin folder] | |
" chmod +x nvim && sudo chown root:root nvim && sudo mv nvim /usr/bin | |
" [Create user config folder] | |
" touch -p ~/.config/nvim/init.vim | |
" [Install optional Python module] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
from pathlib import Path | |
import argparse, requests, json | |
def postGist(filename, tokenfile, desc='', public=False): | |
""" Post a file to Github as a gist. """ | |
content = Path(filename).read_text() | |
token = Path(tokenfile).read_text().replace('\n', '') | |
url = 'https://api.github.com/gists' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import argparse, csv, json, os, re, sys, importlib.util | |
from datetime import datetime | |
class csvTool: | |
def __init__(self, filename, limit=0, script=None, query=None): | |
self.cwd = os.getcwd() | |
self.name = filename.split('.')[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## Format credentials as lndconnect URL and generate QR code. | |
## Requires qrencode package. | |
HOST_ADDR="ADDRESS:PORT" | |
HOST_CERT=`cat /path/to/certificate.pem | sed '1d;$d' | tr -d '=' | tr '/+' '_-' | tr -d '\n'` | |
MACAROON=`base64 /path/to/access.macaroon | tr -d '=' | tr '/+' '_-' | tr -d '\n'` | |
echo "lndconnect://$HOST_ADDR?cert=$HOST_CERT&macaroon=$MACAROON" | qrencode -o /path/to/save/qrcode.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## Bind a local port and forward its traffic to an onion address. | |
## Requires socat to be installed, and a tor proxy to be running. | |
############################################################################### | |
# Environment | |
############################################################################### | |
SOCKS_HOST="127.0.0.1" | |
SOCKS_PORT="9050" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## POSIX compliant script for generating Bitcoin RPC credentials. | |
## Requires xxd and openssl packages to be installed. | |
## Distributed under the MIT software license. | |
############################################################################### | |
# Environment | |
############################################################################### | |
RPCAUTH_USER="bitcoin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## Takes an input pipe of JSON, and outputs the value for a given key. | |
set -e | |
usage() { | |
printf " | |
Takes an input pipe of JSON, and outputs the value for a given key. \n | |
Usage: some_JSON_output | jgrep key \n | |
" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { webcrypto as crypto } from 'crypto'; | |
const IV_LENGTH = 16, // Length of init vector. | |
SECRET_KEY = process.env.SECRET_KEY; | |
let cryptoKey; // Cached CryptoKey object. | |
export async function encrypt(plaintext) { | |
/* Encrypt a string using the server's encryption key. */ | |
const ec = new TextEncoder(), |
OlderNewer