目 录CONTENT

文章目录

Linux整理一些常用的脚本

Violet
2023-07-30 / 1 评论 / 4 点赞 / 133 阅读 / 8108 字

脚本集合

添加SWAP虚拟内存

wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh

检测是否可以访问ChatGPT脚本

bash <(curl -Ls https://raw.githubusercontent.com/missuo/OpenAI-Checker/main/openai.sh)
bash <(curl -Ls https://ourl.co/oaic)
bash <(curl -Ls https://cdn.jsdelivr.net/gh/missuo/OpenAI-Checker/openai.sh)

综合工具箱(强烈推荐,集成了很多脚本)

wget -O box.sh https://raw.githubusercontent.com/BlueSkyXN/SKY-BOX/main/box.sh && chmod +x box.sh && clear && ./box.sh

DD脚本

非必需)DD一个纯净的系统

sudo apt update -y  #更新一下包

以下命令默认是Debian10,自定义root密码和自定义ssh端口自己修改成你自己想要的。

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "自定义root密码" -port "自定义ssh端口"

等待15到30分钟左右,连接即可,也可以自己ping一下域名,看看通不通,然后尝试连接。
其他参数

-d 10 -v 64
-d 9 -v 64
-u 20.04 -v 64
-u 18.04 -v 64

测试脚本

流媒体测试解锁

全媒体测试

就是用来测试一个VPS是否可以解锁 Youtube Netflix lulu Tiktok 等国外主流的流媒体 选择4

bash <(curl -L -s 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

机器测试

bench

wget -qO- bench.sh | bash

superbench

wget -qO- git.io/superbench.sh | bash

最全测速脚本

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

速度测试

显示延迟、抖动

bash <(wget -qO- https://bench.im/hyperspeed)

显示回程线路

回程线路 回程数据包国内的接入点是 59.43 段,通常来说这就是CN2 GIA的线路

curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash
wget -qO- git.io/autobesttrace | bash
wget -qO- git.io/besttrace | bash

四网测速

wget -O jcnf.sh https://raw.githubusercontent.com/Netflixxp/jcnfbesttrace/main/jcnf.sh

bash jcnf.sh

三网测速

bash <(curl -Lso- https://git.io/superspeed_uxh)

服务器时间

CentOS 同步时间

yum -y install ntpdate
timedatectl set-timezone Asia/Shanghai
ntpdate ntp1.aliyun.com

BBR

CentOS 7 BBR

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

Docker 相关

更新、安装必备软件

apt-get update && apt-get install -y wget vim

海外服务器

非大陆 Docker 安装

wget -qO- get.docker.com | bash

卸载 Docker

sudo apt-get purge docker-ce docker-ce-cli containerd.io
sudo rm -rf /var/lib/docker
sudo rm -rf /var/lib/containerd

非大陆 Docker-compose 安装

sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

查看版本

docker-compose --version

大陆服务器

国内机安装 docker

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

国内机安装 docker-compose

curl -L https://get.daocloud.io/docker/compose/releases/download/v2.1.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

卸载 docker

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

修改 Docker 配置(可选)

以下配置会增加一段自定义内网 IPv6 地址,开启容器的 IPv6 功能,以及限制日志文件大小,防止 Docker 日志塞满硬盘(泪的教训):

cat > /etc/docker/daemon.json <<EOF
{
    "log-driver": "json-file",
    "log-opts": {
        "max-size": "20m",
        "max-file": "3"
    },
    "ipv6": true,
    "fixed-cidr-v6": "fd00:dead:beef:c0::/80",
    "experimental":true,
    "ip6tables":true
}
EOF

然后重启 Docker 服务:

systemctl restart docker

防火墙

CentOS 关闭防火墙

systemctl start supervisord
systemctl disable firewalld
systemctl stop firewalld

绿色

X-UI

新版(推荐,支持reality)

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)

原版

bash <(curl -Ls https://raw.githubusercontent.com/vaxilu/x-ui/master/install.sh)
4

评论区