Back
Featured image of post 常用教程及脚本整理合集

常用教程及脚本整理合集

img
img

LemonBench服务器综合测试工具

快速测试

curl
curl -fsSL http://ilemonra.in/LemonBenchIntl | bash -s fast
wget
wget -qO- http://ilemonra.in/LemonBenchIntl | bash -s fast

完整测试

curl
curl -fsSL http://ilemonra.in/LemonBenchIntl | bash -s full
wget
wget -qO- http://ilemonra.in/LemonBenchIntl | bash -s full

流媒体测试脚本

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

回程测试脚本

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

Kos三网回程测试

yum install -y wget;wget -q kos.f2k.pub -O kos && sh kos 选择n

查询TCP连接

netstat -an |grep tcp

查询文件夹储存占用

du -h --max-depth=1 /

Python测试端口

python3 -m http.server 80

自签证书快速生成

https://github.com/soulteary/certs-maker

docker run --rm -it -e CERT_DNS="samsung.com;*.samsung.com" -e CERT_CN="Yui Certs" -e CERT_O="Yui" -v `pwd`/certs:/ssl soulteary/certs-maker

开启BBR

Centos7

一键安装最新内核并开启 BBR 脚本

wget --no-check-certificate -O /opt/bbr.sh https://github.com/teddysun/across/raw/master/bbr.sh
chmod 755 /opt/bbr.sh
/opt/bbr.sh

CentOS 8 / Debian ≥ 9

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
lsmod | grep bbr

DD脚本

版本1

https://hostloc.com/thread-645870-1-1.html

wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh

版本2

https://hostloc.com/thread-583956-1-2.html

##镜像文件在OneDrive
wget -N --no-check-certificate https://raw.githubusercontent.com/veip007/dd/master/dd-od.sh && chmod +x dd-od.sh && ./dd-od.sh
 
##镜像文件在GoogleDrive
wget -N --no-check-certificate https://raw.githubusercontent.com/veip007/dd/master/dd-gd.sh && chmod +x dd-gd.sh && ./dd-gd.sh

萌咖DD脚本

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

Usage:
 
    bash InstallNET.sh   -d/--debian [dist-name]
 
                -u/--ubuntu [dist-name]
 
                -c/--centos [dist-version]
 
                -v/--ver [32/i386|64/amd64]
 
                -p
 
                --ip-addr/--ip-gate/--ip-mask
 
                -apt/-yum/--mirror
 
                -dd/--image
 
                -a/-m
 
 
 
# dist-name: 发行版本代号
 
# dist-version: 发行版本号
 
# -p: 自定义密码
 
# -apt/-yum/--mirror : 使用定义镜像
 
# -a/-m : 询问是否能进入VNC自行操作. -a 为不提示(一般用于全自动安装), -m 为提示.

取消宝塔强制登陆

sed -i "s|if (bind_user == 'True') {|if (bind_user == 'REMOVED') {|g" /www/server/panel/BTPanel/static/js/index.js && rm -rf /www/server/panel/data/bind.pl
wget http://download.bt.cn/install/update/LinuxPanel-7.7.0.zip
unzip LinuxPanel-*
cd panel
bash update.sh
cd .. && rm -f LinuxPanel-*.zip && rm -rf panel

关闭IPV6

sysctl -w net.ipv6.conf.eth0.disable_ipv6=1

三网测速脚本

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

TCP窗口调优

wget http://sh.nekoneko.cloud/tools.sh -O tools.sh && bash tools.sh

Warp一键部署

bash <(curl -fsSL git.io/warp.sh) [SUBCOMMAND]
install         Install Cloudflare WARP Official Linux Client
uninstall       uninstall Cloudflare WARP Official Linux Client
proxy           Enable WARP Client Proxy Mode (default SOCKS5 port: 40000)
unproxy         Disable WARP Client Proxy Mode
wg4             Configuration WARP IPv4 Network interface (with WireGuard)
wg6             Configuration WARP IPv6 Network interface (with WireGuard)
wgd             Configuration WARP Dual Stack Network interface (with WireGuard)
rewg            Restart WARP WireGuard service
unwg            Disable WARP WireGuard service
status          Prints status information
version         Prints version information
help            Prints this message or the help of the given subcommand(s)
menu            Chinese special features menu

彩虹Kangle一键部署

yum -y install wget;wget http://kangle.cccyun.cn/start;sh start

Kangle操作命令

[http://wanganzhi.cn/2017/12/18/kengle%20%E4%BB%8B%E7%BB%8D%E5%8F%8A%E5%AE%89%E8%A3%85/](http://wanganzhi.cn/2017/12/18/kengle 介绍及安装/)

/vhs/kangle/bin/kangle
 
参数:  
  [-h --help]       可以看到详细的参数说明
  [-d level]         调试运行程序
  [-r --reload]     重新加载所有配置文件
  [--revh]           重新加载etc/vh.xml文件(etc/vh.xml)
  [--reboot]        平滑重起程序(原有程序会保证服务完客户),一般用来升级用的
  [-z [disk_dir]]   建立硬盘cache目录
  [-v --version]  查看程序版本
  [-a apache_config_file]  转换的Apache配置
  [-q]                 关闭程序
  [-n]            start program not in daemon

kOS工具箱

yum install -y wget;wget -q kos.f2k.pub -O kos && sh kos

Kangle多节点证书同步修复

把以下文件解压并覆盖到/vhs/kangle/nodewww/webftp/framework/api目录里,主节点和同步节点都要上传

Kangle Https下载

一键Swap脚本

wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh

ACME自动配置证书

#安装
curl  https://get.acme.sh | sh -s email=my@example.com
alias acme.sh=~/.acme.sh/acme.sh
 
#申请ecc证书
acme.sh --issue --dns dns_gd -d *.xxx.com -d xxx.com --keylength ec-256 
#自动部署
acme.sh --installcert -d *.xxx.com -d xxx.com --ecc --key-file /home/ftp/c/x/ssl.key --fullchain-file /home/ftp/c/x/ssl.crt --reloadcmd "service kangle restart"
#手动更新证书
acme.sh --renew -d *.xxx.com -d xxx.com --force --ecc
#停止自动更新
acme.sh --remove -d example.com --ecc

https://github.com/acmesh-official/acme.sh/wiki/dnsapi

EMBY 部署

常规部署

EMBY常规部署

Docker

EMBY Docker部署

docker pull emby/embyserver:latest
docker run -d --name=emby --restart=always -v /root/emby/config:/config -v /home/gdrive:/home/gdrive -p 8096:8096 -p 8920:8920 -e UID=1000 -e GID=100 -e GIDLIST=100 emby/embyserver:latest

Bitwarden搭建教程

基于宝塔Docker自建Bitwarden密码管理服务

Adguardhome搭建教程

AdGuardHome搭建教程

查询网络占用情况

Linux网络占用分析教程

comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy