Skip to content

Instantly share code, notes, and snippets.

View 0x5e's full-sized avatar

gaosen 0x5e

  • China, Zhejiang, Hangzhou
  • 21:09 (UTC +08:00)
View GitHub Profile
@0x5e
0x5e / passwall_watchdog.sh
Created July 1, 2023 16:46
OpenWrt passwall service watchdog. Auto restart service when tcp node dns resolve ip changed.
#!/bin/sh
# Run this script from cron every 10 minutes:
# echo '*/10 * * * * /path/to/passwall_watchdog.sh' >> /etc/crontabs/root
enabled=$(uci get passwall.@global[0].enabled)
tcp_node=$(uci get passwall.@global[0].tcp_node)
address=$(uci get passwall.$tcp_node.address)
previous_ip=$(uci get passwall.$tcp_node.ip 2>/dev/null)
current_ip=$(resolveip $address)
@0x5e
0x5e / camera-stream.go
Created March 4, 2024 14:41
bambu-go2rtc
// golang version of https://github.com/synman/bambu-go2rtc
// usage: ./camera-stream <accessCode> <hostname>
// with ffplay: ./camera-stream <accessCode> <hostname> | ffplay -hide_banner -fflags nobuffer -analyzeduration 10 -probesize 32 -i -
// tested on bambu lab a1 mini, the fps is really low for this device :(
package main
import (
"bytes"
"crypto/tls"