【2023脚本收集】常用脚本备份

查看 107|回复 10
作者:hostlocmjj   
   
感谢以下大佬收集整理脚本
网址
https://blog.laoda.de/archives/useful-script
https://www.wrnxr.cn/163.html
DD网络重装脚本
PS:自定义密码直接 -p 你想要的密码就行!!!
部分机器需要设置网卡,否则可以VNC,但是不能远程SSH
[ol]-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[/ol]复制代码
· 甲骨文、三毛、Vir、RN等大部分VPS通用,三毛、甲骨文 记得去掉 -firmware
旧[ol]bash 复制代码
新[ol]bash 复制代码
PS:如果你是腾讯云记得卸载组件 否则会导致报错 DD失败
[ol]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 这个进程 [/ol]复制代码
· 国内VPS需要更换镜像源否则很慢!我这里使用的华为源,如果你是腾讯云后面可以换成内网源,节省流量,下面有写!
[ol]bash 复制代码
镜像站地址
官方给出的地址列表:https://www.debian.org/mirror/list
[ol]一些国内的
ftp.cn.debian.org
mirror.bjtu.edu.cn
mirror.lzu.edu.cn        
mirror.nju.edu.cn        
mirrors.163.com        
mirrors.bfsu.edu.cn        
mirrors.hit.edu.cn        
mirrors.huaweicloud.com        
mirror.sjtu.edu.cn        
mirrors.tuna.tsinghua.edu.cn        
mirrors.ustc.edu.cn        
使用方法:(大致都是一样的)
清华源
--mirror 'https://mirrors.ustc.edu.cn/debian/'
腾讯源
--mirror 'http://mirrors.tencent.com/debian/'
--mirror 'http://mirrors.cloud.tencent.com/debian/'
腾讯源内网(dd完毕后可以修改 走内网速度更快)
http://mirrors.tencentyun.com/
阿里源
--mirror 'https://mirrors.aliyun.com/debian/'
华为源
--mirror 'https://mirrors.huaweicloud.com/debian/'[/ol]复制代码
· DD windows
https://git.beta.gs/
[ol]安装重装系统的前提组件:
Debian/Ubuntu:
apt-get install -y xz-utils openssl gawk file wget screen && screen -S os
RedHat/CentOS:
yum install -y xz openssl gawk file glibc-common wget screen && screen -S os
如果出现异常,请刷新Mirrors缓存或更换镜像源。
RedHat/CentOS:
yum makecache && yum update -y
Debian/Ubuntu:
apt update -y && apt dist-upgrade -y
使用:
wget --no-check-certificate -O NewReinstall.sh https://git.io/newbetags && chmod a+x NewReinstall.sh && bash NewReinstall.sh
如为CN主机(部分主机商已不能使用),可能出现报错或不能下载脚本的问题,可执行以下命令开始安装.
wget --no-check-certificate -O NewReinstall.sh https://cdn.jsdelivr.net/gh/fcurrk/[email protected]/NewReinstall.sh && chmod a+x NewReinstall.sh && bash NewReinstall.sh
[/ol]复制代码41合一系统密码:
1、CentOS 7.7 (已关闭防火墙及SELinux,默认密码[email protected])
2、CentOS 7 (默认密码cxthhhhh.com)
3、CentOS 7 (支持ARM64、UEFI,默认密码cxthhhhh.com)
4、CentOS 8 (默认密码cxthhhhh.com)
5、Rocky 8 (默认密码cxthhhhh.com)
6、Rocky 8 (支持UEFI,默认密码cxthhhhh.com)
7、Rocky 8 (支持ARM64、UEFI,默认密码cxthhhhh.com)
8、CentOS 9 (默认密码cxthhhhh.com)
9、CentOS 6 (官方源原版,默认密码Minijer.com)
10、Debian 11 (官方源原版,默认密码Minijer.com)
11、Debian 10 (官方源原版,默认密码Minijer.com)
12、Debian 9 (官方源原版,默认密码Minijer.com)
13、Debian 8 (官方源原版,默认密码Minijer.com)
14、Ubuntu 20.04 (官方源原版,默认密码Minijer.com)
15、Ubuntu 18.04 (官方源原版,默认密码Minijer.com)
16、Ubuntu 16.04 (官方源原版,默认密码Minijer.com)
17、Windows Server 2022 (默认密码cxthhhhh.com)
18、Windows Server 2022 (支持UEFI,默认密码cxthhhhh.com)
19、Windows Server 2019 (默认密码cxthhhhh.com)
20、Windows Server 2016 (默认密码cxthhhhh.com)
21、Windows Server 2012 (默认密码cxthhhhh.com)
22、Windows Server 2008 (默认密码cxthhhhh.com)
23、Windows Server 2003 (默认密码cxthhhhh.com)
24、Windows 10 LTSC (默认密码Teddysun.com)
25、Windows 10 LTSC (支持UEFI,默认密码Teddysun.com)
26、Windows 7 x86 Lite (默认密码nat.ee)
27、Windows 7 x86 Lite (阿里云专用,默认密码nat.ee)
28、Windows 7 x64 Lite (默认密码nat.ee)
29、Windows 7 x64 Lite (支持UEFI,默认密码nat.ee)
30、Windows 10 LTSC Lite (默认密码nat.ee)
31、Windows 10 LTSC Lite (阿里云专用,默认密码nat.ee)
32、Windows 10 LTSC Lite (支持UEFI,默认密码nat.ee)
33、Windows Server 2003 Lite (C盘默认10G,默认密码WinSrv2003x86-Chinese)
34、Windows Server 2008 Lite (默认密码nat.ee)
35、Windows Server 2008 Lite (支持UEFI,默认密码nat.ee)
36、Windows Server 2012 Lite (默认密码nat.ee)
37、Windows Server 2012 Lite (支持UEFI,默认密码nat.ee)
38、Windows Server 2016 Lite (默认密码nat.ee)
39、Windows Server 2016 Lite (支持UEFI,默认密码nat.ee)
40、Windows Server 2022 Lite (默认密码nat.ee)
41、Windows Server 2022 Lite (支持UEFI,默认密码nat.ee)
99、自定义镜像

宝塔面板7.7.0
https://github.com/8838/btpanel-v7.7.0
[ol]curl -sSO https://raw.githubusercontent.com/8838/btpanel-v7.7.0/main/install/install_panel.sh && bash install_panel.sh
1,屏蔽手机号
sed -i "s|bind_user == 'True'|bind_user == 'XXXX'|" /www/server/panel/BTPanel/static/js/index.js
2,删除强制绑定手机js文件
rm -f /www/server/panel/data/bind.pl
3,手动解锁宝塔所有付费插件为永不过期
文件路径:/www/server/panel/data/plugin.json
搜索字符串:"endtime": -1全部替换为"endtime": 999999999999
4,给plugin.json文件上锁防止自动修复为免费版
chattr +i /www/server/panel/data/plugin.json
[/ol]复制代码
常用脚本

一键开启BBR(适用于较新的Debian、Ubuntu)
[ol]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[/ol]复制代码
superbench
[ol]wget -qO- git.io/superbench.sh | bash[/ol]复制代码
Bench.sh
[ol]wget -qO- bench.sh | bash[/ol]复制代码
三网测速
[ol]bash 复制代码
[ol]bash 复制代码
yabs 机器跑分
[ol]curl -sL yabs.sh | bash
curl -sL yabs.sh | bash -s -- -flags
[/ol]复制代码-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此选项使用提供的文件名将JSON结果写入文件
-s此选项将结果的JSON表示发送到指定的url(请参阅下面的部分)

一键安装docker
国外
[ol]curl -sSL https://get.docker.com/ | sh[/ol]复制代码
国内
[ol]curl -sSL https://get.daocloud.io/docker | sh[/ol]复制代码
卸载docker
[ol]sudo apt-get remove docker docker-engine
rm -fr /var/lib/docker/[/ol]复制代码
流媒体测试
全媒体测试
[ol]bash 复制代码
奈飞测试
[ol]wget -O nf https://github.com/sjlleo/netflix-verify/releases/download/2.5/nf_2.5_linux_amd64 && chmod +x nf && clear && ./nf
#第一个
bash 复制代码
Glances:跨平台的系统性能监控利器
[ol]curl -L https://bit.ly/glances | bash
wget -O- https://bit.ly/glances | bash
[/ol]复制代码
还没完 剩下的详见2楼
参考  https://blog.laoda.de/archives/useful-script
  https://www.wrnxr.cn/163.html
已放入本人博客,ip+1     https://archives.vip/6.html

密码, 代码, 选项

hostlocmjj
OP
  
   
综合工具箱(强烈推荐,集成了很多脚本)
[ol]wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh
[/ol]复制代码
不太常用脚本
杜甫测试
[ol]wget -q https://github.com/Aniverse/A/raw/i/a && bash a[/ol]复制代码
单线程测试
[ol]bash 复制代码
直接显示回程线路
[ol]curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash
# 第一个
wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh
bash testrace.sh
# 第二个
wget -qO- git.io/besttrace | bash
[/ol]复制代码
测试25端口是否开放
[ol]telnet smtp.aol.com 25[/ol]复制代码
测试IPv4优先还是IPv6优先
[ol]curl ip.p3terx.com[/ol]复制代码
WARP
[ol]wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/multi.sh && chmod +x multi.sh && ./multi.sh[/ol]复制代码
宝塔一键挂载硬盘脚本
[ol]Centos系统请使用以下命令:
yum install wget -y && wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh
Ubuntu系统请使用以下命令:
wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && sudo bash auto_disk.sh
Debian系统请使用以下命令:
wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh
[/ol]复制代码
FunctionClub大佬的内存检测脚本
CentOS
[ol]yum install wget -y
yum groupinstall "Development Tools" -y
wget https://raw.githubusercontent.com/FunctionClub/Memtester/master/memtester.cpp
gcc -l stdc++ memtester.cpp
./a.out[/ol]复制代码
Ubuntu / Debian
[ol]apt-get update
apt-get install wget build-essential -y
wget https://raw.githubusercontent.com/FunctionClub/Memtester/master/memtester.cpp
gcc -l stdc++ memtester.cpp
./a.out[/ol]复制代码
Aria2一键安装脚本
[ol]wget -N git.io/aria2.sh && chmod +x aria2.sh && ./aria2.sh
[/ol]复制代码
qbittorrent安装 4.3.9
[ol]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 [/ol]复制代码
输入y 然后ctrl+c退出就行
[ol]cat  /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[/ol]复制代码[ol]# 更新配置
systemctl daemon-reload
# 启动服务
systemctl start qbittorrent
# 查看状态
systemctl status qbittorrent[/ol]复制代码
如需重启/关闭程序
请使用kill命令关闭程序
ps -aux | grep qbittorrent
kill 对应序号
如 kill 11111
再使用进程守护打开即可使用
剑皇脚本
[ol]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[/ol]复制代码
swap添加/删除脚本
[ol]wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh
[/ol]复制代码
侵权、未声明脚本属于谁的
都可以联系我修改[email protected]
再次感谢各位大佬们的脚本

会呼吸的痛   
bash 复制代码
一键清理 /var/log/目录下的过期日志
[ol]find /var/log/ -name "*.1" -exec rm -rf {} \; && find /var/log/ -name "*.log.1" -exec rm -rf {} \; && find /var/log/ -name "*.gz" -exec rm -rf {} \;[/ol]复制代码
流媒体检测:
[ol]bash 复制代码
目前用过的最好用,功能最全的套warp脚本
[ol]wget -N https://raw.githubusercontent.com/fscarmen/warp/main/warp-go.sh && bash warp-go.sh [option] [lisence][/ol]复制代码
Erik   

hostlocmjj 发表于 2022-11-12 09:06
综合工具箱(强烈推荐,集成了很多脚本)

楼主求把主贴更新,一键 DD Linux 系统可以加上我的,支持 Redhat 7 8 9,包括 CentOS,AlmaLinux,RockyLinux,Fedora,Debian 系 Redhat 系,ARM64 AMD64 自动识别转换,免去手动添加硬件架构参数,grub1 和 grub2 丝滑切换,Debian 系和 Redhat 系可无限互装,自动设置访客时区,连接国内源优化,以及更加智能的动态、静态网络参数配置,对 IPv4 IPv6 双栈机,IPv6 单栈机,甲骨文优化良好,Github 地址:https://github.com/leitbogioro/Tools
下载:
[ol]wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh[/ol]复制代码
安装依赖:
把 wget 装好即可
Debian series 系列:
[ol]apt update -y[/ol]复制代码
[ol]apt install wget -y[/ol]复制代码
Redhat 系列(CentOS / AlmaLinux / RockyLinux / OracleLinux / Fedora / VzLinux):
[ol]yum update --allowerasing -y[/ol]复制代码
[ol]yum install wget -y[/ol]复制代码
快速上手:
Debian
[ol]bash InstallNET.sh -debian[/ol]复制代码
CentOS
[ol]bash InstallNET.sh -centos[/ol]复制代码
RockyLinux
[ol]bash InstallNET.sh -rockylinux[/ol]复制代码
AlmaLinux
[ol]bash InstallNET.sh -almalinux[/ol]复制代码
Fedora
[ol]bash InstallNET.sh -fedora[/ol]复制代码
Ubuntu
[ol]bash InstallNET.sh -ubuntu[/ol]复制代码
参数详情:
-debian 9/10/11 : Debian 9+
-centos 7/8/9-stream: CentOS 7+
-almalinux/alma 8/9: AlmaLinux 8+
-rockylinux/rocky 8/9: RockyLinux 8+
-fedora 34/35/36/37: Fedora 34+
-ubuntu 16.04/18.04/20.04: Ubuntu 16.04~20.04
-mirror "有效的源链接"
-port "1~65535"
-pwd '自定义密码,不可太复杂,不推荐带特殊符号,默认:LeitboGi0ro'
--network "dhcp/auto or static/manual" 动态或静态网络,可选,可不添加,脚本自动识别
带两个横杠的参数应该放在脚本运行最后面。
天权璇玑   


本人获得了:
发帖最积极的 MJJ 荣誉称号 全球主机论坛 2022 年度「水王」
全球主机论坛 2022 年度 MVP 荣誉称号
被收藏最多的帖子【2023脚本收集】常用脚本备份 网址 荣誉称号
感谢大佬们的支持与鼓励

hostlocmjj
OP
  
安装命令
source
法外狂徒张三 发表于 2022-11-12 09:03
腾讯源内网(dd完毕后可以修改 走内网不费额外流量)
http://mirrors.tencentyun.com/
????
已修改
shuiwang   
顶,感谢大佬整理
法外狂徒张三   
好整理贴,谢谢
mjj666zzz   
码住
hostlocmjj
OP
  
先顶一下,再收藏~
您需要登录后才可以回帖 登录 | 立即注册

返回顶部