banner
年糕

年糕日记

此站为备份站点,最新文章请访问 oior.net
telegram
email

Commonly Used Linux Scripts

Benchmark#

curl -L yabs.sh | bash

Reinstall System with dd#

wget -N --no-check-certificate https://raw.githubusercontent.com/veip007/dd/master/InstallNET.sh && chmod +x InstallNET.sh && ./InstallNET.sh -d 10 -v 64 -p "Custom root password" -port "Custom ssh port"

Convert ovz to alpine#

curl -L https://gist.githubusercontent.com/trimsj/c1fefd650b5f49ceb8f3efc1b6a1404d/raw/8c2439d5d583dd40d5af3e570949b9f0974357ba/alpine.sh | bash

Generate Self-Signed Certificate with openssl#

Generate private key with openssl
openssl genrsa -out server.key 2048
# Generate certificate signing request (csr) based on the private key
openssl req -new -key server.key -out server.csr
# Sign the certificate request with the private key to generate the certificate
openssl x509 -req -in server.csr -out server.crt -signkey server.key -days 3650

Change Linux Source#

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

BBR#

wget -N --no-check-certificate "https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh
wget -N --no-check-certificate "https://github.000060000.xyz/tcpx.sh" && chmod +x tcpx.sh && ./tcpx.sh

Streaming Media Detection#

bash <(curl -L -s check.unlock.media)

One-Click Install Warp#

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/warp-go.sh && bash warp-go.sh [option] [license]

DD Network Reinstallation Script#

PS: For custom password, just use -p your desired password!!!
Some machines need to set the network card; otherwise, you can use VNC but cannot SSH remotely.

Common for most VPS like Oracle, Three Miao, Vir, RN, etc. Remember to remove -firmware for Three Miao and Oracle

Old

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

New

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 11 -v 64 -p Password -port Port -a -firmware

Delete Monitoring Component on Tencent Cloud#

PS: If you are on Tencent Cloud, remember to uninstall the component, otherwise it will cause errors and DD failure.

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
# Check if there are still Tencent Cloud components
# kill this process

· Domestic VPS needs to change the mirror source; otherwise, it will be very slow! I am using Huawei source here. If you are on Tencent Cloud, you can switch to the internal network source later to save bandwidth, as mentioned below!

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 Custom password

Mirror Station Addresses
Official address list: https://www.debian.org/mirror/list

[collapse status="false" title="Mirror Station Addresses"]

Some domestic ones
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

Usage: (Generally similar)

Tsinghua Source
--mirror 'https://mirrors.ustc.edu.cn/debian/'
Tencent Source
--mirror 'http://mirrors.tencent.com/debian/'
--mirror 'http://mirrors.cloud.tencent.com/debian/'
Tencent Internal Network Source (can be modified after DD for faster internal speed)
http://mirrors.tencentyun.com/
Ali Source
--mirror 'https://mirrors.aliyun.com/debian/'
Huawei Source
--mirror 'https://mirrors.huaweicloud.com/debian/'

[/collapse]

Four-in-One Script (Can DD Windows)#

https://git.beta.gs/

wget --no-check-certificate -O NewReinstall.sh https://git.io/newbetags && chmod a+x NewReinstall.sh && bash NewReinstall.sh

If it is a CN host (some host providers can no longer use it), errors or issues downloading the script may occur. You can execute the following command to start the installation.

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

[collapse status="false" title="Passwords"]

