2023 常用腳本備份#
感謝以下大佬收集整理腳本
https://hostloc.com/thread-921605-1-1.htmlhttps://blog.laoda.de/archives/useful-scripthttps://www.wrnxr.cn/163.html
DD 網路重裝腳本#
PS:自定義密碼直接 -p 你想要的密碼就行!!!
部分機器需要設置網卡,否則可以 VNC,但是不能遠程 SSH
-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
甲骨文、三毛、Vir、RN 等大部分 VPS 通用,三毛、甲骨文 記得去掉 -firmware
舊
bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a -firmware -p 自定義密碼
新#
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p 密碼 -port 端口 -a -firmware
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p 123456 -port 44 -a -firmware
PS: 如果你是騰訊雲記得卸載組件 否則會導致報錯 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 自定義密碼
鏡像站地址#
官方給出的地址列表:https://www.debian.org/mirror/list
一些國內的
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/'
DD windows#
安裝重裝系統的前提組件:
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/reinstall@master/NewReinstall.sh && chmod a+x NewReinstall.sh && bash NewReinstall.sh
41 合一系統密碼:
1、CentOS 7.7 (已關閉防火牆及SELinux,默認密碼Pwd@CentOS)
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#
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
常用腳本#
一鍵開啟 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
superbench#
wget -qO- git.io/superbench.sh | bash
Bench.sh#
wget -qO- bench.sh | bash
三網測速#
bash <(curl -Lso- https://git.io/superspeed_uxh)
bash <(curl -Lso- https://git.io/J1SEh)
wget -O jcnf.sh https://raw.githubusercontent.com/Netflixxp/jcnfbesttrace/main/jcnf.sh
bash jcnf.sh
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(請參閱下面的部分)
一鍵安裝 docker#
國外#
curl -sSL https://get.docker.com/ | sh
國內#
curl -sSL https://get.daocloud.io/docker | sh
卸載 docker#
sudo apt-get remove docker docker-engine
rm -fr /var/lib/docker/
流媒體測試#
全媒體測試#
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.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")
Glances:跨平台的系統性能監控利器#
curl -L https://bit.ly/glances | bash
wget -O- https://bit.ly/glances | bash
綜合工具箱(強烈推薦,集成了很多腳本)#
wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh
不太常用腳本#
杜甫測試#
wget -q https://github.com/Aniverse/A/raw/i/a && bash a
單線程測試#
bash <(curl -Lso- https://bench.im/hyperspeed)
直接顯示回程線路#
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
測試 25 端口是否開放#
telnet smtp.aol.com 25
測試 IPv4 優先還是 IPv6 優先#
curl ip.p3terx.com
WARP#
wget -N --no-check-certificate https://cdn.jsdelivr.net/gh/YG-tsj/CFWarp-Pro/multi.sh && chmod +x multi.sh && ./multi.sh
寶塔一鍵掛載硬碟腳本#
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
FunctionClub 大佬的內存檢測腳本#
CentOS
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
Ubuntu / Debian
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
Aria2 一鍵安裝腳本#
wget -N git.io/aria2.sh && chmod +x aria2.sh && ./aria2.sh
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
其他腳本#
swap 添加 / 刪除腳本#
wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh
dd windows#
萌咖大佬的腳本,應該用這個新的,這個比老地址的成功率更高,兼容性也更好
bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p 密碼 -port 端口 -a -firmware
一鍵修改默認 SSH 端口,自行替換 2222#
sed -i 's/#Port\ 22/Port\ 2222/' /etc/ssh/sshd_config && systemctl reload ssh
一鍵清理 /var/log/ 目錄下的過期日誌#
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 {} \;
流媒體檢測:#
bash <(curl -L -s check.unlock.media)
目前用過的最好用,功能最全的套 warp 腳本#
wget -N https://raw.githubusercontent.com/fscarmen/warp/main/warp-go.sh && bash warp-go.sh [option] [lisence]
樓主求把主貼更新,一鍵 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
下載:
wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh
安裝依賴:
把 wget 裝好即可
Debian series 系列:
apt update -y
apt install wget -y
Redhat 系列 (CentOS / AlmaLinux / RockyLinux / OracleLinux / Fedora / VzLinux):
yum update --allowerasing -y
yum install wget -y
ddLinux 快速上手:#
#debian
bash InstallNET.sh -debian
#centos
bash InstallNET.sh -centos
#RockyLinux
bash InstallNET.sh -rockylinux
#almalinux
bash InstallNET.sh -almalinux
#fedora
bash InstallNET.sh -fedora
#ubuntu
bash InstallNET.sh -ubuntu
參數詳情:
-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" #動態或靜態網路,可選,可不添加,腳本自動識別
#帶兩個橫杠的參數應該放在腳本運行最後面。
vimsa#
wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh
更穩定的翻牆軟體
v2ray#
安裝命令#
source <(curl -sL https://multi.netlify.app/v2ray.sh) --zh
升級命令 (保留配置文件更新)#
source <(curl -sL https://multi.netlify.app/v2ray.sh) -k
卸載命令#
source <(curl -sL https://multi.netlify.app/v2ray.sh) --remove
v2ray/xray [-h|help] [options]
-h, help 查看幫助
-v, version 查看版本號
start 啟動 V2Ray
stop 停止 V2Ray
restart 重啟 V2Ray
status 查看 V2Ray 運行狀態
new 重建新的v2ray json配置文件
update 更新 V2Ray 到最新Release版本
update [version] 更新 V2Ray 到指定版本
update.sh 更新 multi-v2ray 到最新版本
add 新增端口組
add [protocol] 新增一種協議的組, 端口隨機, 如 v2ray add utp 為新增utp協議
del 刪除端口組
info 查看配置
port 修改端口
tls 修改tls
tfo 修改tcpFastOpen
stream 修改傳輸協議
cdn 走cdn
stats v2ray流量統計
iptables iptables流量統計
clean 清理日誌
log 查看日誌
rm 卸載core
一個網路重裝 alpine Linux 發行版的腳本~**#
sh <(curl -k 'https://cdn.jsdelivr.net/gh/52fancy/NetInstallAlpine/alpine.sh')
【2023 腳本收集】常用腳本備份
https://hostloc.com/thread-1097221-1-1.html
(出處:全球主機交流論壇)