Shell
实用脚本集合。

更新于 

shell

开启root远程登录

sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sed -i 's/PasswordAuthentication no/PasswordAuthentication yes/' /etc/ssh/sshd_config
systemctl restart sshd

安装docker

curl -fsSL https://get.docker.com | bash -s docker
systemctl start docker
systemctl enable docker

宝塔纯净版Centos全新安装命令

yum install -y wget && wget -O install.sh http://v7.hostcli.com/install/install_6.0.sh && sh install.sh

宝塔纯净版Debian全新安装命令

wget -O install.sh http://v7.hostcli.com/install/install-ubuntu_6.0.sh && bash install.sh

BBR-PLUS脚本

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

青龙必须要安装的依赖

docker exec -it qinglong bash
curl -fsSL https://ghproxy.com/https://raw.githubusercontent.com/FlechazoPh/QLDependency/main/Shell/QLOneKeyDependency.sh | sh

centos关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

swap

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

azure swap

dd if=/dev/zero of=/swapfile count=4096 bs=1M
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
vi /etc/fstab
/swapfile none swap sw 0 0

myip

ip=$(curl -s http://myip.ipip.net)
echo "My public IP address is: $ip"

danate

wget --no-check-certificate https://raw.github.com/Lozy/danted/master/install.sh -O install.sh

bash install.sh --port=18888 --user=weijiajin --passwd=weijiajin

/etc/init.d/sockd adduser USERNAME PASSWORD

sudo sed -i 's/del_uer/del_user/g' /etc/init.d/sockd

/etc/init.d/sockd deluser USERNAME

bash install.sh --uninstall

systemctl enable sockd.service

service sockd state

/etc/init.d/sockd state


增加网卡

ifconfig eth0:1 10.0.0.5 up
ifconfig eth0:2 10.0.0.6 up
ifconfig eth0:3 10.0.0.7 up
ifconfig eth0:4 10.0.0.8 up
ifconfig eth0:5 10.0.0.9 up
ifconfig eth0:6 10.0.0.10 up
ifconfig eth0:7 10.0.0.11 up
ifconfig eth0:8 10.0.0.12 up
ifconfig eth0:9 10.0.0.13 up

阿里云DD系统

LANG=en_US.UTF-8
wget --no-check-certificate -O AutoReinstall.sh https://git.io/AutoReinstall.sh && bash AutoReinstall.sh
Pwd@CentOS
LANG=en_US.UTF-8
fdisk -l
df -h
sfdisk -l
LANG=en_US.UTF-8
growpart /dev/vda 1
resize2fs /dev/vda1

一键回程三网路由

curl https://raw.githubusercontent.com/zhucaidan/mtr_trace/main/mtr_trace.sh|bash

speedtest测速脚本

wget -O speedtest-cli https://raw.githubusercontent.com/wejudging/shell/main/speedtest.py
chmod +x speedtest-cli
python speedtest-cli

生成秘钥

ssh-keygen -t rsa -b 4096 -C "Deploy Key" -f github-deploy-key -N ""

当前目录生成两个文件:

  • github-deploy-key —— 私钥
  • github-deploy-key.pub —— 公钥

图标生成

https://img.shields.io/badge/XXX-YYY-f38020?logo=cloudflare&logoColor=f38020&labelColor=282d33

博客更新子模块

cd /Users/weijiajin/Documents/wejudging.github.io/themes/stellar
git add .
git commit -m "12345"
git push

更新gpt_academic

git clone https://github.com/binary-husky/gpt_academic.git  # 下载项目
cd gpt_academic # 进入路径
nano config.py # 用任意文本编辑器编辑config.py, 配置 “Proxy”, “API_KEY” 以及 “WEB_PORT” (例如50923) 等
docker build -t gpt-academic . # 安装
#(最后一步-选择1)在Linux环境下,用`--net=host`更方便快捷
docker run --rm -it --net=host gpt-academic
#(最后一步-选择2)在macOS/windows环境下,只能用-p选项将容器上的端口(例如50923)暴露给主机上的端口
docker run --rm -it -e WEB_PORT=50923 -p 50923:50923 gpt-academic