41-in-1 System Passwords:
1. CentOS 7.7 (Firewall and SELinux disabled, default password Pwd@CentOS)
2. CentOS 7 (default password cxthhhhh.com)
3. CentOS 7 (supports ARM64, UEFI, default password cxthhhhh.com)
4. CentOS 8 (default password cxthhhhh.com)
5. Rocky 8 (default password cxthhhhh.com)
6. Rocky 8 (supports UEFI, default password cxthhhhh.com)
7. Rocky 8 (supports ARM64, UEFI, default password cxthhhhh.com)
8. CentOS 9 (default password cxthhhhh.com)
9. CentOS 6 (official source original version, default password Minijer.com)
10. Debian 11 (official source original version, default password Minijer.com)
11. Debian 10 (official source original version, default password Minijer.com)
12. Debian 9 (official source original version, default password Minijer.com)
13. Debian 8 (official source original version, default password Minijer.com)
14. Ubuntu 20.04 (official source original version, default password Minijer.com)
15. Ubuntu 18.04 (official source original version, default password Minijer.com)
16. Ubuntu 16.04 (official source original version, default password Minijer.com)
17. Windows Server 2022 (default password cxthhhhh.com)
18. Windows Server 2022 (supports UEFI, default password cxthhhhh.com)
19. Windows Server 2019 (default password cxthhhhh.com)
20. Windows Server 2016 (default password cxthhhhh.com)
21. Windows Server 2012 (default password cxthhhhh.com)
22. Windows Server 2008 (default password cxthhhhh.com)
23. Windows Server 2003 (default password cxthhhhh.com)
24. Windows 10 LTSC (default password Teddysun.com)
25. Windows 10 LTSC (supports UEFI, default password Teddysun.com)
26. Windows 7 x86 Lite (default password nat.ee)
27. Windows 7 x86 Lite (Aliyun exclusive, default password nat.ee)
28. Windows 7 x64 Lite (default password nat.ee)
29. Windows 7 x64 Lite (supports UEFI, default password nat.ee)
30. Windows 10 LTSC Lite (default password nat.ee)
31. Windows 10 LTSC Lite (Aliyun exclusive, default password nat.ee)
32. Windows 10 LTSC Lite (supports UEFI, default password nat.ee)
33. Windows Server 2003 Lite (C drive default 10G, default password WinSrv2003x86-Chinese)
34. Windows Server 2008 Lite (default password nat.ee)
35. Windows Server 2008 Lite (supports UEFI, default password nat.ee)
36. Windows Server 2012 Lite (default password nat.ee)
37. Windows Server 2012 Lite (supports UEFI, default password nat.ee)
38. Windows Server 2016 Lite (default password nat.ee)
39. Windows Server 2016 Lite (supports UEFI, default password nat.ee)
40. Windows Server 2022 Lite (default password nat.ee)
41. Windows Server 2022 Lite (supports UEFI, default password nat.ee)
99. Custom Image

[/collapse]

Baota Panel 7.7.0#

curl -sSO https://raw.githubusercontent.com/8838/btpanel-v7.7.0/main/install/install_panel.sh && bash install_panel.sh
#1, Shield phone number
sed -i "s|bind_user == 'True'|bind_user == 'XXXX'|" /www/server/panel/BTPanel/static/js/index.js
#2, Delete the forced binding phone js file
rm -f /www/server/panel/data/bind.pl
#3, Manually unlock all paid plugins for Baota to never expire
#File path: /www/server/panel/data/plugin.json
#Search string: "endtime": -1 replace all with "endtime": 999999999999
#4, Lock the plugin.json file to prevent automatic repair to the free version
chattr +i /www/server/panel/data/plugin.json
wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh

One-Click Enable BBR (Applicable to Newer 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

Three Network Speed Test#

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 Machine Benchmark#

curl -sL yabs.sh | bash

One-Click Install Docker#

International#

curl -sSL https://get.docker.com/ | sh

Domestic#

curl -sSL https://get.daocloud.io/docker | sh

Uninstall Docker#

sudo apt-get remove docker docker-engine
rm -fr /var/lib/docker/

Streaming Media Testing#

Full Media Testing#

bash <(curl -L -s check.unlock.media)
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

Netflix Testing#

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")

Du Fu Testing#

wget -q https://github.com/Aniverse/A/raw/i/a && bash a

Single Thread Testing#

bash <(curl -Lso- https://bench.im/hyperspeed)

Directly Display Return Path#

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

Test if Port 25 is Open#

telnet smtp.aol.com 25

One-Click Change Default SSH Port, replace 2222 yourself#

sed -i 's/#Port\ 22/Port\ 2222/' /etc/ssh/sshd_config && systemctl reload ssh

One-Click Clean Expired Logs in /var/log/ Directory#

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 {} \;

Test if IPv4 or IPv6 is Preferred#

curl ip.p3terx.com

Currently the Best and Most Functional Warp Script Used#

wget -N https://raw.githubusercontent.com/fscarmen/warp/main/warp-go.sh && bash warp-go.sh [option] [license]

Baota One-Click Mount Hard Drive Script#

For CentOS System, please use the following command:#

yum install wget -y && wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

For Ubuntu System, please use the following command:#

wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && sudo bash auto_disk.sh

For Debian System, please use the following command:#

wget -O auto_disk.sh http://download.bt.cn/tools/auto_disk.sh && bash auto_disk.sh

FunctionClub's Memory Testing Script#

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 One-Click Install Script#

wget -N git.io/aria2.sh && chmod +x aria2.sh && ./aria2.sh

Sword King Script#

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
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.