Skip to content

科技lion-工具脚本合集(目前最全)

shell
curl -sS -O https://raw.githubusercontent.com/kejilion/sh/main/kejilion.sh && chmod +x kejilion.sh && ./kejilion.sh

融合怪测试

shell
curl -L https://gitlab.com/spiritysdx/za/-/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
#OR
curl -L https://github.com/spiritLHLS/ecs/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh
#OR
bash <(wget -qO- bash.spiritlhl.net/ecs)

三网回程

shell
curl https://raw.githubusercontent.com/zhanghanyun/backtrace/main/install.sh -sSf | sh

流媒体解锁检测

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

ChatGPT 解锁检测

shell
wget -O chat.sh https://raw.githubusercontent.com/Netflixxp/chatGPT/main/chat.sh && chmod +x chat.sh && clear && ./chat.sh

测速

shell
# 全球
curl -sL network-speed.xyz | bash
# 亚洲
curl -sL network-speed.xyz | bash -s -- -r asia
# 国内
curl -sL network-speed.xyz | bash

bbr

shell
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh && chmod +x bbr.sh && ./bbr.sh

确认

shell
sysctl net.ipv4.tcp_congestion_control

fail2ban

shell
wget https://raw.githubusercontent.com/FunctionClub/Fail2ban/master/fail2ban.sh && bash fail2ban.sh 2>&1 | tee fail2ban.log

修改 root 密码

wget -q root.sh https://raw.githubusercontent.com/passeway/root/main/root.sh && chmod +x root.sh && ./root.sh

详细说明

脚本会根据用户选择,生成随机密码或者设置自定义密码,并将其应用于 root 用户。

脚本会修改 SSH 服务器的配置文件以允许 root 用户登录和使用密码进行身份验证,并重启 SSH 服务以应用更改。

docker 安装

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

修改docker镜像源 vim /etc/docker/daemon.json

https://docker.m.daocloud.io

docker-compose 安装

shell
curl -SL https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose && chmod +x /usr/local/bin/docker-compose

debian/ubuntu

shell
apt install docker-compose -y

seedbox 安装(杰佬)

