博风

  • 主页
博风
博览群识,铸学之基
  1. 首页
  2. 运维
  3. 正文

主机常用脚本集

2022年6月21日 3297点热度 3人点赞 0条评论

购置了新主机,作为主机玩家们无外乎三部曲:测速->重装->部署。作为博主经常为忘记相关脚本而烦恼,所以特意用烂笔头记录了主机的常用脚本,整理成集,为其命名主机常用脚本集。欢迎复制!

网络重装脚本
PS:自定义密码直接 -p 你想要的密码就行!!!
部分机器需要设置网卡,否则可以VNC,但是不能远程SSH

  1. -firmware                额外的驱动支持
  2. -d                        Debian系统 后面是系统版本号
  3. -c                        Centos系统 后面是系统版本号
  4. -v                         后面写64位 32位
  5. -a                        不清楚这个干啥的但是每个脚本都带
  6. --mirror                后面是镜像源地址
  7. -p                        后面写自定义密码
  8. –ip-addr                 ifconfig -a 后获取到的 例:194.87.xxx.xxx
  9. –ip-gate                 route -n    后获取到的 例   194.87.xxx.xxx
  10. –ip-mask                 255.255.xxx.xx

· 甲骨文、三毛、Vir、RN等自动安装,三毛、甲骨文 记得去掉 -firmware

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

手动安装(已支持Debian 12及Ubuntu 22.04以及Ubuntu 24.04)

  1. bash <(wget --no-check-certificate -qO- 'http://mirror.bofeng.net/InstallNET.Legacy.sh') -d 12 -v 64 -m

自定义SWAP大小

  1. wget --no-check-certificate -qO InstallNET.sh 'https://raw.githubusercontent.com/leitbogioro/Tools/master/Linux_reinstall/InstallNET.sh' && chmod a+x InstallNET.sh
  2. bash InstallNET.sh -debian 12 -swap "8192" -partition "gpt"

PS:如果你是腾讯云记得卸载组件 否则会导致报错 DD失败

  1. systemctl stop tat_agent
  2. systemctl disable tat_agent
  3. rm -rf /etc/systemd/system/tat_agent.service
  4. rm -fr /usr/local/qcloud
  5. ps -A | grep agent
  6. # 检查看是否还有腾讯云组件
  7. # kill 这个进程

· 国内VPS需要更换镜像源否则很慢!我这里使用的华为源,如果你是腾讯云后面可以换成内网源,节省流量,下面有写!

  1. bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a --mirror 'https://mirrors.huaweicloud.com/debian/' -p 自定义密码

镜像站地址
官方给出的地址列表:https://www.debian.org/mirror/list

  1. 一些国内的
  2. ftp.cn.debian.org
  3. mirror.bjtu.edu.cn
  4. mirror.lzu.edu.cn
  5. mirror.nju.edu.cn
  6. mirrors.163.com
  7. mirrors.bfsu.edu.cn
  8. mirrors.hit.edu.cn
  9. mirrors.huaweicloud.com
  10. mirror.sjtu.edu.cn
  11. mirrors.tuna.tsinghua.edu.cn
  12. mirrors.ustc.edu.cn
  13. 使用方法:(大致都是一样的)
  14. 清华源
  15. --mirror 'https://mirrors.ustc.edu.cn/debian/'
  16. 腾讯源
  17. --mirror 'http://mirrors.tencent.com/debian/'
  18. --mirror 'http://mirrors.cloud.tencent.com/debian/'
  19. 腾讯源内网(dd完毕后可以修改 走内网不费额外流量)
  20. http://mirrors.tencentyun.com/
  21. 阿里源
  22. --mirror 'https://mirrors.aliyun.com/debian/'
  23. 华为源
  24. --mirror 'https://mirrors.huaweicloud.com/debian/'

· DD windows

  1. wget --no-check-certificate -qO InstallNET.sh 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh' && bash InstallNET.sh -dd 'http://d.nat.ee/win/lite/win7-ent-sp1-x64-cn/win7-ent-sp1-x64-cn.vhd.gz'

· 带 WebUI 可查看进度的

  1. https://raw.githubusercontent.com/flyqie/dd-shell/master/Core_Install.sh

国内机可使用

  1. https://ghproxy.com/https://raw.githubusercontent.com/flyqie/dd-shell/master/Core_Install.sh

常用脚本

一键开启BBR(适用于较新的Debian、Ubuntu)

  1. echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
  2. echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
  3. sysctl -p
  4. sysctl net.ipv4.tcp_available_congestion_control
  5. lsmod | grep bbr

superbench

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

Bench.sh

  1. wget -qO- bench.sh | bash

YABS.sh

  1. wget -qO- yabs.sh | bash

融合怪

  1. curl -L https://github.com/spiritLHLS/ecs/raw/main/ecs.sh -o ecs.sh && chmod +x ecs.sh && bash ecs.sh

三网测速

  1. bash <(curl -sL https://raw.githubusercontent.com/i-abc/Speedtest/main/speedtest.sh)

流媒体

  1. # 第一个
  2. bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)
  3. # 第二个
  4. bash <(curl -sSL "https://github.com/CoiaPrant/MediaUnlock_Test/raw/main/check.sh")
  5. # 第三个(和第一个一样)
  6. bash <(curl -L -s check.unlock.media)

回程

  1. # 第一个
  2. wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh
  3. bash testrace.sh
  4. # 第二个
  5. wget -qO- git.io/besttrace | bash
  6. # 第三个
  7. curl http://tutu.ovh/bash/returnroute/test.sh | bash

yabs 机器跑分

  1. curl -sL yabs.sh | bash

一件安装docker
国外机

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

国内机

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

卸载docker

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

安装docker-compose
国外机

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

国内机

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

翻墙搭建

  1. Reality:wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh
标签: 暂无
最后更新:2024年12月17日

小白

一只专注于跨境电商的项目狗,主导过App、ERP、独立站、转运等项目全生命周期。对跨境电商相关业务极为熟悉...

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

最新 热点 随机
最新 热点 随机
ESXi在Linux中通过命令行导出与部署镜像 小米系智能摄像头SAMBA网络存储配置实录 锐角云等EMMC硬盘简单安装PVE 主机常用脚本集 Linux系统(Debian/CentOS)编译安装Git最新版(2.34.1)以及Gitolite
Linux系统(Debian/CentOS)编译安装Git最新版(2.34.1)以及Gitolite Debian系统RabbitMQ安装及配置 Linux配置PHP扩展AMQP最新版1.10.2 显卡的废物利用:利用AMD显卡(RX580)挖矿以太坊(ETH)的简明记录 Debian/CentOS等Linux开启Google BBR,实现高效加速
分类
  • 杂七杂八 / 4篇
  • 编程 / 1篇
  • 运维 / 9篇

COPYRIGHT © 2021 bofeng.org. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang