VPS 常用命令

一键启用BBR

1
sudo modprobe tcp_bbr && echo "net.ipv4.tcp_congestion_control = bbr" | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

验证结果

1
sysctl net.ipv4.tcp_congestion_control

开放所有端口

1
2
3
4
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F

一键安装Docker

官方安装脚本

1
curl -fsSL https://get.docker.com | sh

国内安装脚本

1
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/DockerInstallation.sh)

启动命令

1
sudo systemctl start docker

修改root密码

1
echo root:123456 | sudo chpasswd root

关闭所有Docker容器

1
docker stop $(docker ps -aq)

更新常用工具包

1
apt update && apt install -y curl wget git zip tar lsof vim sudo nano iptables

开启虚拟内存

1
sudo fallocate -l 2G /swapfile && sudo chmod 700 /swapfile && sudo mkswap /swapfile && sudo swapon /swapfile && echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

一键测试流媒体解锁

1
bash <(curl -L -s check.unlock.media)
1
bash <(curl -L -s check.unlock.media) -M 4
1
bash <(curl -L -s check.unlock.media) -M 6

查看系统架构

1
dpkg --print-architecture
1
uname -a

一键换源

1
bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
0%