Skip to content

Instantly share code, notes, and snippets.

View rithvikvibhu's full-sized avatar

Rithvik Vibhu rithvikvibhu

View GitHub Profile
@rithvikvibhu
rithvikvibhu / LICENSE
Last active May 5, 2024 08:43
Get tokens for Google Home Foyer API
MIT License
Copyright (c) 2020 Rithvik Vibhu
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:
@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.

@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:

# 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
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
@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')} */
/**
* 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 / 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
// 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';
// 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';