常用Linux脚本备份

DD网络重装脚本

PS:自定义密码直接 -p 你想要的密码就行!!!
部分机器需要设置网卡,否则可以VNC,但是不能远程SSH

甲骨文、三毛、Vir、RN等大部分VPS通用,三毛、甲骨文 记得去掉 -firmware

-firmware                额外的驱动支持
-d                        Debian系统 后面是系统版本号
-c                        Centos系统 后面是系统版本号
-v                         后面写64位 32位
-a                        auto,全自动无人值守安装
--mirror                后面是镜像源地址
-p                        后面写自定义密码
–ip-addr                 ifconfig -a 后获取到的 例:194.87.xxx.xxx
–ip-gate                 route -n    后获取到的 例   194.87.xxx.xxx
–ip-mask                 255.255.xxx.xx
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p 密码 -port 端口 -a -firmware

腾讯云记得卸载组件 否则会导致报错 DD失败

systemctl stop tat_agent
systemctl disable tat_agent
rm -rf /etc/systemd/system/tat_agent.service
rm -fr /usr/local/qcloud

ps -A | grep agent
# 检查看是否还有腾讯云组件
# kill 这个进程

国内VPS需要更换镜像源否则很慢!我这里使用的华为源,如果你是腾讯云后面可以换成内网源

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 自定义密码
常用脚本
一键开启BBR(适用于较新的Debian、Ubuntu)
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
swap添加/删除脚本
wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh
superbench
wget -qO- git.io/superbench.sh | bash
Bench.sh
wget -qO- bench.sh | bash
三网测速
bash <(curl -Lso- https://git.io/superspeed_uxh)
yabs 机器跑分
curl -sL yabs.sh | bash

curl -sL yabs.sh | bash -s -- -flags

-b此选项强制使用来自repo的预编译二进制文件而不是本地包
-f/-d此选项禁用fio(磁盘性能)测试
-i此选项禁用iperf(网络性能)测试
-g此选项禁用Geekbench(系统性能)测试
-h此选项打印包含用法、检测到的标志和本地包(fio/iperf)状态的帮助消息
-r此选项减少了iperf位置的数量(Online.net/Clouvider LON+NYC),以减少带宽使用
-4此选项将覆盖Geekbench 5性能测试,并运行Geekbench4测试
-9此选项除了运行Geekbench 5测试外,还运行Geekbench 4测试
-j此选项将结果的JSON表示打印到屏幕上
-w<filename>此选项使用提供的文件名将JSON结果写入文件
-s<url>此选项将结果的JSON表示发送到指定的url(请参阅下面的部分)
一键修改默认SSH端口,自行替换2222
sed -i 's/#Port\ 22/Port\ 2222/' /etc/ssh/sshd_config && systemctl reload ssh
流媒体测试
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

bash <(wget -qO- --no-check-certificate https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh)
奈飞测试
wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.5/nf_2.5_linux_amd64 && chmod +x nf && clear && ./nf

#第一个
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

# 第二个
bash <(curl -sSL "https://github.com/CoiaPrant/MediaUnlock_Test/raw/main/check.sh")
其他脚本
测试IPv4优先还是IPv6优先
curl ip.p3terx.com
qbittorrent安装 4.3.9
cd /root
wget https://github.com/userdocs/qbittorrent-nox-static/releases/download/release-4.3.9_v1.2.15/x86_64-qbittorrent-nox
chmod +x x86_64-qbittorrent-nox
./x86_64-qbittorrent-nox

输入y 然后ctrl+c退出就行

cat << "EOF" > /etc/systemd/system/qbittorrent.service
[Unit]
Description=qBittorrent Daemon Service
After=network.target

[Service]
LimitNOFILE=512000
User=root
ExecStart=/root/x86_64-qbittorrent-nox

[Install]
WantedBy=multi-user.target
EOF
# 更新配置
systemctl daemon-reload
# 启动服务
systemctl start qbittorrent
# 查看状态
systemctl status qbittorrent

如需重启/关闭程序
请使用kill命令关闭程序
ps -aux | grep qbittorrent
kill 对应序号
如 kill 11111
再使用进程守护打开即可使用

剑皇脚本
wget https://github.com/maintell/webBenchmark/releases/download/0.6/webBenchmark_linux_x64
chmod +x webBenchmark_linux_x64
./webBenchmark_linux_x64 -c 32 -s https://target.url


脚本感谢loc mjj 整理


持续更新,脚本来源网络,请自行甄别有无后门

News article is edited by: Caesar - 2023-04-27, 16:32
Reason: 更新了一个流媒体脚本

文章作者: Caesar
文章链接: https://pcnto.com/code/39-common-script-collect.html
版权声明: 本博客所有文章除特别声明外,转载请注明来自 Peng blog

如果您喜欢本站,你可以点击主页广告以示支持,谢谢。

广告是本站收益的来源希望您能够谅解。