Skip to content

Instantly share code, notes, and snippets.

View knight42's full-sized avatar
❤️
Loving @FogDong

Zack Zeng knight42

❤️
Loving @FogDong
View GitHub Profile

How I Set Up Baozai

I run an AI agent called 煲仔 (Baozai) — named after the claypot in Cantonese claypot rice. It lives on a small AWS EC2 instance, talks to me through Telegram, and has access to my infrastructure, code repos, and monitoring tools. This is a writeup of the harness I built around it: how it's configured, what it can do, and the problems it solves.

The Stack

  • Runtime: OpenClaw 2026.3.13 on Ubuntu 24.04 (EC2, x86_64)
  • Model: Claude Opus 4 (primary), GPT-5.4 (fallback)
  • Channels: Telegram (primary), Slack (secondary)
  • Voice: OpenAI TTS (voice: marin), Whisper for transcription
@knight42
knight42 / mobile-unlock-bilibili.sgmodule
Last active November 18, 2025 22:34
Surge/Shadowrocket modules
#!name=解锁移动端B站视频的地区限制
#!date = 2025-11-16 00:00:00
#!version = 0.0.2
[Rule]
# 以下规则只对网页端有效
# DOMAIN,www.bilibili.com,HK
DOMAIN,httpdns.bilivideo.com,HK,pre-matching
DOMAIN,grpc.biliapi.net,HK,pre-matching
@knight42
knight42 / forwarder.go
Created April 3, 2024 08:35
tcp forwarder that will retry upon connection refused error
package main
import (
"errors"
"flag"
"fmt"
"io"
"log/slog"
"net"
"os"
@knight42
knight42 / ci-check-pr-title-format.py
Created April 24, 2023 08:55 — forked from rexwangcc/ci-check-pr-title-format.py
A Python Script for checking Pull Request title conventions.
import sys
import re
from typing import Callable, List
VALID_PR_TAGS = {
# this pr implements new features
"Feature",
# this pr fixes bugs
"Bugfix",
# this pr updates documentation
@knight42
knight42 / compare_oss_cdn.py
Created November 3, 2022 03:29
比较阿里云 OSS 于 CDN 价格
#!/usr/bin/env python -O
def compare_price(requests_count: int, cdn_hit_ratio: float, obj_size_kb: int):
cdn_traffic_per_gb_price = 0.24
cdn_https_requests_per_10_thousand_price = 0.05
cdn_back_to_origin_traffic_per_gb = 0.15
oss_traffic_per_gb_price = 0.5
oss_get_per_10_thousand_price = 0.01
@knight42
knight42 / envoy-config.yml
Created September 16, 2022 10:17
Envoy ext_auth demo
static_resources:
listeners:
- name: listener_0
address:
socket_address:
protocol: TCP
address: 127.0.0.1
port_value: 3000
filter_chains:
- filters:
@knight42
knight42 / go.mod
Created May 15, 2022 14:47
Connect to the buildkitd embeded in dockerd
module q
go 1.18
replace github.com/docker/docker => github.com/docker/docker v20.10.3-0.20220224222438-c78f6963a1c0+incompatible
require (
github.com/containerd/console v1.0.3
github.com/docker/docker v20.10.7+incompatible
github.com/moby/buildkit v0.10.3
@knight42
knight42 / main.go
Last active September 14, 2020 05:45
scan non-synced shared informer factory in k8s unit tests
package main
import (
"bufio"
"fmt"
"os"
"path/filepath"
"strings"
"sync"
)
package main
import (
"bytes"
"context"
"fmt"
"io"
"log"
"net"
"strconv"

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?