A 60MB travel router doesn't need xray — bare Shadowsocks with all-TCP DNS just works

My travel router is a LEDE 17.01 box (60MB RAM, MIPS) living behind the GFW. The "modern" stack — xray with DoH DNS and geoip routing, plus kcptun for UDP acceleration — ate ~45MB of RAM, lived on a USB stick, and kept zombifying after restarts. Meanwhile UDP on Chinese networks got worse every month: kcptun sessions died, UDP DNS relays never worked.

The fix was going backwards: bare shadowsocks-libev 3.2.1, global transparent proxy, DNS over TCP.

Global transparent proxy, no geoip — everything except private ranges rides the tunnel:

iptables -t nat -N SSRULE
for net in 0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 169.254.0.0/16 \
           172.16.0.0/12 192.168.0.0/16 224.0.0.0/4 240.0.0.0/4 \
           100.64.0.0/10 <server-ip>/32; do
  iptables -t nat -A SSRULE -d $net -j RETURN   # server-IP entry avoids a redirect loop
done
iptables -t nat -A SSRULE -p tcp -j REDIRECT --to-ports 12345
iptables -t nat -A PREROUTING -i br-lan -p tcp -j SSRULE
iptables -t nat -A OUTPUT -p tcp -j SSRULE

DNS without UDP relay is the clever bit. Unpoisoned DNS has to go through the tunnel, which normally means ss-tunnel's UDP relay — which silently fails on this MIPS box: it logs "listening" but no socket ever appears in netstat. Instead, OpenWrt's tiny dns-forwarder listens on UDP locally and queries upstream over TCP:

dns-forwarder -b 127.0.0.1 -p 1053 -s 8.8.8.8:53

dnsmasq forwards to 127.0.0.1#1053 as usual; the forwarder's TCP:53 packets hit the same REDIRECT rule and ride the tunnel. You get real answers — NXDOMAIN passes through untouched, something poisoned DNS never gives you. No UDP ever leaves the router.

Total cost: 490KB of binaries, embedded in internal flash (verified by unmounting the USB stick mid-run and pulling google in 1.3s), RAM down to 28MB, procd respawns everything if it dies, and boot just works.

Sometimes the modern stack is the problem, not the solution.

Fcitx5 + Rime on a 2015 Chromebook (postmarketOS): GTK_IM_MODULE=fcitx, not fcitx5

I just got Chinese input (wubi + pinyin via Rime) working on my ASUS C100P Flip Chromebook — postmarketOS edge, armv7, 2 GB RAM, MATE on X11. Two things made it real: a minimal package set, and one environment variable half the internet gets wrong.

Install is 10 packages:

doas apk add fcitx5 fcitx5-rime fcitx5-gtk3 fcitx5-gtk4

Resist the "install everything" reflex. On armv7, fcitx5-chinese-addons doesn't exist, fcitx5-configtool needs plasma6 (never built on armhf), and the old full chain dragged in qt6-qtwebengine, which pins icu-libs-76 — on Alpine edge that froze my nodejs at Node 22 (that icu standoff is exactly why I ripped the whole thing out months ago). Rime alone covers wubi and pinyin; my schemas/dictionaries live in my dotfiles repo and get symlinked into ~/.local/share/fcitx5/rime/, so fcitx5 deploys them on first start.

Then ~/.xprofile:

export GTK_IM_MODULE=fcitx      # NOT fcitx5
export QT_IM_MODULE=fcitx       # NOT fcitx5
export XMODIFIERS="@im=fcitx5"  # yes, this one really is fcitx5

The asymmetry is not a typo. Alpine's fcitx5-gtk registers the GTK input module under the id fcitx only — the widely-documented fcitx5 alias never connects. The symptom is maddening: tray icon alive, right-click menu works, even tray "Restart" works — but fcitx5-remote stays 0 (no input context has ever connected) no matter which window has focus, and no keystroke ever reaches the daemon.

Proof in 60 seconds, using zenity as a disposable GTK app and xdotool to tap Shift into it:

export DBUS_SESSION_BUS_ADDRESS="unix:path=$(ls /tmp/dbus-* | head -1)"
GTK_IM_MODULE=fcitx5 zenity --entry & sleep 2   # fcitx5-remote → 0, dead
GTK_IM_MODULE=fcitx  zenity --entry & sleep 2   # fcitx5-remote → 1
xdotool keydown Shift_L; sleep 0.05; xdotool keyup Shift_L   # → 2: rime active

fcitx5-remote states: 0 = no client ever connected, 1 = inactive, 2 = active. A focused GTK window that never lifts you off 0 is an env problem, not a daemon problem — stop restarting fcitx5 and fix the variable.

Two traps if you debug from an ssh/agent shell. First, fcitx5 started there inherits the shell's stale DBUS_SESSION_BUS_ADDRESS and becomes an orphan daemon on a dead bus, invisible to the GUI session — take the real bus from the session process: tr '\0' '\n' < /proc/$(pgrep -n mate-session)/environ | grep ^DBUS_. Second, environment is baked at process birth: mate-terminal windows are all spawned by a factory that inherited the session's env at login, so per-window fixes don't stick — .xprofile plus one logout/login is the only global cure (mate-terminal --disable-factory buys you a single standalone window meanwhile). After that, double-tap Shift toggles Rime and the dotfiles-managed wubi86/pinyin_simp schemas come up on first deploy.

五块钱的 mat

