Setting up 3x-ui server at home internet on IPv6 without dedicated VPS

Home internet with Native IPv6 on. Enable IPv6 on NBN provider at first, then test IPv6 by visiting https://test-ipv6.com/ or https://ipv6test.google.com/, checking IP info at https://ifconfig.co/.

Register your account at ClouDNS https://www.cloudns.net/ and receive a FREE DNS domain e.g. igloo-proxy.cloud-ip.cc. Then add a AAAA type DNS record points to your x3-ui https://github.com/MHSanaei/3x-ui server’s IPv6:

1
2
3
# x3-ui server
$ curl -6 https://ifconfig.co
2401:d002:c51c:1219:d5c2:e48d:73b5:976b

Install the latest version x3-ui:

1
$ bash <(curl -Ls https://raw.githubusercontent.com/mhsanaei/3x-ui/master/install.sh) v3.7.0

Generate Let’s Encrypt https://letsencrypt.org/ SSL certifidate:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
╔───────────────────────────────────────────────╗
│ 3X-UI Panel Management Script │
│ 0. Exit Script │
│───────────────────────────────────────────────│
│ 1. Install │
│ 2. Update │
│ 3. Update to Dev Channel (latest commit) │
│ 4. Update Menu │
│ 5. Legacy Version │
│ 6. Uninstall │
│───────────────────────────────────────────────│
│ 7. Reset Username & Password │
│ 8. Reset Web Base Path │
│ 9. Reset Settings │
│ 10. Change Port │
│ 11. View Current Settings │
│───────────────────────────────────────────────│
│ 12. Start │
│ 13. Stop │
│ 14. Restart │
| 15. Restart Xray │
│ 16. Check Status │
│ 17. Logs Management │
│───────────────────────────────────────────────│
│ 18. Enable Autostart │
│ 19. Disable Autostart │
│───────────────────────────────────────────────│
│ 20. SSL Certificate Management │
│ 21. Cloudflare SSL Certificate │
│ 22. IP Limit Management │
│ 23. Firewall Management │
│ 24. SSH Port Forwarding Management │
│ 25. PostgreSQL Management │
│───────────────────────────────────────────────│
│ 26. Enable BBR │
│ 27. Update Geo Files │
│ 28. Speedtest by Ookla │
╚───────────────────────────────────────────────╝

Panel state: Running
Start automatically: Yes
xray state: Running

Please enter your selection [0-28]: 20
1. Get SSL (Domain)
2. Revoke & Remove
3. Force Renew
4. Show Existing Domains
5. Set Cert paths for the panel
6. Get SSL for IP Address (6-day cert, auto-renews)
0. Back to Main Menu
Choose an option: 1
acme.sh could not be found. we will install it
[INF] Installing acme.sh...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 270k 100 270k 0 0 1271k 0 --:--:-- --:--:-- --:--:-- 1277k
[Thu Aug 27 09:10:20 AM AEST 2026] Installing from online archive.
[Thu Aug 27 09:10:20 AM AEST 2026] Downloading https://github.com/acmesh-official/acme.sh/archive/master.tar.gz
[Thu Aug 27 09:10:20 AM AEST 2026] Extracting master.tar.gz
[Thu Aug 27 09:10:21 AM AEST 2026] Installing to /root/.acme.sh
[Thu Aug 27 09:10:21 AM AEST 2026] Installed to /root/.acme.sh/acme.sh
[Thu Aug 27 09:10:21 AM AEST 2026] Installing alias to '/root/.bashrc'
[Thu Aug 27 09:10:21 AM AEST 2026] Close and reopen your terminal to start using acme.sh
[Thu Aug 27 09:10:21 AM AEST 2026] Installing cron job
[Thu Aug 27 09:10:21 AM AEST 2026] bash has been found. Changing the shebang to use bash as preferred.
[Thu Aug 27 09:10:21 AM AEST 2026] OK
[Thu Aug 27 09:10:21 AM AEST 2026] Install success!
[INF] Installation of acme.sh succeeded.
[INF] install socat succeed...
Please enter your domain name: igloo-proxy.cloud-ip.cc
[DEG] Your domain is: igloo-proxy.cloud-ip.cc, checking it...
[INF] Your domain is ready for issuing certificates now...
Please choose which port to use (default is 80):
[INF] Will use port: 80 to issue certificates. Please make sure this port is open.
[Thu Aug 27 09:11:29 AM AEST 2026] Changed default CA to: https://acme-v02.api.letsencrypt.org/directory
[Thu Aug 27 09:11:30 AM AEST 2026] Using CA: https://acme-v02.api.letsencrypt.org/directory
[Thu Aug 27 09:11:30 AM AEST 2026] Standalone mode.
[Thu Aug 27 09:11:30 AM AEST 2026] Account key creation OK.
[Thu Aug 27 09:11:30 AM AEST 2026] Registering account: https://acme-v02.api.letsencrypt.org/directory
[Thu Aug 27 09:11:31 AM AEST 2026] Registered
[Thu Aug 27 09:11:31 AM AEST 2026] ACCOUNT_THUMBPRINT='b5K6u4GCPMvP6jtVrI78pAl9YUrShU2Z8porK76hyr8'
[Thu Aug 27 09:11:31 AM AEST 2026] Creating domain key
[Thu Aug 27 09:11:31 AM AEST 2026] The domain key is here: /root/.acme.sh/igloo-proxy.cloud-ip.cc_ecc/igloo-proxy.cloud-ip.cc.key
[Thu Aug 27 09:11:31 AM AEST 2026] Single domain='igloo-proxy.cloud-ip.cc'
[Thu Aug 27 09:11:33 AM AEST 2026] Getting webroot for domain='igloo-proxy.cloud-ip.cc'
[Thu Aug 27 09:11:33 AM AEST 2026] Verifying: igloo-proxy.cloud-ip.cc
[Thu Aug 27 09:11:33 AM AEST 2026] Standalone mode server
[Thu Aug 27 09:11:34 AM AEST 2026] Pending. The CA is processing your order, please wait. (1/30)
[Thu Aug 27 09:11:38 AM AEST 2026] Pending. The CA is processing your order, please wait. (2/30)
[Thu Aug 27 09:11:41 AM AEST 2026] Success
[Thu Aug 27 09:11:41 AM AEST 2026] Verification finished, beginning signing.
[Thu Aug 27 09:11:41 AM AEST 2026] Let's finalize the order.
[Thu Aug 27 09:11:41 AM AEST 2026] Le_OrderFinalize='https://acme-v02.api.letsencrypt.org/acme/finalize/3489265815/549901388765'
[Thu Aug 27 09:11:44 AM AEST 2026] Downloading cert.
[Thu Aug 27 09:11:44 AM AEST 2026] Le_LinkCert='https://acme-v02.api.letsencrypt.org/acme/cert/06e0b6dbe51ac7d51573cf84994ca71741ad'
[Thu Aug 27 09:11:44 AM AEST 2026] Cert success.
-----BEGIN CERTIFICATE-----
MIIDnzCCAyWgAwIBAgISBuC22+UZGNUVc8+EmUynF0GtMAoGCCqGSM49BAMDMDMx
...
2Ao/mUvkOPylsT42LE2vRnQCMBpDXfkcxsNWkiiWZxogKC6lahRpe7yz873EZLfE
UUvAgAJ0INTMnqtKw15Eg8xyGw==
-----END CERTIFICATE-----
[Thu Aug 27 09:11:44 AM AEST 2026] Your cert is in: /root/.acme.sh/igloo-proxy.cloud-ip.cc_ecc/igloo-proxy.cloud-ip.cc.cer
[Thu Aug 27 09:11:44 AM AEST 2026] Your cert key is in: /root/.acme.sh/igloo-proxy.cloud-ip.cc_ecc/igloo-proxy.cloud-ip.cc.key
[Thu Aug 27 09:11:44 AM AEST 2026] The intermediate CA cert is in: /root/.acme.sh/igloo-proxy.cloud-ip.cc_ecc/ca.cer
[Thu Aug 27 09:11:44 AM AEST 2026] And the full-chain cert is in: /root/.acme.sh/igloo-proxy.cloud-ip.cc_ecc/fullchain.cer
[Thu Aug 27 09:11:45 AM AEST 2026] ARI suggestedWindow: 2026-10-25T00:57:16Z to 2026-10-26T20:08:06Z
[Thu Aug 27 09:11:45 AM AEST 2026] Next renewal time picked from ARI window: 2026-10-26T07:45:41Z
[INF] Your reloadcmd is: systemctl reload nginx ; x-ui restart
[Thu Aug 27 09:14:30 AM AEST 2026] The domain 'igloo-proxy.cloud-ip.cc' seems to already have an ECC cert, let's use it.
[Thu Aug 27 09:14:30 AM AEST 2026] Installing key to: /root/cert/igloo-proxy.cloud-ip.cc/privkey.pem
[Thu Aug 27 09:14:30 AM AEST 2026] Installing full chain to: /root/cert/igloo-proxy.cloud-ip.cc/fullchain.pem
[INF] Installing certificate succeeded, enabling auto renew...
[Thu Aug 27 09:14:30 AM AEST 2026] Already up to date!
[Thu Aug 27 09:14:30 AM AEST 2026] Upgrade successful!
[INF] Auto renew succeeded, certificate details:
cert/igloo-proxy.cloud-ip.cc:
total 20K
drwxr-xr-x 2 root root 4.0K Aug 27 09:14 .
drwxr-xr-x 5 root root 4.0K Aug 27 09:11 ..
-rw-r--r-- 1 root root 4.8K Aug 27 09:14 fullchain.pem
-rw------- 1 root root 227 Aug 27 09:14 privkey.pem
Would you like to set this certificate for the panel? (y/n): y
set certificate public key success
set certificate private key success
set certificate for subscription public key success
set certificate for subscription private key success
[INF] Panel paths set for domain: igloo-proxy.cloud-ip.cc
[INF] - Certificate File: /root/cert/igloo-proxy.cloud-ip.cc/fullchain.pem
[INF] - Private Key File: /root/cert/igloo-proxy.cloud-ip.cc/privkey.pem

Get the Dynamic URL of domain igloo-proxy.cloud-ip.cc, then add cron job to update DNS Server with the Dynamic IP Address:

1
2
3
4
# crontab -l
# ClouDNS - Update Dynamic IPv6 address for domain "igloo-proxy.cloud-ip.cc"
*/5 * * * * curl -6 -s "https://ipv6.cloudns.net/api/dynamicURL/?q=MTQ ... GE" >> /var/log/cloudns-ddns.log 2>&1
21 4,10,16,22 * * * "/root/.acme.sh"/acme.sh --cron --home "/root/.acme.sh" > /dev/null

Login x3-ui panel. Setup Inbound:

3x-ui Inbound Basics

Min Client Ver option needs to set to 1.0.0 to be compatible with OpenClash on mini router:

3x-ui Inbound Security

Setup Client:

3x-ui Client Basics

Flow option must be xtls-rprx-vision:

3x-ui Client Credentials

Finally, add 3x-ui Clash subscription URL e.g. https://igloo-proxy.cloud-ip.cc:2096/clash/y33m9a0rgih5z01 into OpenClash:

OpenClash Panel

OpenClash IPv6

References

  • 波仔分享 - 未来还能继续翻墙吗?2026最新VPS自建节点搭建教程!科学上网翻墙从零开始,VPS线路详解!VLESS+Reality,搬瓦工CN2 GIA实测8K/奈飞4K,V2RayN与Clash配置全流程!https://www.youtube.com/watch?v=D7huCXwVuLo
  • 2026最新VPS自建节点搭建教程!科学上网翻墙从零开始,VPS线路详解!VLESS+Reality,搬瓦工CN2 GIA实测8K/奈飞4K,V2RayN与Clash配置全流程,小白保姆级教程!https://v2rayssr.com/me-reality.html

Unlock GL.iNet GL-MT3600BE Beryl 7 Global firmware

GL.iNet GL-MT3600BE Beryl 7 Dual-Band Wi-Fi 7 Travel Router, coming with Chinese/CN firmware.

GL.iNet GL-MT3600BE Beryl 7 Dual-Band Wi-Fi 7 Travel Router

Start up router, and go to http://192.168.8.1/ and login.

GL.iNet GL-MT3600BE Dashboard

  • SSH into router
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ ssh -l root 192.168.8.1
** WARNING: connection is not using a post-quantum key exchange algorithm.
** This session may be vulnerable to "store now, decrypt later" attacks.
** The server may need to be upgraded. See https://openssh.com/pq.html
root@192.168.8.1's password:

BusyBox v1.33.2 (2026-08-06 10:25:08 UTC) built-in shell (ash)

_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 21.02-SNAPSHOT,
-----------------------------------------------------
  • Identify the Factory Partition
1
2
3
4
5
6
7
8
9
10
root@GL-MT3600BE:~# cat /proc/mtd
dev: size erasesize name
mtd0: 20000000 00040000 "spi1.0"
mtd1: 00100000 00040000 "BL2"
mtd2: 00080000 00040000 "u-boot-env"
mtd3: 00400000 00040000 "Factory"
mtd4: 00200000 00040000 "FIP"
mtd5: 00040000 00040000 "log"
mtd6: 00040000 00040000 "CFG"
mtd7: 1d800000 00040000 "ubi"

The partition named “Factory” is mtd3, so the partition is mtdblock3.

  • Find the “CN” (Chinese) Offset
1
2
root@GL-MT3600BE:~# hexdump -v -e '"%_ad: " 16/1 "%02X " "\n"' /dev/mtdblock3 | grep "43 4E"
16512: 00 00 00 00 00 00 00 00 43 4E 00 00 00 00 00 00
  • Verify the “CN” Offset
1
2
root@GL-MT3600BE:~# dd if=/dev/mtdblock3 bs=1 skip=16520 count=2 2>/dev/null
CN
  • Overwrite region from “CN” to “US”
1
2
3
root@GL-MT3600BE:~# echo -n "US" | dd of=/dev/mtdblock3 bs=1 seek=16520 count=2 conv=notrunc
2+0 records in
2+0 records out
  • Sycn and Reboot
1
2
3
4
5
root@GL-MT3600BE:~# sync

root@GL-MT3600BE:~# reboot
root@GL-MT3600BE:~# Connection to 192.168.8.1 closed by remote host.
Connection to 192.168.8.1 closed.
  • Verify the “US” Offset
1
2
3
4
5
root@GL-MT3600BE:~# hexdump -v -e '"%_ad: " 16/1 "%02X " "\n"' /dev/mtdblock3 | grep ^16512:
16512: 00 00 00 00 00 00 00 00 55 53 00 00 00 00 00 00

root@GL-MT3600BE:~# dd if=/dev/mtdblock3 bs=1 skip=16520 count=2 2>/dev/null
US

GL.iNet GL-MT3600BE Applications

GL.iNet GL-MT3600BE Toggle Button Settings

GL.iNet GL-MT3600BE VPN

  • After the change on GL.iNet Mobile

GL.iNet GL-MT3600BE Plugins

GL.iNet GL-MT3600BE Toggle Button Settings Mobile

NOTE: Disable IPv6 when install iStoreOS, e.g. from GL-iNet 系列路由器一键 iStoreOS 风格化脚本 https://github.com/wukongdaily/gl-inet-onescript

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$ sh -c "$(curl -fsSL https://cafe.cpolar.cn/wkdaily/gl/raw/branch/main/mt3600.sh)"

***********************************************************************
* 一键安装工具箱(for gl-inet MT3600BE) by @wukongdaily
**********************************************************************
*******支持的机型列表***************************************************
*******GL-iNet MT3600BE********

1. GL-iNet MT3600BE 一键iStoreOS风格化

2. 安装argon紫色主题

3. 单独安装iStore商店

4. 隐藏首页格式化按钮

5. 设置风扇工作温度

6. 安装个性化UI辅助插件(by VMatrices)

7. 恢复出厂设置/重置路由器

Q. 退出本程序

请选择一个选项:

GL.iNet GL-MT3600BE Services

References

MediaTek MT7925 Bluetooth stops working / turning on on Ubuntu 26.04 LTS

MediaTek MT7925 is an M.2 Wi-Fi 7 and Bluetooth 5.4 wireless network card which Wireless and BlueTooth are both supported by the latest Linux Kernel.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$ uname -r
7.0.0-22-generic

$ lspci -k | grep -i -A3 network
01:00.0 Network controller: MEDIATEK Corp. MT7925 802.11be 160MHz 2x2 PCIe Wireless Network Adapter [Filogic 360]
Subsystem: MEDIATEK Corp. MT7925 802.11be 160MHz 2x2 PCIe Wireless Network Adapter [Filogic 360]
Kernel driver in use: mt7925e
Kernel modules: mt7925e
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller (rev 0c)

$ lsusb | grep -i mediatek
Bus 003 Device 002: ID 0e8d:7925 MediaTek Inc. Wireless_Device

$ rfkill list
0: hci0: Bluetooth
Soft blocked: no
Hard blocked: no
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no

$ ls -al /lib/firmware/mediatek/mt7925/
...
-rw-r--r-- 1 root root 459528 Mar 19 23:32 BT_RAM_CODE_MT7925_1_1_hdr.bin.zst
-rw-r--r-- 1 root root 197811 Mar 19 23:32 WIFI_MT7925_PATCH_MCU_1_1_hdr.bin.zst
-rw-r--r-- 1 root root 1152702 Mar 19 23:32 WIFI_RAM_CODE_MT7925_1_1.bin.zst

MT7925 BlueTooth is usually exposed via USB (even though WiFi is PCIe).

1
2
3
4
$ dmesg | grep -i -E "bluetooth|mt7925|btmtk|firmware"
...
Bluetooth: hci0: Failed to get device id (-108) [ 11.847463]
...

Failed to get device id (-108) is an ENOTUNIQ error from the USB/MMIO ID lookup in btusb/btmtk, often a known issue with MT7925 where the BlueTooth function doesn’t enumerate correctly or there’s a race during probe. This is a fairly common bug on MT7925 / 7925e cards on newer kernels.

The -108 error sometimes is caused by the BT USB device not being reset properly at boot. Try a full module reload in correct order:

1
2
3
4
5
6
7
8
9
10
11
$ sudo systemctl stop bluetooth

$ sudo lsof /dev/rfkill 2>/dev/null

$ sudo modprobe -r btusb
$ sudo modprobe -r btmtk

$ sudo modprobe btmtk
$ sudo modprobe btusb

$ sudo systemctl start bluetooth

Other like (-108) error:

1
2
3
4
5
$ dmesg | grep -i -E "bluetooth|mt7925|btmtk|firmware"
...
Bluetooth: hci0: Failed to get fw version (-108) [ 8.050441]
Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
...

can be addressed in the same approach above.

Other like (-110) error:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
$ dmesg | grep -i -E "bluetooth|mt7925|btmtk|firmware"
...
Bluetooth: hci0: Execution of wmt command timed out
Bluetooth: hci0: Failed to send wmt patch dwnld (-110)
Bluetooth: hci0: Failed to set up firmware (-110)
Bluetooth: hci0: HCI Enhanced Setup Synchronous Connection command is advertised, but not supported.
...

$ rfkill unblock bluetooth

$ rfkill
ID TYPE DEVICE SOFT HARD
0 bluetooth hci0 unblocked unblocked
1 wlan phy0 unblocked unblocked

$ hciconfig
hci0: Type: Primary Bus: USB
BD Address: 00:00:00:00:00:00 ACL MTU: 0:0 SCO MTU: 0:0
DOWN
RX bytes:0 acl:0 sco:0 events:0 errors:0
TX bytes:61 acl:0 sco:0 commands:1 errors:0

$ sudo hciconfig -a hci0 up
Can't init device hci0: Connection timed out (110)

Fix it by Hardware Power Reset:

Often, MediaTek and other PCIe/USB combo cards get stuck in a low-power or un-responsive state that a simple reboot misses because power remains supplied to the motherboard.

  • Shut down your computer completely.
  • Unplug the power cable (and/or turn off the laptop and unplug the charger). Hold down the physical power button for 30 to 45 seconds to drain all residual charge from the system board.
  • Turn the machine back on and boot into Ubuntu.

References

Quick way convert Copilot skill/prompt to work with Kilo Code

Kilo Codedoesn't natively read **.github-based** Copilot skill/prompt/workflow/convention files — that format is specific toGitHub Copilot`’s custom instructions/prompts system.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
$ tree .github
.github
├── conventions
│   ├── component-test-patterns.md
│   ├── test-anti-patterns.md
│   └── unit-test-conventions.md
├── prompts
│   ├── gen-it-tests.prompt.md
│   ├── gen-unit-tests.prompt.md
│   ├── it-coverage-gap-analysis.prompt.md
│   ├── unit-test-coverage-gap-analysis.prompt.md
│   └── uplift-unit-tests.prompt.md
└── skills
├── integration-test-coverage-analysis
│   ├── integration-test-coverage-classifier.md
│   ├── integration-test-dependency-extractor.md
│   ├── integration-test-evidence-collector.md
│   ├── integration-test-freshness-checker.md
│   ├── integration-test-gap-report-writer.md
│   ├── integration-test-gateway-scanner.md
│   ├── integration-test-scope-validator.md
│   ├── SKILL.md
│   └── templates
│   ├── Component-test-analysis.md
│   └── IT-analysis.md
├── integration-test-generator
│   ├── integration-test-code-generator.md
│   ├── integration-test-gap-discoverer.md
│   ├── integration-test-option-selector.md
│   ├── integration-test-plan-builder.md
│   └── SKILL.md
├── shared
│   ├── diff-analysis-ci.md
│   ├── diff-analysis-ide.md
│   ├── test-quality-rules.md
│   └── tiered-model-strategy.md
├── unit-test-coverage-analysis
│   ├── SKILL.md
│   ├── templates
│   │   └── unit-test-coverage-analysis-report.md
│   ├── unit-test-codebase-analysis.md
│   ├── unit-test-coverage-analysis-preflight.md
│   ├── unit-test-diff-scope-analysis.md
│   ├── unit-test-project-discovery.md
│   └── unit-test-report-synthesis.md
└── unit-test-generator
├── SKILL.md
├── unit-test-code-generator.md
├── unit-test-diff-coverage-resolver.md
├── unit-test-infrastructure-setup.md
├── unit-test-post-generation-verification.md
└── unit-test-refactor-specialist.md

11 directories, 40 files

A quick way to convert to Kilo Code custom way:

  • Add Kilo Code directory structure
1
$ ln -s .github .kilo
  • Convert prompt to Kilo Code custom slash command
1
2
3
$ cd .github

$ ln -s prompts commands

In Kilo Code chat window, then can find and run command e.g. /gen-unit-tests.

Running remote X Window applications locally on Mac

On Mac, install XQuartz from https://www.xquartz.org/

On remote Linux host Aorus.local, make sure:

  • $DISPLAY
1
2
$ echo $DISPLAY
localhost:10.0
  • $XAUTHORITY
1
2
3
4
5
$ echo $XAUTHORITY
/home/terrence/.Xauthority

$ ls -al /home/terrence/.Xauthority
-rw------- 1 terrence terrence 51 Jun 13 20:11 /home/terrence/.Xauthority
  • sshd_config
1
2
3
4
5
$ grep -iE 'X11Forwarding|X11UseLocalhost|XAuthLocation' /etc/ssh/sshd_config
X11Forwarding yes
X11UseLocalhost yes

$ sudo systemctl restart sshd
  • xauth
1
2
3
4
5
6
7
$ which xauth
/usr/bin/xauth

$ xauth list
Aorus/unix:10 MIT-MAGIC-COOKIE-1 27e55a1edf7347d27957e71637f99ab2

$ xauth add localhost:10 MIT-MAGIC-COOKIE-1 27e55a1edf7347d27957e71637f99ab2

Then on Mac run:

1
$ ssh -Y Aorus.local

On Aorus.local:

1
$ firefox

Gnome Remote Desktop on Ubuntu 26.04

Latest Ubuntu 26.04 LTS has dropped the support of X11 Server and xRDP and moved to the adoption of Wayland Display Server. Old approach with xRDP doesn’t work anymore. The solution / fix is the new Gnome Remote Desktop.

Gnome Remote Desktop

Generate Remote Desktop Server self-signed certificate:

1
2
3
4
$ sudo openssl req -newkey rsa:2048 -nodes -keyout /var/lib/gnome-remote-desktop/rdp-tls.key -x509 -days 3650 -out /var/lib/gnome-remote-desktop/rdp-tls.crt -subj "/CN=$(hostname)"

$ sudo chown gnome-remote-desktop:gnome-remote-desktop /var/lib/gnome-remote-desktop/rdp-tls.key
$ sudo chown gnome-remote-desktop:gnome-remote-desktop /var/lib/gnome-remote-desktop/rdp-tls.crt

Register self-signed certificate with the system daemon:

1
2
3
4
5
6
7
$ sudo grdctl --system rdp set-tls-key /var/lib/gnome-remote-desktop/rdp-tls.key
$ sudo grdctl --system rdp set-tls-cert /var/lib/gnome-remote-desktop/rdp-tls.crt

$ sudo grdctl --system rdp set-credentials $(whoami) rdp-user-password

$ sudo grdctl --system rdp enable
$ sudo systemctl restart gnome-remote-desktop.service

After Gnome Remote Desktop restarted, in the log:

1
2
3
4
5
6
7
$ sudo journalctl -u gnome-remote-desktop.service -f
...
Jun 06 22:21:17 Aorus systemd[1]: Starting gnome-remote-desktop.service - GNOME Remote Desktop...
Jun 06 22:21:17 Aorus gnome-remote-desktop-daemon[24618]: Init TPM credentials failed because Failed to initialize transmission interface context: tcti:IO failure, using GKeyFile as fallback
Jun 06 22:21:17 Aorus systemd[1]: Started gnome-remote-desktop.service - GNOME Remote Desktop.
Jun 06 22:21:17 Aorus gnome-remote-desktop-daemon[24618]: RDP server started

Show Remote Desktop Server status:

1
2
3
4
5
6
7
8
9
10
11
12
13
$ sudo grdctl --system status --show-credentials
Overall:
Unit status: active
RDP:
Status: enabled
Port: 3389
Authentication methods: credentials
TLS certificate: /var/lib/gnome-remote-desktop/rdp-tls.crt
TLS fingerprint: 71:f1:20:64:fe:e3:58:97:95:8d
TLS key: /var/lib/gnome-remote-desktop/rdp-tls.key
Kerberos keytab: (null)
Username: terrence
Password: rdp-user-password

When connect from Windows App (Microsoft Remote Desktop), error thrown in log:

1
2
3
4
5
$ sudo journalctl -u gnome-remote-desktop.service -f
...
Jun 02 12:40:22 NucBox gnome-remote-desktop-daemon[58071]: [RDP] Sending server redirection
Jun 02 12:40:22 NucBox gnome-remote-desktop-daemon[58071]: [12:40:22:884] [58071:0004752e] [ERROR][com.freerdp.core.peer] - [rdp_set_error_info]: ERRINFO_LOGOFF_BY_USER [0x0001000C]
Jun 02 12:40:22 NucBox gnome-remote-desktop-daemon[58071]: [RDP] Network or intentional disconnect, stopping session

NOTE: According to A.I., GNOME Remote Desktop –system mode uses Server Redirection — after you authenticate at the system level, it redirects the RDP client to your actual user session on a different internal port. Microsoft Remote Desktop on Mac sometimes rejects this redirection for self-signed certificates because the certificate on the redirected session doesn’t match what it expects. And use user-level approach instead.

However, choose a different Remote Desktop Client like Royal TSX https://royalapps.com/ts/mac/features, works fine.

References

Fast and Furious way to import and export AWS DynamoDB table

Extract data from the production tables and prepare JSON files for the test environment

1
2
3
4
5
6
7
8
for table in dashboard-tile-publisher-prod-group dashboard-tile-publisher-prod-tile dashboard-tile-publisher-prod-tile-event; do
aws --profile production dynamodb scan \
--table-name $table \
--output json \
--max-items 10000 \
| jq --arg t "$table" '{ ($t): [ .Items[] | { "PutRequest": { "Item": . } } ] }' \
> $table.json
done

Copy and modify the JSON files for the test environment

1
2
3
4
for suffix in group tile tile-event; do
cp "dashboard-tile-publisher-prod-${suffix}.json" "dashboard-tile-publisher-ptest-${suffix}.json"
sed -i '' "s/dashboard-tile-publisher-prod-${suffix}/dashboard-tile-publisher-ptest-${suffix}/g" "dashboard-tile-publisher-ptest-${suffix}.json"
done

Update the content in the JSON files for the test environment

1
2
3
for suffix in tile tile-event; do
sed -i '' 's/dashboard-tile-publisher-images-prod/dashboard-tile-publisher-images-ptest/g' "dashboard-tile-publisher-ptest-${suffix}.json"
done

Import the modified JSON files into the test environment DynamoDB tables

1
2
3
4
5
6
7
8
9
for table in dashboard-tile-publisher-ptest-group dashboard-tile-publisher-ptest-tile dashboard-tile-publisher-ptest-tile-event; do
jq -c --arg t "$table" '.[$t] | _nwise(25) | {($t): .}' "${table}.json" \
| while IFS='' read -r chunk; do
aws --profile test dynamodb batch-write-item \
--no-cli-pager \
--request-items "$chunk"; \
sleep 10; # Add a small delay to avoid throttling
done
done

References

  • A.I.

Microsoft Power Automate - Last day of the month notification

Setting up a scheduled cloud flow in Microsoft Power Automate, to send notification to Microsoft Teams group chat on every last day of the month.

Power Automate - Workflow

For example, at 10:30am AEST, on April 30th 2006:

  • Compose (get today’s day number) expression
1
formatDateTime(convertTimeZone(utcNow(), 'UTC', 'AUS Eastern Standard Time'), 'dd')

The output of above compose is: “30”

  • Compose (calculate last day of current month) expression
1
formatDateTime(addDays(startOfMonth(addToTime(convertTimeZone(utcNow(), 'UTC', 'AUS Eastern Standard Time'), 1, 'Month')), -1, 'yyyy-MM-dd'), 'dd')
  1. utcNow(): Grabs the current date and time in UTC (e.g., 2026-04-30T00:30:00Z).
  2. addToTime(…, 1, ‘Month’): Jumps forward exactly one month into the future (e.g., May 30th, 2026).
  3. startOfMonth(…): Takes that future date and rewinds it to the very first day of that month (e.g., May 1st, 2026).
  4. addDays(…, -1, ‘yyyy-MM-dd’): Subtracts exactly one day from the first of next month, landing perfectly on the last day of the current month. The ‘yyyy-MM-dd’ at the end formats the output neatly (e.g., 2026-04-30).
  5. formatDateTime(…, ‘dd’): Extract just the day

The output of above compose is: “30”

  • Compose (get today’s weekday number) expression
1
dayOfWeek(convertTimeZone(utcNow(), 'UTC', 'AUS Eastern Standard Time'))

The output of above compose is: 4

  • Condition

Power Automate - Condition

  1. Output of Compose (get today’s day number) is equal to Compose (calculate last day of current month)
  2. Output of Compose (get today’s weekday number) is greater or equal to 1 (Monday)
  3. Output of Compose (get today’s weekday number) is less or equal to 5 (Friday)
  • Notification

Power Automate - Notification

Qwen 3.6 27B,多种优化方式,从 20 t/s 飙到 184 t/s

Local AI should be a default, not a privilege: private data, no per-token bill, no vendor lock-in. The hardware to run capable models already sits on desks. The software to run those chips well doesn’t.

Qwen 3.6 27B 推理速度优化技术文档

一、背景与目标

  • 模型:Qwen 3.6 27B(稠密模型,FP8 精度)
  • 硬件:单卡 RTX 4090(48GB 显存,无 P2P 通信);双卡 RTX 4090
  • 初始性能:单卡 RTX 4090 裸跑 FP8 精度,输出速度仅 20 tokens/s
  • 目标:通过多种优化手段,将单卡 RTX 4090 推理速度提升至 184 tokens/s(峰值),实现最少 5 倍、最多 10 倍的速度提升

二、量化优化(第一阶优化)

2.1 原理

  • 模型参数的位宽从 FP16 降至 4bit,体积缩小 4 倍
  • 显存带宽不变时,每次搬运的数据量减半,从而突破显存访问瓶颈,速度翻倍
  • 适用于显存受限的场景(如 RTX 4090 非高带宽显存)

2.2 量化方案对比

方案 框架 精度 速度(单卡 RTX 4090) 特点
GGUF Q4_K_M llama.cpp 4bit ~45 token/s 适合单人使用,可 offload 到内存
AWQ VLLM 4bit ~48 token/s 适合高并发场景

2.3 精度损失评估

  • 测试工具:ToolCall15 https://github.com/stevibe/ToolCall-15 + 数据提取 + 指令遵循(共 45 场景)
  • 结论:大部分场景损失可忽略,仅增加少量错误与纠错 token,但速度提升 2 倍以上,可接受。

三、投机解码 – MTP(Multi Token Prediction)

3.1 原理

  • 在模型主头之外增加多个预测头,一次并行预测后续 N 个 token
  • 大模型验证时一次通过,命中则跳过单步生成,利用 GPU 闲置算力
  • 参数 n 控制预测窗口大小(n = 1,3,5)

3.2 测试结果(单卡 RTX 4090)

配置 速度(tokens/s) 提升幅度
VLLM AWQ 无 MTP 48 基准
VLLM AWQ + MTP n = 1 71 +49%
VLLM AWQ + MTP n = 3 99 +106%
VLLM AWQ + MTP n = 5 108 +124%
FP8 无 MTP 20 基准
FP8 + MTP n = 1 38 +90%
FP8 + MTP n = 3 60 +200%
FP8 + MTP n = 5 72 +260%
  • 联合量化 + MTP 可达 5 倍提升:FP8 (20) → AWQ + MTP n = 5 (108)

3.3 llama.cpp 的投机解码

  • 采用 n-gram 方式,实测提升不明显(可能因实验场景为每次全新上下文,不适合连续多轮调用)

四、双卡并行方案

4.1 单并发性能

  • 双卡 FP8 + MTP n = 5:单并发 120 tokens/s(仅比单卡 108 tokens/s 提升 11%)
  • 瓶颈:两张 RTX 4090 间无 P2P 直连,通信需经过 CPU 内存,损耗大

4.2 多并发优势

  • 双卡在多请求场景下优势显著:10 并发时可提供更高总吞吐
  • 类比:单车道→四车道,单请求速度不变但总容量大幅提升

五、高级投机解码 – DFlash 与 DDTree

5.1 DFlash(扩散式投机解码)

  • 借鉴图像扩散模型思想:一次性生成整块模糊候选文本,再逐步去噪精炼
  • 本质是并行路径,但默认仍是单条路径验证,一错全废

5.2 DDTree(Diffusion Draft Tree)

  • 先用扩散模型生成多个备选路径(参数 22 条),同时探索
  • 任意一条路径通过即成功,大幅提升命中率
  • 实现项目:lucebox https://github.com/Luce-Org/lucebox-hub

5.3 性能表现(单卡 RTX 4090,Q4 + DFlash/DDTree)

配置 平均速度 峰值速度
本机 4090 141 tokens/s 184 token/s
参考:lucebox 3090 207 tokens/s(Qwen 3.5 27B) -

5.4 速度依赖因素

  • 任务类型:数学题(逻辑死板)→ 150 tokens/s;代码(变量灵活)→ 125 tokens/s;创意写作(自由度最高)→ 效果差
  • 适用场景:多 agent、Claude Code 等写代码场景最适合推测解码

六、KV Cache 量化 – TurboQuant

6.1 原理

  • 将 KV cache 从 FP16 压缩至 3~4 bit,压缩比约 4 倍
  • 非权重量化,为第首次实现几乎无精度损失的 KV cache 量化

6.2 效果

  • 24G 显存(如 RTX 3090)搭配 Q4 模型,可支持 200K 上下文长度
  • 已获 VLLM 0.20 及 lucebox 支持

七、生产环境推荐方案

需求 推荐配置 性能
最高精度 + 多并发 FP8 + VLLM + MTP n = 5 10 并发 ~500 tokens/s
极致单请求速度 Q4 + DFlash / DDTree(lucebox) 峰值 184 tokens/s(但暂不支持多并发、工具调用不稳定)

八、技术限制与展望

  • DFlash / DDTree 当前限制:不支持多并发、未合入 llama.cpp 主线、Claude Code 工具调用易断
  • 软件层潜力:CUDA 驱动能效比低于 Apple M5,通过 kernel 融合、降功率等优化可大幅提升能效(实验显示 RTX 3090 降功率后能效比追平 M5 Max)
  • 未来方向:更多内核级优化 + 框架原生支持,本地算力将持续升值

九、结论

通过 量化(GGUF / AWQ)MTPDFlash/DDTreeTurboQuant 的递进优化,单卡 RTX 4090 上 Qwen 3.6 27B 的推理速度从 20 tokens/s 提升至 184 tokens/s(峰值),提升超 9 倍。该路线为本地大模型从“玩具”迈向“核弹级生产力工具”提供了已验证的技术路径。

References

DNS_PROBE_FINISHED_NXDOMAIN error

From time to time, not always, getting DNS_PROBE_FINISHED_NXDOMAIN error in browser especially when visit Chinese AI sites e.g. https://chat.qwen.ai/ and https://chat.z.ai/

The root reason is because some ISPs have slower or inconsistent DNS resolution.

The fix is switching to a faster public resolver like Google (8.8.8.8/8.8.4.4) or Cloudflare (1.1.1.1/1.0.0.1) in network settings.

This is how to change DNS settings in OpenWRT.