shell
bash <(wget -qO- https://raw.githubusercontent.com/jerry048/Dedicated-Seedbox/main/Install.sh) -u <用戶名> -p <> -c <緩存大小(單位:MiB)> -q -l -b -v -r -3 -x -o

-u: 用戶名稱 -p: 密碼 -c: qBitorrent 的緩存大小 -q: qBittorrent 版本 -l: libtorrent 版本 -b: 安裝 autobrr -v: 安裝 vertex -r: 安裝 autoremove-torrents -3: 啓動 BBR V3 -x: 啓動 BBRx -o: 自定義端口

只安装 qb

shell
bash <(wget -qO- https://raw.githubusercontent.com/jerry048/Dedicated-Seedbox/main/Install.sh) -u <用戶名> -p <> -c 256 -q 4.3.9 -l v1.2.19

vertex-刷流

用户:admin 密码:vertex/data/password 文件内

shell
docker run -d \
  --name vertex \
  -v /root/vertex:/vertex \
  -p 3000:3000 \
  -e TZ=Asia/Shanghai \
  --restart unless-stopped \
  lswl/vertex:stable

qBittorrent 进种暂停后自动恢复

shell
bash <(wget -qO- https://raw.githubusercontent.com/ours1505/qBittorrentAutoResume/master/main.sh)

日志查看:

journalctl -u qBittorrentAutoResume.service

开启:

systemctl start qBittorrentAutoResume.service

关闭:

systemctl stop qBittorrentAutoResume.service

重载

systemctl restart qBittorrentAutoResume.service

配置文件

vim /opt/qBittorrentAutoResume/config.ini

流量监控

安装脚本

shell
apt-get install vnstat

查看是否运行

shell
systemctl status vnstat

查看监控网口

shell
ls /var/lib/vnstat/

view live traffic, enp2s0 为上面命令得到的监控网口

shell
vnstat -i enp2s0 -l

安装脚本

shell
apt-get install vnstat
shell
vnstat -h #查看过去24小时的流量
vnstat -d #查看过去30天的流量
vnstat -m #查看每个月的流量
vnstat -t #查看top10天的流量

端口被扫

统计UFW日志的访问ip,top10

sh
grep 'UFW BLOCK' /var/log/ufw.log | grep -oP '(?<=SRC=)[^ ]+' | sort | uniq -c | sort -nr | head -n 10

屏蔽ip段

shell
ufw deny from 79.124.0.0/16
ufw deny from 79.124.62.0/24

硬盘清理脚本

使用注意事项:脚本仅适用于debian系系统已提供apt,dnf,apk包管理器系统支持;使用前建议了解命令功能,以免造成不必要的损失;一般不建议在有足够空间的机器上使用这个脚本(因为没必要);请自行承担使用风险。

一键运行脚本:

shell
bash <(curl -s https://raw.githubusercontent.com/shannonlog2n/Linux_CleanUp_Script/main/server_cleanup.sh)

脚本代码

shell
#!/bin/bash

# 确保脚本以root权限运行
if [[ $EUID -ne 0 ]]; then
   echo "此脚本必须以root权限运行"
   exit 1
fi

start_space=$(df / | tail -n 1 | awk '{print $3}')

# 检测并设置包管理器变量
if command -v apt-get > /dev/null; then
    PKG_MANAGER="apt"
    CLEAN_CMD="apt-get autoremove -y && apt-get clean"
    PKG_UPDATE_CMD="apt-get update"
    INSTALL_CMD="apt-get install -y"
    PURGE_CMD="apt-get purge -y"
elif command -v dnf > /dev/null; then
    PKG_MANAGER="dnf"
    CLEAN_CMD="dnf autoremove -y && dnf clean all"
    PKG_UPDATE_CMD="dnf update"
    INSTALL_CMD="dnf install -y"
    PURGE_CMD="dnf remove -y"
elif command -v apk > /dev/null; then
    PKG_MANAGER="apk"
    CLEAN_CMD="apk cache clean"
    PKG_UPDATE_CMD="apk update"
    INSTALL_CMD="apk add"
    PURGE_CMD="apk del"
else
    echo "不支持的包管理器"
    exit 1
fi

# 正在更新依赖
echo "正在更新依赖..."
if [ "$PKG_MANAGER" = "apt" ] && [ ! -x /usr/bin/deborphan ]; then
    $PKG_UPDATE_CMD > /dev/null 2>&1
    $INSTALL_CMD deborphan > /dev/null 2>&1
fi

# 安全删除旧内核(只适用于使用apt和dnf的系统)
echo "正在删除未使用的内核..."
if [[ "$PKG_MANAGER" == "apt" || "$PKG_MANAGER" == "dnf" ]]; then
    current_kernel=$(uname -r)
    if [[ "$PKG_MANAGER" == "apt" ]]; then
        kernel_packages=$(dpkg --list | grep -E '^ii  linux-(image|headers)-[0-9]+' | awk '{ print $2 }' | grep -v "$current_kernel")
    else
        kernel_packages=$(rpm -qa | grep -E '^kernel-(core|modules|devel)-[0-9]+' | grep -v "$current_kernel")
    fi
    if [ ! -z "$kernel_packages" ]; then
        echo "找到旧内核,正在删除:$kernel_packages"
        $PURGE_CMD $kernel_packages > /dev/null 2>&1
        [[ "$PKG_MANAGER" == "apt" ]] && update-grub > /dev/null 2>&1
    else
        echo "没有旧内核需要删除。"
    fi
fi

# 清理系统日志文件
echo "正在清理系统日志文件..."
find /var/log -type f -name "*.log" -exec truncate -s 0 {} \; > /dev/null 2>&1
find /root -type f -name "*.log" -exec truncate -s 0 {} \; > /dev/null 2>&1
find /home -type f -name "*.log" -exec truncate -s 0 {} \; > /dev/null 2>&1
find /ql -type f -name "*.log" -exec truncate -s 0 {} \; > /dev/null 2>&1

# 清理缓存目录
echo "正在清理缓存目录..."
find /tmp -type f -mtime +1 -exec rm -f {} \;
find /var/tmp -type f -mtime +1 -exec rm -f {} \;
for user in /home/* /root; do
  cache_dir="$user/.cache"
  if [ -d "$cache_dir" ]; then
    rm -rf "$cache_dir"/* > /dev/null 2>&1
  fi
done

# 清理Docker(如果使用Docker)
if command -v docker &> /dev/null
then
    echo "正在清理Docker镜像、容器和卷..."
    docker system prune -a -f --volumes > /dev/null 2>&1
fi

# 清理孤立包(仅apt)
if [ "$PKG_MANAGER" = "apt" ]; then
    echo "正在清理孤立包..."
    deborphan --guess-all | xargs -r apt-get -y remove --purge > /dev/null 2>&1
fi

# 清理包管理器缓存
echo "正在清理包管理器缓存..."
$CLEAN_CMD > /dev/null 2>&1

end_space=$(df / | tail -n 1 | awk '{print $3}')
cleared_space=$((start_space - end_space))
echo "系统清理完成,清理了 $((cleared_space / 1024))M 空间!"

1panel安装

官网

debian

shell
curl -sSL https://resource.fit2cloud.com/1panel/package/quick_start.sh -o quick_start.sh && bash quick_start.sh

阿里云DD脚本

shell
wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh && bash InstallNET.sh -debian 12 -port "2022" -pwd 'password' -hostname "hostname" -timezone "Asia/Hong_Kong" -swap "2048" --bbr

注意:修改ssh端口,要在安全组放行端口

流量监控+推送

预设CDT200g

shell
sudo curl -o /root/TrafficCop/traffic_monitor_config.txt https://raw.githubusercontent.com/ypq123456789/TrafficCop/main/ali-200g && cat /root/TrafficCop/traffic_monitor_config.txt

流量监控+推送

shell
sudo apt update && mkdir -p /root/TrafficCop && curl -fsSL "https://raw.githubusercontent.com/ypq123456789/TrafficCop/main/trafficcop.sh" | tr -d '\r' > /root/TrafficCop/traffic_monitor.sh && chmod +x /root/TrafficCop/traffic_monitor.sh && bash /root/TrafficCop/traffic_monitor.sh && sudo curl -fsSL "https://raw.githubusercontent.com/ypq123456789/TrafficCop/main/tg_notifier.sh" | tr -d '\r' > /root/TrafficCop/tg_notifier.sh && chmod +x /root/TrafficCop/tg_notifier.sh && bash /root/TrafficCop/tg_notifier.sh

推送

shell
sudo apt update && mkdir -p /root/TrafficCop && curl -fsSL "https://raw.githubusercontent.com/ypq123456789/TrafficCop/main/tg_notifier.sh" | tr -d '\r' > /root/TrafficCop/tg_notifier.sh && chmod +x /root/TrafficCop/tg_notifier.sh && bash /root/TrafficCop/tg_notifier.sh

https://github.com/ypq123456789/TrafficCop

国内云删除监控脚本

shell
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/install_scripts/dlm.sh -o dlm.sh && chmod +x dlm.sh && bash dlm.sh