English

五块钱买不到吃亏,五块钱买不到上当,但五块钱能买到一直免费升级的 my ai team。

My AI Team(mat)不再按年订阅,改卖拷贝:一次付款,终生免费升级。

  • 今天 $5,每月涨 $1。 2026 年 11 月 12 日起价 $5,此后每月 12 日(UTC)涨 $1:12 月 12 日起为 $6。买得越早,付得越少。
  • 终身升级。 mat upgrade 轻松升级。正在运行的版本,即使不升级也永远也不会过期。
  • 一份一机。 换机器时,旧机运行 mat license deactivate,新机运行 mat activate。

每月 12 日涨 $1, $99.99 封顶:

成年人的世界,想要就下手。早买早享受,而且省钱。

购买地址:mat.shukelabs.com/buy。结账由 LemonSqueezy 处理,它是我们的代理销售商(merchant of record)。

为什么不再订阅

大实话:订阅卖得不好。开发工具升级的需求不迫切,ai时代,小 bug 自己就修了。但像my ai team这样好用的框架,从零开始复刻,不说token的钱,时间上你就不划算。所以我们不再搞订阅,我们让你买得踏实,让你买得没有后顾之忧。

五块钱买到什么

一个和你一起探索需求写票的Explorer agent。
一支不需要babysit的24小时高效工作的交付团队。你再也不用头痛交付的事情。你尽管挖坑,填坑交给交付团队就好。
你只管和Explorer对话开ticket。交付团队全自动的高质量的完成这些票。
最重要的,mat交付的产品仍是你的产品。你不会失去掌控。

mat 运行在你的计算机上,它访问你的 GitHub 仓库来读取并更新工单。交付agent自动认领就绪的工单,自动写开发计划并由独立评审审核计划,自动开worktree实现、开 PR,再自动由独立评审审查实现,仅在审查通过同时CI和测试全绿时才合并。在真正遇到麻烦或决策难题时,agent才通过 Telegram 向你询问意见。

一句话:你专注需求和验收,ai team专注于开票、交付和质量控制。

联系我们

文档 社区 TG群组

销售条款 退款政策

Tired of rotating your npm publish token? Let GitHub Actions publish without one

npm write tokens now live 90 days at most, so a CI job that publishes with NPM_TOKEN breaks every quarter until someone rotates the secret. Trusted publishing removes the secret: the workflow trades its GitHub OIDC token for a short-lived publish credential.

First, the publish job needs permission to mint an OIDC token, and npm 11.5.1 or newer:

jobs:
  publish:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      id-token: write
    steps:
      - uses: actions/setup-node@v4
        with:
          node-version: 22
          registry-url: https://registry.npmjs.org
      - run: npm install -g npm@11   # Node 22 ships an older npm
      - run: npm publish --access public
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}   # fallback, remove later

Keeping NODE_AUTH_TOKEN during the switch is safe: npm tries OIDC first and only falls back to the token when no trusted publisher matches.

Then tell the registry which workflow may publish each package. This takes npm 11.15.0 or newer and an interactive login with 2FA. A bypass-2FA automation token gets a 403 here.

NPM_CONFIG_BROWSER=false npx npm@latest login --auth-type=web
npx npm@latest trust github @your-scope/your-pkg \
  --repo your-org/your-repo --file release.yml --allow-publish --yes

NPM_CONFIG_BROWSER=false makes npm just print the login URL and poll. Without it, npm can stay stuck on its "Press ENTER to open in the browser" prompt even after you approve, and pressing ENTER does not release it. On the 2FA page, tick "don't challenge" so a loop over many packages does not prompt for each one; sleep a couple of seconds between calls to stay under rate limits.

A few things to know before you start:

  • --file is the workflow file name, not a path. If you rename the workflow, publishing breaks until you replace the trust entry.
  • A package can have only one trusted publisher, and it must already exist: publish a brand-new package's first version with a token, then add its trust entry. After that, new versions need nothing.

After the next release publishes cleanly through OIDC (public repos also get provenance, visible in npm view <pkg>@<ver> dist.attestations), delete the NODE_AUTH_TOKEN line and the repo secret, and revoke the token. From then on, nothing expires.

Switched to passkey/PIN sign-in and now can't RDP into your VM? Flip one .rdp line

Once your org moves to passwordless sign-in (passkey or Windows Hello PIN), the classic RDP credential prompt is a dead end: the remote VM has no passkey and no PIN, so there is nothing to type that it will accept.

The fix is one line in the .rdp file:

enablerdsaadauth:i:1

This is the "Use a web account to sign in to the remote computer" checkbox on the Advanced tab of mstsc. Instead of handing a password to the remote host, the client opens a Microsoft Entra web sign-in on your local machine, where the passkey/PIN actually lives, and passes the resulting token to the VM.

If an old .rdp file still fails after you tick the box in a fresh connection, look inside it. Files saved before the change usually don't omit the setting; they spell it out as disabled:

enablerdsaadauth:i:0

so it silently overrides your new default. Change the 0 to 1. Watch the encoding when editing by script: .rdp files can be UTF-8 with BOM or UTF-16LE, and a naive sed won't match UTF-16 text.

One caveat: this only works for hosts that accept your Entra account ([email protected]). A host that only knows a classic domain login (DOMAIN\user) will reject the web sign-in, so keep enablerdsaadauth:i:0 on those. Different hosts can legitimately need different values; don't "align" them.