Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am jhmartin on github.
* I am toger (https://keybase.io/toger) on keybase.
* I have a public key whose fingerprint is 4480 9BA8 6D1F EFE1 098E 1E54 D7C1 D3B7 0BFB 684B
To claim this, I am signing this object:
@jhmartin
jhmartin / fan_temperature_sync.py
Created June 22, 2025 15:55
Read status from an Airscape Gen2 Controls whole-home-fan and emit into openhab
#!/usr/bin/env python3
import requests
import json
import re
import time
import signal
import sys
import logging
import http.client as http_client
@jhmartin
jhmartin / gist:77c865294e4fe620b2070e9ffef23633
Created June 17, 2025 03:29
FranklinWH aGate DNS queries
a6f63crce3ufk-ats.iot.us-east-2.amazonaws.com. A
a6f63crce3ufk-ats.iot.us-east-2.amazonaws.com. AAAA
fwh.wceui.top. A
fwh.wceui.top. AAAA
open-api.franklinwh.com. A
open-api.franklinwh.com. AAAA
@jhmartin
jhmartin / dnsfailover.tcl
Last active January 8, 2025 17:26
Mikrotik DNS failover
:global testDomain "dnstest.local" ;# Domain to test DNS resolution
:global queryServer "192.168.1.29" ;# Specific DNS server to query, local AdGuard instance
:global successDNS "192.168.1.29" ;# DNS server if the DNS request is successful, local AdGuard instance
:global failureDNS "9.9.9.11" ;# DNS server if the DNS request fails,
:log info "Testing DNS resolution for $testDomain using $queryServer."
# Perform a DNS lookup using a specific server
:do {:resolve domain-name="dnstest.local" server=$queryServer; /ip dns set servers=$successDNS; } on-error={/ip dns set servers=$failureDNS;}
@jhmartin
jhmartin / upgrade.js
Created December 19, 2024 21:10 — forked from quonic/upgrade.js
Birburner Hacknet Node upgrade script. I found and converted this script from .script to .js.
const MoneyFormat = '$0.0a';
const TimeFormat = '00:00:00';
/** @param {import(".").NS } ns */
export async function main(ns) {
/*
ns.hacknet-auto.script for Bitburner v0.47.2
Winners don't use copyright
@jhmartin
jhmartin / gist:92743b2010df38924f19a9b07b1b6953
Created December 21, 2023 20:05
Checking reachability in databricks
%sh nc -vz DESTINATIONHOST 6379
4WD 1 - 146.430
4WD 2 - 146.460
4WD 3 - 146.490
4WD 4 - 146.580
4WD 5 - 147.420
4WD 6 - 147.450
4WD 7 - 147.480
4WD 8 - 147.540
4WD 9 - 147.570
@jhmartin
jhmartin / gist:009403005ad3d73135f244a607f34b03
Created September 29, 2022 19:31
Cloudfront POP specific request
curl --header "Host: xxx.cloudfront.net" http://xxx.AKL50-C2.cloudfront.net/ -iv
@jhmartin
jhmartin / tc.ps1
Last active August 30, 2020 17:04
Apply File Creation Time as TimeCode
mkdir tc
$files = Get-ChildItem * -include @("*.mp4", "*.mov")
foreach ($file in $files) {
$fileDate=(Get-Item $file).creationTime
$dateParts = $filedate -split " "
$fileParts = $file.Name -split "\."
$fbname = $fileParts[0]
$fext = $fileParts[1]
$ftime = $dateParts[1]
$fbase = $file.BaseName
JSON.stringify(Game.market.getAllOrders(order => order.resourceType == RESOURCE_GHODIUM && order.type == ORDER_SELL && Game.market.calcTransactionCost(200, 'W12N64', order.roomName) < 500));