修改时区

sudo timedatectl set-timezone "Asia/Shanghai"

BBR

Check BBR

sysctl net.ipv4.tcp_available_congestion_control
lsmod | grep bbr

Enable BBR

cat > /etc/sysctl.conf << EOF
fs.file-max = 6815744
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_ecn=0
net.ipv4.tcp_frto=0
net.ipv4.tcp_mtu_probing=0
net.ipv4.tcp_rfc1337=0
net.ipv4.tcp_sack=1
net.ipv4.tcp_fack=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_adv_win_scale=1
net.ipv4.tcp_moderate_rcvbuf=1
net.core.rmem_max=33554432
net.core.wmem_max=33554432
net.ipv4.tcp_rmem=4096 87380 33554432
net.ipv4.tcp_wmem=4096 16384 33554432
net.ipv4.udp_rmem_min=8192
net.ipv4.udp_wmem_min=8192
net.ipv4.ip_forward=1
net.ipv4.conf.all.route_localnet=1
net.ipv4.ip_forward=1
net.ipv4.conf.all.forwarding=1
net.ipv4.conf.default.forwarding=1
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

EOF
sysctl -p && sysctl --system

Swap

Check swap

swapon -s
free -m

Enable swap

fallocate -l 1G /swapfile
apt install util-linux
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
echo "/swapfile swap swap defaults 0 0" >> /etc/fstab
cat /proc/sys/vm/swappiness
echo "vm.swappiness=10" >> /etc/sysctl.conf
sysctl -p

Disable swap

swapoff -v /swapfile
rm /swapfile

安装docker

curl -sSL https://get.docker.com | bash

安装NginxProxyManager

curl -sSL https://r2.002484.xyz/install_npm.sh | bash

DD脚本

Github仓库:https://github.com/bin456789/reinstall

系统

用户名

密码

Linux

root

123@@@

Windows (ISO)

administrator

123@@@

Windows (DD)

镜像用户名

镜像密码

# 国外
curl -O https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh

# 国内
curl -O https://mirror.ghproxy.com/https://raw.githubusercontent.com/bin456789/reinstall/main/reinstall.sh

# 使用
bash reinstall.sh centos      9
                  anolis      7|8
                  alma        8|9
                  rocky       8|9
                  oracle      8|9
                  redhat      8|9   --img='http://xxx.qcow2'
                  opencloudos 8|9
                  fedora      39|40
                  debian      11|12
                  openeuler   20.03|22.03|24.03
                  ubuntu      20.04|22.04|24.04
                  alpine      3.17|3.18|3.19|3.20
                  opensuse    15.5|15.6|tumbleweed
                  kali
                  arch
                  gentoo

常用测试脚本

YABS

curl -sL https://yabs.sh | bash

NodeQuality

