小米R2D
1.使系统可写
mount -o remount -rw /
2.OpenWrt使用dropbear作为服务端,~/.ssh/authorized_keys并不生效。其实,dropbear的公钥存储文件是600权限的 /etc/dropbear/authorized_keys文件
3.golang 编译指令
GOOS=linux GOARM=5 GOARCH=arm CGO_ENABLED=0 go build xxx.go
4.查看当前所有监听端口
netstat -nlp |grep LISTEN
5.小米路由器R2D开机自启动
vi /etc/init.d/mystart
==========================
#!/bin/sh /etc/rc.common
START=99
start(){
/mnt/sda1/myapp
}
stop(){
/mnt/sda1/myapp -s
}
restart(){
/mnt/sda1/myapp
}
==========================
chmod -R 777 init.d/mystart #设置权限,否则无法激活开机启动,提示权限不足
/etc/init.d/mystart enable #激活开机启动
/etc/init.d/mystart start #运行start函数启动程序
小米路由器R3G 防火墙开启1086端口
vi /etc/config/firewall
config rule
option name 'Allow-1086-TCP'
option src 'wan'
option dest 'lan'
option proto 'tcp'
option target 'ACCEPT'
option dest_port '1086'
fw3 reload
查看是否生效
iptables -L -n | grep 1086
doh-client 配置
vi ~/work/start-dohc.sh
sudo nohup ~/work/doh-client -conf=~/work/doh-client.conf > ~/work/dohc.log 2>&1 &
加入开机启动 /etc/init.d/mystart
指定特定端口的dns服务 查ip
dig www.baidu.com @127.0.0.1 -p 5353
nslookup www.facebook.com localhost:5380 //xiaomiR3G适用
下载证书
doh.dns.sb
openssl
s_client -showcerts -connect sni.cloudflaressl.com:443
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构