欢迎访问热站网,开始您的建站营销之旅!!

您现在的位置: 首页>>建站知识>>主机运维

个人常用云服务器指令&脚本

来源:热站网 发布时间:2022-11-30 21:44:34 热度:728 ℃

所有脚本均来自互联网,本站仅对这些脚本进行收集或镜像,不对其可用性负责,也不对其安全性等任何方面负责。

如果执行后出现未安装wget的提示请先安装wegt

ubuntu/debian等安装wget

apt-get install wget -y

centos等安装wget

yum install wget -y

如果出现证书不信任的情况,请在wget后加上–no-check-certificate

例如

bash <(wget –no-check-certificate -O- https://dl.233.mba/sh/superbenchpro.sh)

查看CPU信息

cat /proc/cpuinfo

查看当前内核信息

uname -a

内核更改-开启BBR,更换BBRplus等

卸载内核版本

wget -O tcp.sh “https://git.io/coolspeeda” && chmod +x tcp.sh && ./tcp.sh

镜像(国内机器或ipv6 only请使用这个)

wget -N –no-check-certificate “https://dl.233.mba/sh/tcp.sh” && chmod +x tcp.sh && ./tcp.sh

不卸载内核版本

wget -O tcpx.sh “https://git.io/JYxKU” && chmod +x tcpx.sh && ./tcpx.sh

镜像(国内机器或ipv6 only请使用这个)

wget -N –no-check-certificate “https://dl.233.mba/sh/tcpx.sh” && chmod +x tcpx.sh && ./tcpx.sh

萌咖大佬的一键DD重装系统

bash <(wget –no-check-certificate -qO- 'https://dl.233.mba/sh/InstallNET.sh') -d 10 -v 64 -a -p {自定义密码} –mirror {自定义镜像源}

-d代表debian,可改为-u和-c,分别代表ubuntu和centos,10代表版本号(例如:debian10,ubuntu18)
-v 64代表64位系统,32位也没啥人会用。非要改也可改为32

注意,修改“{自定义密码}”时请去掉“{}”,例如“-p 123456”而不是“-p {123456}”。如填写,root密码默认为MoeClub.org

–mirror后接自定义镜像源,例如–mirror ‘https://mirrors.ustc.edu.cn/debian/’

重装完成后请立即修改root密码,一般使用passwd命令进行修改

Linux修改主机名

首先执行,例如hostnamectl set-hostname wrnxr

hostnamectl set-hostname

然后执行下面的命令,修改原主机名为刚刚设置的

vi /etc/hosts

最后输入reboot重启机器

iptables一键转发脚本

wget –no-check-certificate https://dl.233.mba/sh/iptables.sh && bash iptables.sh

一键开启Swap脚本

特点:一键开启,包含删一键添加与删除功能

wget –no-check-certificate https://dl.233.mba/sh/swap.sh && bash swap.sh

Aria2一键安装脚本

Aria2 是目前最强大的全能型下载工具,它支持 BT、磁力、HTTP、FTP 等下载协议,常用做离线下载的服务端。Aria2 一键安装管理脚本是 Toyo (逗比) 大佬最为知名的脚本作品之一,2018年11月14日逗比大佬因未知原因突然失联。由于博主非常喜欢 Aria2 所以自2018年12月7日起开始接手这个项目并进行了大量的功能与细节优化,一直持续维护至今。增强版脚本整合了 Aria2 完美配置,在安装 Aria2 的过程中会下载这套配置方案,这套方案包含了配置文件、附加功能脚本等文件,用于实现 Aria2 功能的增强和扩展,提升 Aria2 的下载速度与使用体验,解决 Aria2 在使用中遇到的 BT 下载无速度、文件残留占用磁盘空间、任务丢失、重复下载等问题。

Github:https://github.com/P3TERX/aria2.sh

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

Superbench修改版

原作者找不到,希望知道的人在评论区留言;本站在上面基础上对测速节点进行维护

特点:支持查看Basic system info,Geekbench,besttrace,I/O test,Media Unlock test以及speedtest(2022-2-10v1.3.5又增加了新的测速节点)

bash <(wget –no-check-certificate -O- https://dl.233.mba/sh/superbenchpro.sh)

v1.3.5
v1.3.5

v1.3.5
v1.3.5

老鬼大佬的SuperBench测试脚本

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

镜像(国内机器或ipv6 only请使用这个)

wget -qO- –no-check-certificate https://dl.233.mba/sh/superbench.sh | bash

秋水逸冰大佬的UnixBench.sh

wget –no-check-certificate https://github.com/teddysun/across/raw/master/unixbench.sh

chmod +x unixbench.sh

./unixbench.sh

镜像(国内机器或ipv6 only请使用这个)

wget –no-check-certificate https://dl.233.mba/sh/unixbench.sh

chmod +x unixbench.sh

./unixbench.sh

推荐杜甫使用-本脚本支持查看I/O bench以及system info

支持查看硬件信息,硬盘通电时间,io等脚本,适合独立服务器使用

vps也能用

Github:https://github.com/Aniverse/A

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

LemonBench.sh

特点:

    服务器基础信息(CPU信息/内存信息/Swap信息/磁盘空间信息等)
    流媒体解锁情况
    Speedtest网速测试 (本地到最近源及国内各地域不同线路的网速)
    磁盘测试(4K块/1M块 直接写入测试)
    路由追踪测试(追踪到国内和海外不同线路的路由信息)
    Spoofer测试(获取详细网络信息,快速判断服务器接入线路)

快速测试:

curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast

完整测试:

curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s full

Superspeed三网多节点测速

特点:节点多,支持三网

Github:https://github.com/oooldking/script

bash <(curl -Lso- https://dl.233.mba/sh/speedtest.sh)

masonr大佬的yabs.sh

特点:支持速度测试,硬盘测试,Geekbench4/5

github:https://github.com/masonr/yet-another-bench-script

官方

wget -qO- yabs.sh | bash

或者

curl -sL yabs.sh | bash

镜像

wget –no-check-certificate https://dl.233.mba/sh/yabs.sh && bash yabs.sh

部分截图
部分截图

LovelyHaochi大佬的流媒体解锁测试脚本

特点:支持超多个流媒体的ipv4与ipv6解锁情况

bash <(curl -sSL "https://dl.233.mba/sh/media_test.sh")

部分截图
部分截图

Cloudflare warp一键脚本

内容过多,所以开了一贴做说明

回程测试脚本

特点:支持选择节点测试,四网快速测试,手动输入IP测试三种模式

Github:https://github.com/nanqinlang-script/testrace

部分截图
部分截图

脚本

wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh && bash testrace.sh

镜像 (国内机器或ipv6 only请使用这个)

wget https://dl.233.mba/sh/testrace.sh && bash testrace.sh

宝塔一键挂载硬盘脚本

特点:自动挂载至/www,方便快捷。支持Centos、Ubuntu、Debian、Fedora系统

官方BBS:https://www.bt.cn/bbs/thread-3187-1-1.html

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

腾讯云删除云镜监控

直接复制粘贴全部到SSH窗口即可

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

rm -rf /usr/local/qcloud

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

FunctionClub大佬的内存检测脚本

检测VPS真实可分配内存,适用于检测VPS超售情况

CentOS / RHEL:

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

 

 

本文地址:https://www.rezhanwang.com/zhujiyunwei/1840.html

责任编辑:热站网
 
QQ在线咨询