跳转到内容
Lu's Blog
返回

VPS 命令脚本备份

常用命令

切换到 root 用户

sudo -i

更新系统和依赖

Debian / Ubuntu:

apt update -y
apt install -y curl socat wget
apt-get install sudo

CentOS:

yum update -y
yum install -y curl socat

防火墙相关

firewall-cmd --state                   # 查看防火墙状态
systemctl stop firewalld.service       # 停止防火墙
systemctl disable firewalld.service    # 禁止防火墙开机自启

Debian 开启原生 BBR

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
sysctl net.ipv4.tcp_available_congestion_control
lsmod | grep bbr

查看系统信息

wget -qO- bench.sh | bash

修改密码

passwd

常用脚本

VPS 测速

wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash

回程测试

curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh | bash

ServerStatus

# 国外机
wget https://raw.githubusercontent.com/cokemine/ServerStatus-Hotaru/master/status.sh

# 国内机
wget https://cokemine.coding.net/p/hotarunet/d/ServerStatus-Hotaru/git/raw/master/status.sh

面板安装

1Panel

curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && bash quick_start.sh

宝塔面板(Debian)

wget -O install.sh http://download.moetas.com/install/install-ubuntu_6.0.sh && sudo bash install.sh

X-UI

bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)

DD 系统重装

甲骨文 ARM DD

curl -fLO https://raw.githubusercontent.com/bohanyang/debi/master/debi.sh
chmod a+rx debi.sh
sudo ./debi.sh --architecture arm64 --user root --password password
sudo shutdown -r now
# 默认密码:password

DD Debian 10(64 位)

bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 10 -v 64 -a
# 默认密码:MoeClub.org

国内 VPS DD Debian 11

bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a --mirror 'https://mirrors.huaweicloud.com/debian/' -p password

Docker 应用

青龙面板

docker run -dit \
  --name QL \
  --hostname QL \
  --restart always \
  -p 5777:5777 \
  -v $PWD/QL/config:/ql/config \
  -v $PWD/QL/log:/ql/log \
  -v $PWD/QL/db:/ql/db \
  -v $PWD/QL/scripts:/ql/scripts \
  -v $PWD/QL/jbot:/ql/jbot \
  whyour/qinglong:latest

Aria2 一键脚本

wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/aria2.sh && chmod +x aria2.sh && bash aria2.sh

其他

腾讯云去监控

sudo -i
systemctl stop tat_agent
systemctl disable tat_agent
/usr/local/qcloud/stargate/admin/uninstall.sh
/usr/local/qcloud/YunJing/uninst.sh
/usr/local/qcloud/monitor/barad/admin/uninstall.sh
rm -f /etc/systemd/system/tat_agent.service
rm -rf /usr/local/qcloud
rm -rf /usr/local/sa
rm -rf /usr/local/agenttools
process=(sap100 secu-tcs-agent sgagent64 barad_agent agent agentPlugInD pvdriver)
for i in ${process[@]}
do
  for A in $(ps aux | grep $i | grep -v grep | awk '{print $2}')
  do
    kill -9 $A
  done
done

GitHub 文件加速下载

使用代理地址前缀即可加速下载 GitHub 上的文件:

https://ghproxy.com/https://github.com/用户名/仓库/文件路径

分享这篇文章:

上一篇
Astro 博客搭建全过程:从零到上线
下一篇
Docker 入门:从概念到实践