Skip to content

Instantly share code, notes, and snippets.

View rithvikvibhu's full-sized avatar

Rithvik Vibhu rithvikvibhu

View GitHub Profile
// Based on: https://gist.github.com/pinheadmz/b51a6ee3c1b414bd7d053951b83f6162
// USAGE: hsd --log-console=false --plugins=/path/to/this/file/shakedex-scan-plugin.js
'use strict';
const layout = require('hsd/lib/blockchain/layout');
const TXMeta = require('hsd/lib/primitives/txmeta');
const { LOCKTIME_FLAG } = require('hsd/lib/protocol/consensus');
// node list-transferring-names.js
const { NodeClient, WalletClient } = require('hs-client');
const { Network } = require('hsd');
// Edit these:
const NETWORK = 'main';
const API_KEY = 'api-key-here';
const WALLET_NAME = 'walletname';
// run: node api-key.js
const os = require('node:os');
const path = require('node:path');
const bdb = require('bdb');
const BOB_DB_LOC = path.join(os.homedir(), '.config/Bob/db');
const WALLET_API_KEY = 'walletApiKey';
const NODE_API_KEY = 'nodeApiKey';
@rithvikvibhu
rithvikvibhu / test-tx-for-swap.sh
Last active March 28, 2023 17:50
test-tx-for-swap.sh
# Check if a tx is an atomic name swap (Bob atomic swap, Shakedex sale, FxWallet marketplace sale)
# Bob swap (HIP-4) hints:
# - in0.witness[0] ends with 84
# - last output value = price
# - out0 = FINALIZE
# Shakedex (HIP-1) transfer hints:
# - in0.witness[0] ends with 84
# - last output value = price
/**
* This script finds an address given an account extended public key
* Usage: edit these fields below and run it like `node find-address.js`
*/
const assert = require('node:assert/strict');
const HDPublicKey = require('hsd/lib/hd/public');
const Address = require('hsd/lib/primitives/address');
// **********
@rithvikvibhu
rithvikvibhu / missing-blind-bids.js
Last active June 20, 2023 18:56
missing-blind-bids.js
const { WalletClient } = require('hs-client');
const { Network } = require('hsd');
// Edit these:
const NETWORK = 'main';
const API_KEY = 'apikey';
const WALLET_NAME = 'walletname';
/** @type {import('hsd/lib/protocol/network')} */
These nodes have been online on both 1st June 2022 and 9th June 2022 and are likely to stay online for a longer time:
107.152.32.250
107.152.33.71
129.153.177.220
129.213.167.123
138.197.52.107
139.59.211.187
140.238.196.136
142.132.235.25
# Usage
#
# Install dependencies:
# $ pip install selenium beautifulsoup4
# Run:
# $ python download-gtlds-applications.py
import json
from selenium import webdriver
from selenium.webdriver.common.by import By
@rithvikvibhu
rithvikvibhu / index.md
Created March 3, 2024 06:47
Securing websites with Stateless DANE using certbot

Securing websites with Stateless DANE using certbot

Caddy is the recommended and easiest way to set this up (guide here), but HTools ACME works with any client including certbot.

Assuming nginx here, but any target certbot supports will work.

Website Setup

Get a regular web server running as usual. simple nginx config:

@rithvikvibhu
rithvikvibhu / README.md
Last active April 12, 2024 15:32
GHLocalApi Update

GHLocalApi Update

The Gist

Until recently, the Google Home app used to communicate with the device over port 8008 (HTTP) and did not require any authentication. Everything in the unofficial documentation worked as expected.

A few days (weeks) ago, Google pushed a new update to all GH devices and all endpoints (except /setup/eureka_info) started returning 403 (forbidden) errors. The app had switched over to port 8443 and HTTPS.