anti-proxy school server IP to my host and NAT Traversal

分享

1. Caddy 安装与配置

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg

curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list

sudo apt update
sudo apt install caddy
sudo tee /etc/caddy/Caddyfile > /dev/null << 'EOF'
:8080 {
    reverse_proxy http://10.26.240.78 

    log {
        output file /var/log/caddy/access.log
        format json
    }
}
EOF
sudo systemctl restart caddy
sudo systemctl status caddy
curl -I http://127.0.0.1:8080

现在访问本机8080端口会跳到学校内网的服务10.26.240.78

2. Tailscale Funnel

tailscale funnel --bg localhost:8080
tailscale funnel status

web访问tailscale分配的域名

访问失败 ,参考

https://tailscale.com/docs/how-to/set-up-https-certificates

web不认识p2p加密的https

tailscale funnel off

3. ngrok(成功暴露)

curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc | sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null

echo "deb https://ngrok-agent.s3.amazonaws.com buster main" | sudo tee /etc/apt/sources.list.d/ngrok.list

sudo apt update
sudo apt install ngrok
ngrok config add-authtoken <your-token>

ngrok http 8080

4. frp 配置与启动

配置文件 frpc.toml

serverAddr = "<frp-server>"
serverPort = 7000
auth.token = "<your-token>"

webServer.addr = "127.0.0.1"
webServer.port = 7400
webServer.user = "admin"
webServer.password = "admin"

[[proxies]]
name = "campus-1"
type = "tcp"
localIP = "<internal-ip>"
localPort = 80
remotePort = 7621
healthCheck.type = "tcp"
healthCheck.timeoutSeconds = 3
healthCheck.maxFailed = 2
healthCheck.intervalSeconds = 5

[[proxies]]
name = "campus-web-1"
type = "tcp"
localIP = "127.0.0.1"
localPort = 7400
remotePort = 7622

启动命令

pkill -9 frpc
sleep 40
./frpc -c frpc.toml

清理命令

tailscale funnel off
pkill -9 frpc

5. Cloudflare Tunnel

sudo apt-get install cloudflared

唯一一个在ubuntu仓库上有的包,最简单

# 1. 创建隧道
TUNNEL_NAME="my-tunnel"
cloudflared tunnel create "$TUNNEL_NAME"

# 2. DNS 路由
cloudflared tunnel route dns "$TUNNEL_NAME" tunnel.bakamake.org

# 3. 运行隧道
cloudflared tunnel run --url http://localhost:8080 --protocol http2 "$TUNNEL_NAME"

创建看起来也很快,就是比较黑箱

阅读更多

蓝牙功放连接与音量异常排查记录

环境 笔记本运行 Ubuntu,桌面为 KDE Plasma Wayland,蓝牙栈为 BlueZ 加 PipeWire 1.6.2 加 WirePlumber,音频设备为一台 TVCTO 蓝牙功放,通过 A2DP 播放。 现象 三个问题同时存在。 第一,功放与电脑连接不稳定,表现为 Connection refused 111 与 Connection timed out 110 交替出现,重试若干次后可以连上。 第二,蓝牙日志中持续出现 Hands-Free Voice gateway 相关报错,A2DP 媒体流频繁断开重连。 第三,连接恢复后,系统音量调节异常。音量键只在

By bakamake

躺姿笔记本看视频的硬件与系统调优

问题背景 床头挡板与墙之间存在约三指宽的缝隙,笔记本竖直卡入其中,依靠开合角支撑。躺于床尾观看视频时,屏幕法线朝向下前方,与躺姿视线方向不一致。开合角已达机械上限,微调垫片只能改变数度,属于机构层面的约束,无法通过摆放优化解决。 一、视角问题的方案评估 方案:整机倒挂配合屏幕旋转。若开合角支持一百八十度,将键盘朝上放置,屏幕反向展开,屏幕平面朝向天花板,与躺姿视线一致。系统内将内屏旋转一百八十度即可正常显示。零硬件成本,前置条件为开合角达到一百八十度,且需接受键盘与触控板镜像。 二、KWin Wayland 下的屏幕旋转 图形界面路径为系统设置,显示与监视器,选中内屏,方向选翻转。配置由 KScreen 持久化。 命令行使用 kscreen-doctor: kscreen-doctor -o kscreen-doctor output.eDP-1.rotation.inverted kscreen-doctor

By bakamake

ros 工具怪癖

rqt 启动之后要关闭D符号debug,才能看到数据 2d pose estimate not working head frame 需要是map 才能接收2d pose estimate ,但是这部分是amcl处理数据来收敛的, ros2 wtf ,刚刚发现这个东西还挺好用的 要看到蓝→红渐变,必须订阅带 inflation layer 的 costmap topic,例如: * /local_costmap/costmap * /global_costmap/costmap /map 节点切换到 costmap 也只能看到洋红色的障碍物,因为/map里100是障碍物,以及0和-1,costmap接受的范围是0~255

By bakamake