脚本

内核加速

# 查看内核版本
uname -r

# 更换内核 & 开启加速
wget -N --no-check-certificate "https://github.com/ylx2016/Linux-NetSpeed/raw/master/tcp.sh" && chmod +x tcp.sh && ./tcp.sh

探针

# 可乐探针下载

国外版
wget https://raw.githubusercontent.com/CokeMine/ServerStatus-Hotaru/master/status.sh
国内版
wget https://cokemine.coding.net/p/hotarunet/d/ServerStatus-Hotaru/git/raw/master/status.sh

显示客户端管理菜单
bash status.sh c

显示服务端管理菜单
bash status.sh s

# 哪吒探针下载

国外版
curl -L https://raw.githubusercontent.com/naiba/nezha/master/script/install.sh  -o nezha.sh && chmod +x nezha.sh
sudo ./nezha.sh
国内版
curl -L https://cdn.jsdelivr.net/gh/naiba/nezha@master/script/install.sh -o nezha.sh && chmod +x nezha.sh
CN=true sudo ./nezha.sh

更新软件

# Ubuntu
sudo apt-get update
sudo apt-get upgrade

# CentOS
yum -y update && yum -y upgrade

安装 Curl

# Ubuntu/Debian
apt-get update -y && apt-get install curl -y

# CentOS
yum update -y && yum install curl -y

安装 VIM

# Ubuntu/Debian
sudo apt-get install vim

# CentOS
yum -y install vim*

安装 iperf3

# Debian/Ubuntu
sudo apt install iperf3

# RHEL/CentOS
sudo yum install iperf3

# Fedora 22+
sudo dnf install iperf3

#使用方法
客户端 iperf3 -c ip地址 -p 端口 -R -P 线程
服务端 iperf3 -s -p 端口 -i 1

VPS 测试脚本

## SuperBench(国内)
wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
# 或者
curl -Lso- -no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
# 或者
wget -qO- git.io/superbench.sh | bash

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

## 秋水逸冰(国外)
wget -qO- bench.sh | bash

## 回程测试

# 一键测试:
curl http://tutu.ovh/bash/returnroute/test.sh|bash

# BestTrance测试:
apt-get install -y wget unzip && mkdir besttrace && cd besttrace && wget https://cdn.ipip.net/17mon/besttrace4linux.zip && unzip besttrace4linux.zip && chmod +x  besttrace
./besttrace 你的本地ip  -g cn

# 一键四网测试:
wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh
bash testrace.sh

# 性能跑分测试
curl -sL yabs.sh | bash

Linux 生成测试文件

# 生成 100MB 测试文件
dd if=/dev/zero of=100mb.bin bs=100M count=1     
# 更多详情 https://developers.wrmit.com/104/

Debian 9/10 快速开启 Google BBR

# 修改系统变量
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

# 保存生效
sysctl -p

# 查看内核是否已开启 BBR
sysctl net.ipv4.tcp_available_congestion_control

显示以下即已开启:

# sysctl net.ipv4.tcp_available_congestion_control

net.ipv4.tcp_available_congestion_control = bbr cubic reno

# 查看BBR是否启动
lsmod | grep bbr

显示以下即启动成功:

# lsmod | grep bbr

tcp_bbr                20480  14

安装 wget

# RHEL/CentOS
yum -y install wget       

# Debian/Ubuntu
apt-get install wget      

GCP、AWS 等大厂开启 root 登录

# 一键脚本
echo root:niconiconi |sudo chpasswd root         ##修改niconiconi为自己想设定的密码
sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config;
sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config;
sudo reboot

# 或者 手动设置
sudo -i

设置 root 密码(输入时不显示)
passwd root

然后编辑 ssh 配置文件(进入后点击 i 键)
vi /etc/ssh/sshd_config

找到下面的内容,并修改
PermitRootLogin no
PasswordAuthentication no
( no 改为 yes ,修改完成点击 ESC 键,输入 :wq 回车)

最后,重启 ssh
service sshd restart

时区

1. 查看当前时区
   date -R
2. 修改设置时区
   方法1:tzselect
   方法2:timeconfig                # RedHat Linux & CentOS
   方法3:dpkg-reconfigure tzdata   # Debian
3. 复制相应的时区文件,替换系统时区文件;或者创建链接文件:
   cp /usr/share/zoneinfo/$主时区/$次时区 /etc/localtime

在中国可以使用:
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

安装 git

# CentOS:
yum install git -y  或者  yum install -y git

# Ubuntu/Debian:
apt-get install git -y    

SpeedTest CLI

## If migrating from prior bintray install instructions please first...
# sudo rm /etc/apt/sources.list.d/speedtest.list
# sudo apt-get update
# sudo apt-get remove speedtest
## Other non-official binaries will conflict with Speedtest CLI
# Example how to remove using apt-get
# sudo apt-get remove speedtest-cli
sudo apt-get install curl
curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
sudo apt-get install speedtest

流媒体

# 流媒体检测
yum install -y curl jq 2> /dev/null || apt install -y curl jq && bash <(curl -sSL https://raw.githubusercontent.com/Netflixxp/NF/main/nf.sh)
或者
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)

# 一键安装WARP
bash <(curl -fsSL git.io/warp.sh) menu
或者
wget -N https://cdn.jsdelivr.net/gh/fscarmen/warp/menu.sh && bash menu.sh


# 更换WARP IP
wget https://github.com/luoxue-bot/warp_auto_change_ip/raw/main/warp_change_ip.sh && chmod +x warp_change_ip.sh && ./warp_change_ip.sh

screen -R warp                    # 进入名字为 warp 的 screen 窗口,若不存在,则自动创建
screen -ls                         # 查看已创建的 screen 窗口
ctrl + a,然后全松开,再按 d          # 离开当前 screen 窗口
ctrl + a,然后全松开,再按 Esc        # 此时可以用滚轮上下查看日志
exit                               # 退出并关闭当前 screen 窗口

一键换源

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

安装 iptables

# Ubuntu/Debian
sudo apt-get install iptables

# CentOS
yum -y install iptables

安装 dnsutils

# Ubuntu
sudo apt-get install dnsutils

# Debian
apt-get update
apt-get install dnsutils

# Fedora / CentOS
yum install bind-utils

安装 MTR

# CentOS/RHEL
yum install mtr
 
# Debian/Ubuntu
sudo apt install mtr-tiny
sudo apt install mtr    # with GUI