bash <(curl -sL https://run.NodeQuality.com)

融合怪测试

curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh

网络质量检测

bash <(curl -sL Net.Check.Place)

IP质量检测

bash <(curl -Ls IP.Check.Place)

流媒体检测

bash <(curl -L -s https://raw.githubusercontent.com/1-stream/RegionRestrictionCheck/main/check.sh)
bash <(curl -L -s media.ispvps.com)
bash <(curl -L -s check.unlock.media)
bash <(curl -sL Media.Check.Place)

设置优先使用ipv4

echo "precedence ::ffff:0:0/96 100" >> /etc/gai.conf

ufw-docker

sudo wget -O /usr/local/bin/ufw-docker https://github.com/chaifeng/ufw-docker/raw/master/ufw-docker
chmod +x /usr/local/bin/ufw-docker
ufw-docker install
systemctl restart ufw
ufw reload
systemctl daemon-reload
systemctl restart docker

windows激活

cd C:\Windows\System32
cscript slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX
cscript slmgr.vbs /skms kms.loli.best
cscript slmgr.vbs /ato
cscript slmgr.vbs /xpr

Debian更换UTSC源

Debian11

sudo sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
sudo sed -i -e 's|security.debian.org/\? |security.debian.org/debian-security |g' \
            -e 's|security.debian.org|mirrors.ustc.edu.cn|g' \
            -e 's|deb.debian.org/debian-security|mirrors.ustc.edu.cn/debian-security|g' \
            /etc/apt/sources.list

Debian11 sources.list

# 默认注释了源码仓库,如有需要可自行取消注释
deb http://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian bullseye main contrib non-free
deb http://mirrors.ustc.edu.cn/debian bullseye-updates main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian bullseye-updates main contrib non-free

# backports 软件源,请按需启用
# deb http://mirrors.ustc.edu.cn/debian bullseye-backports main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian bullseye-backports main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free
# deb-src http://mirrors.ustc.edu.cn/debian-security/ bullseye-security main contrib non-free

LXC容器更换时区

dpkg-reconfigure tzdata

安装NextTrace

curl nxtrace.org/nt | bash

SNIProxy脚本

安装

wget --no-check-certificate -O dnsmasq_sniproxy.sh https://raw.githubusercontent.com/myxuchangbin/dnsmasq_sniproxy_install/master/dnsmasq_sniproxy.sh && bash dnsmasq_sniproxy.sh -is

卸载

bash dnsmasq_sniproxy.sh -us

防火墙白名单

wget https://r2.002484.xyz/allow_ip.sh && bash allow_ip.sh 
wget https://r2.002484.xyz/delete_allow_ip.sh && bash delete_allow_ip.sh 
ufw allow from 1.1.1.1 to any port 443 proto tcp
ufw allow from 1.1.1.1 to any port 443 proto udp
ufw allow from 1.1.1.1 to any port 80 proto tcp
ufw allow from 1.1.1.1 to any port 80 proto udp
ufw allow from 1.1.1.1 to any port 53 proto udp

配置

user daemon
pidfile /var/tmp/sniproxy.pid
 
error_log {
    syslog daemon
    priority notice
}
 
resolver {
    nameserver 1.1.1.1 # 上游DNS
    nameserver 8.8.8.8 # 上游DNS
    mode ipv4_first
}
listener 80 {
    proto http
    access_log {
        filename /var/log/sniproxy/http_access.log
        priority notice
    }
}
listener 443 {
    proto tls
    access_log {
        filename /var/log/sniproxy/https_access.log
        priority notice
    }
}
 
table {
    .*example\.com$ * # 待解锁的网站
}

Smartdns脚本

安装

wget https://github.com/pymumu/smartdns/releases/download/Release46.1/smartdns.1.2025.03.02-1533.x86_64-linux-all.tar.gz
tar zxf smartdns.1.2025.03.02-1533.x86_64-linux-all.tar.gz
cd smartdns
chmod +x ./install
./install -i

卸载

cd smartdns
./install -u

配置

bind [::]:53@eth0 -no-dualstack-selection -no-speed-check
dualstack-ip-selection no
speed-check-mode none
serve-expired-prefetch-time 21600
prefetch-domain yes
cache-size 32768
cache-persist yes
cache-file /etc/smartdns/cache
prefetch-domain yes
serve-expired yes
serve-expired-ttl 259200
serve-expired-reply-ttl 3
prefetch-domain yes
serve-expired-prefetch-time 21600
cache-checkpoint-time 86400
#force-AAAA-SOA yes
server 1.1.1.1 # 上游DNS
server 8.8.8.8 # 上游DNS

# > GPT
address /example.com/1.1.1.1 # 解锁机IP

保存并启动

systemctl enable smartdns
systemctl start smartdns

WSL后台保活

wsl --exec dbus-launch true

Curl输出请求各个阶段耗时

curl -L https://r2.002484.xyz/curl-format.txt -o curl-format.txt
curl -w "@curl-format.txt" -v -o /dev/null https://example.com

安装Rclone

sudo -v ; curl https://rclone.org/install.sh | sudo bash