From 920173da6d259a06a176403df2d0274e0e9446f8 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 12:14:48 +0800 Subject: [PATCH 001/165] Initial commit --- .gitignore | 129 +++++++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++++ README.md | 2 + 3 files changed, 152 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6e4761 --- /dev/null +++ b/.gitignore @@ -0,0 +1,129 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..09d0722 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 cloudend + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..05f1f99 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# scripts +Linux VPS tools From ad2ef6f6432e75ce3dd478b8499c434cabc8ea44 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 12:27:29 +0800 Subject: [PATCH 002/165] Create worldSpeed.sh --- worldSpeed.sh | 142 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 worldSpeed.sh diff --git a/worldSpeed.sh b/worldSpeed.sh new file mode 100644 index 0000000..63b694d --- /dev/null +++ b/worldSpeed.sh @@ -0,0 +1,142 @@ +#!/usr/bin/env bash + +# Usage: bash <(curl -Lso- https://git.io/speed_test) +# or: bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/speedtest.sh) [-4, -6] +# or: bash <(curl -Lso- https://raw.fastgit.org/CloudEndIO/scripts/main/speedtest.sh) +# or: bash <(curl -Lso- https://raw.fastgit.org/CloudEndIO/scripts/main/speedtest.sh) [-4, -6] + +# References: +# https://github.com/flyzy2005/scripts +# https://github.com/manvari/server-speedtest + +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE='\033[0;34m' +CYAN='\033[0;36m' +PLAIN='\033[0m' +BOLD="\033[1m" + +ipv6=$( [[ "${1}" =~ ^(-6)$ ]] && echo true || echo false ) +stack=$( [[ "$ipv6" = true ]] && echo "-6" || echo "-4" ) +if [ "`ping -6 2>&1 | grep 'invalid option'`" ]; then + PING=$( [[ "$ipv6" = true ]] && ([[ -x "`which ping6`" ]] && echo "ping6") || echo "ping" ) +else + PING=$( [[ "$ipv6" = true ]] && echo "ping -6" || echo "ping -4" ) +fi + +speed_test () { + local stacks=$3 + if [[ $stacks != *"${stack:1}"* ]]; then + # echo '- skip -' + return + fi + local speedtest=$(curl $stack -m 12 -Lo /dev/null -skw "%{speed_download}\n" "$1" ) + local host=$(awk -F':' '{print $1}' <<< `awk -F'/' '{print $3}' <<< $1`) + local ipaddress=$($PING -c1 -n ${host} | awk -F'[()]' '{print $2;exit}') + local nodeName=$2 + # printf "%-32s%-24s%-14s\n" "${nodeName}" "${ipaddress}" "$(FormatBytes $speedtest)" + printf "${YELLOW}%-32s${GREEN}%-24s${RED}%-14s${PLAIN}\n" "${nodeName}" "${ipaddress}" "$(FormatBytes $speedtest)" +} +region () { + printf "${CYAN}${BOLD}%-35s${PLAIN}\n" "----- $1 -----" +} +next () { + printf "%-70s\n" "-" | sed 's/\s/-/g' +} +promptYn () { + while true; do + read -p "$1 (y/n)" yn + case "${yn:-Y}" in + [Yy]* ) return 0;; + [Nn]* ) return 1;; + * ) echo "Please answer yes(y) or no(n).";; + esac + done +} +pastebin () { + text="$( sed "s/\x1B\[[0-9;]\{1,\}[A-Za-z]//g" <<< "${1}" )" + # echo "$text" + curl -w "URL: %{redirect_url}\n" -o /dev/null -s "https://paste.ubuntu.com" --data-urlencode "content=$text" -d "poster=speed_test" -d "syntax=bash" +} +FormatBytes () { + bytes=${1%.*} + local Mbps=$( printf "%s" "$bytes" | awk '{ printf "%.2f", $0 / 1024 / 1024 * 8 } END { if (NR == 0) { print "error" } }' ) + if [[ $bytes -lt 1000 ]]; then + printf "%8i B/s | N/A " $bytes + elif [[ $bytes -lt 1000000 ]]; then + local KiBs=$( printf "%s" "$bytes" | awk '{ printf "%.2f", $0 / 1024 } END { if (NR == 0) { print "error" } }' ) + printf "%7s KiB/s | %7s Mbps" "$KiBs" "$Mbps" + else + # awk way for accuracy + local MiBs=$( printf "%s" "$bytes" | awk '{ printf "%.2f", $0 / 1024 / 1024 } END { if (NR == 0) { print "error" } }' ) + printf "%7s MiB/s | %7s Mbps" "$MiBs" "$Mbps" + # bash way + # printf "%4s MiB/s | %4s Mbps""$(( bytes / 1024 / 1024 ))" "$(( bytes / 1024 / 1024 * 8 ))" + fi +} +# wget -O /dev/null http://www2.unicomtest.com:8080/download?size=100000000 +test () { + printf "%-32s%-31s%-14s\n" "Node Name" "IP address" "Download Speed" + + region "Global (CDN)" + speed_test 'http://cachefly.cachefly.net/100mb.test' 'CacheFly, CDN' '4' + speed_test 'https://speed.cloudflare.com/__down?bytes=100001000' 'Cloudflare, CDN' '4,6' + + region "Asia" + speed_test 'http://speedtest.hkg02.softlayer.com/downloads/test100.zip' 'Softlayer, HongKong, CN' '4,6' + speed_test 'http://mirror.hk.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, HongKong, CN' '4,6' + # speed_test 'https://hk.edis.at/100MB.test' 'EDIS, HongKong, CN' '4,6' + # speed_test 'http://hkg-speedtest.lg.bluevps.com/100MB.bin' 'BlueVPS, HongKong, CN' '4' + # speed_test 'http://hk4.lg.starrydns.com/100MB.test' 'StarryDNS, HongKong, CN' '4' + speed_test 'http://tpdb.speed2.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' + speed_test 'http://speedtest.tokyo2.linode.com/100MB-tokyo2.bin' 'Linode, Tokyo, JP' '4,6' + speed_test 'http://speedtest.tok02.softlayer.com/downloads/test100.zip' 'Softlayer, Tokyo, JP' '4,6' + speed_test 'http://speedtest.sng01.softlayer.com/downloads/test100.zip' 'Softlayer, Seoul, KR' '4,6' + speed_test 'http://speedtest.singapore.linode.com/100MB-singapore.bin' 'Linode, Singapore, SG' '4,6' + speed_test 'http://speedtest.sng01.softlayer.com/downloads/test100.zip' 'Softlayer, Singapore, SG' '4,6' + # speed_test 'http://mirror.sg.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, Singapore, SG' '4,6' + + # Northern America + region "Western US" + # speed_test 'http://speedtest.sjc01.softlayer.com/downloads/test100.zip' 'Softlayer, San Jose, US' '4,6' + speed_test 'http://speedtest.fremont.linode.com/100MB-fremont.bin' 'Linode, Fremont, US' '4,6' + speed_test 'http://mirror.sfo12.us.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, San Francisco, US' '4,6' + region "Central US" + speed_test 'http://speedtest.dal13.softlayer.com/downloads/test100.zip' 'Softlayer, Dallas, US' '4,6' + speed_test 'https://il-us-ping.vultr.com/vultr.com.100MB.bin' 'Vultr, Chicago, US' '4' + # speed_test 'http://lg.den2-c.fdcservers.net/100MBtest.zip' 'FDC, Denver, US' '4' + region "Eastern US" + speed_test 'http://speedtest.newark.linode.com/100MB-newark.bin' 'Linode, Newark, NJ, US' '4,6' + speed_test 'http://mirror.wdc1.us.leaseweb.net/speedtest/100mb.bin' 'Softlayer, Washington, US' '4,6' + region "Canada" + speed_test 'http://speedtest-tor1.digitalocean.com/100mb.test' 'DO, Toronto, CA' '4,6' + speed_test 'http://speedtest.mon01.softlayer.com/downloads/test100.zip' 'Softlayer, Montreal, CA' '4,6' + + # Europe + region "Western & Southern Europe" + speed_test 'http://speedtest.london.linode.com/100MB-london.bin' 'Linode, London, UK' '4,6' + speed_test 'http://speedtest.frankfurt.linode.com/100MB-frankfurt.bin' 'Linode, Frankfurt, DE' '4,6' + speed_test 'http://speedtest.fra02.softlayer.com/downloads/test100.zip' 'Softlayer, Frankfurt, DE' '4,6' + speed_test 'http://speedtest.par01.softlayer.com/downloads/test100.zip' 'Softlayer, Paris, FR' '4,6' + speed_test 'http://mirror.nl.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, Amsterdam, NL' '4,6' + region "Central & Eastern Europe" + speed_test 'http://ru.edis.at/100MB.test' 'EDIS, Moscow, RU' '4,6' + speed_test 'http://pl.edis.at/100MB.test' 'EDIS, Warsaw, PL' '4,6' + speed_test 'http://ro.edis.at/100MB.test' 'EDIS, Bucharest, RO' '4,6' + # speed_test 'http://hosthink.org/100mb.test' 'Hosthink, Istanbul, TR' '4' + speed_test 'http://lg.ist.binaryracks.com/100MB.test' 'Binaryracks, Istanbul, TR' '4' + # speed_test 'https://bg.edis.at/100MB.test' 'EDIS, Sofia, BG' '4,6' + next +} +# test + +tmp=$(mktemp) +test | tee $tmp +results="$(cat $tmp)" +rm -rf $tmp; + +if promptYn "Upload your results to to a \"PasteBin\" site?"; then + pastebin "$results" +fi From 69ab6a3e2c114be54fcc14746b194b1466840038 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 15:45:37 +0800 Subject: [PATCH 003/165] Update worldSpeed.sh --- worldSpeed.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/worldSpeed.sh b/worldSpeed.sh index 63b694d..a9a95b2 100644 --- a/worldSpeed.sh +++ b/worldSpeed.sh @@ -1,9 +1,11 @@ #!/usr/bin/env bash -# Usage: bash <(curl -Lso- https://git.io/speed_test) -# or: bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/speedtest.sh) [-4, -6] -# or: bash <(curl -Lso- https://raw.fastgit.org/CloudEndIO/scripts/main/speedtest.sh) -# or: bash <(curl -Lso- https://raw.fastgit.org/CloudEndIO/scripts/main/speedtest.sh) [-4, -6] +# Usage: +# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/worldSpeed.sh) [-4, -6] +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh) +# bash <(curl -Lso- https://raw.githack.com/cloudend/scripts/main/worldSpeed.sh) +# bash <(curl -Lso- https://gitcdn.link/cdn/cloudend/scripts/main/worldSpeed.sh) +# bash <(curl -Lso- https://raw.fastgit.org/cloudend/scripts/main/worldSpeed.sh) # References: # https://github.com/flyzy2005/scripts From 70e808032ab9e9cdcfee362703670c86e247934c Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 16:04:38 +0800 Subject: [PATCH 004/165] Update README.md --- README.md | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 05f1f99..af364fd 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,15 @@ # scripts -Linux VPS tools +Tools and Scripts for Linux VPS + + + + +- worldSpeed +```sh +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh) -4 +``` From 13739778f1aa6e4823578d0a8eb82205493c830d Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 16:08:46 +0800 Subject: [PATCH 005/165] Create FUNDING.yml --- .github/FUNDING.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..4ce239e --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,13 @@ +# These are supported funding model platforms + +github: [cloudend] +# patreon: # Replace with a single Patreon username +# open_collective: # Replace with a single Open Collective username +# ko_fi: # Replace with a single Ko-fi username +# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel +# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +# liberapay: # Replace with a single Liberapay username +# issuehunt: # Replace with a single IssueHunt username +# otechie: # Replace with a single Otechie username +# lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry +# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From 8d1c6406bfc0757095ecaeab89052a322519c095 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 17:08:58 +0800 Subject: [PATCH 006/165] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 4ce239e..347484f 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -10,4 +10,4 @@ github: [cloudend] # issuehunt: # Replace with a single IssueHunt username # otechie: # Replace with a single Otechie username # lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry -# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom:["https://www.paypal.me/bashscript"] From 57f58d5ec03cf65e9f9639ed68eb061f0f84de3f Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 17:41:53 +0800 Subject: [PATCH 007/165] Create tools.sh --- tools.sh | 287 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 287 insertions(+) create mode 100644 tools.sh diff --git a/tools.sh b/tools.sh new file mode 100644 index 0000000..d6f7498 --- /dev/null +++ b/tools.sh @@ -0,0 +1,287 @@ +#!/usr/bin/env bash + +# Usage: +# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] -p +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) +# bash <(curl -Lso- https://raw.githack.com/cloudend/scripts/main/tools.sh) +# bash <(curl -Lso- https://gitcdn.link/cdn/cloudend/scripts/main/tools.sh) +# bash <(curl -Lso- https://raw.fastgit.org/cloudend/scripts/main/tools.sh) + + +OS=$(uname -s) +# DISTRO=$( [[ -e $(which lsb_release) ]] && (lsb_release -si) || echo 'unknown' ) which/lsb_release command not found +DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) +name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) +prerelease=$( [[ "${2}" =~ ^(-p|prerelease)$ ]] && echo true || echo false ) +debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) + +check_root () { + if [[ "$USER" != 'root' ]]; then + echo 'Please run this script as root!' + if [[ "$debug" != true ]]; then exit 1; fi + fi +} +prompt_yn () { + while true; do + read -p "$1 (y/N)" yn + case "${yn:-${2:-N}}" in + [Yy]* ) return 0;; + [Nn]* ) return 1;; + * ) echo "Please answer yes(y) or no(n).";; + esac + done +} +init () { + case "${DISTRO}" in + Debian*|Ubuntu*) + apt install -y curl wget zip unzip tar xz-utils gzip; + ;; + CentOS*|RedHat*) + yum install -y curl wget zip unzip tar xz gzip; + ;; + *) + ;; + esac + + case "$name" in + snell) + app="snell" + repo="surge-networks/snell" + match="linux-amd64" + config="/root/snell.conf" + ;; + realm) + app="realm" + repo="zhboner/realm" + match="" + config="/root/realm.json" + ;; + gost) + app="gost" + repo="ginuerzh/gost" + match="linux-amd64" + config="/root/gost.json" + ;; + ss | shadowsocks) + app="ss" + repo="shadowsocks/shadowsocks-rust" + match="x86_64.*linux-gnu" + config="/root/ss.json" + ;; + nali) + app="nali" + repo="zu1k/nali" + match="linux-amd64" + ;; + wtrace | worsttrace) + app="wtrace" + ;; + ddns-go) + app="ddns-go" + repo="jeessy2/ddns-go" + match="Linux_*x86_64" + autogen="/root/ddns-go.yaml" + ;; + *) + echo "Please specify app_name (snell|realm|gost|ss|nali|wtrace|ddns-go)" + exit + ;; + esac +} +download () { + suffix=$( [[ "$prerelease" = true ]] && echo "releases" || echo "releases/latest" ) + if [[ -n "$repo" ]]; then + api="https://api.github.com/repos/$repo/$suffix" + url=$( curl -s $api | grep "browser_download_url.*$match" | head -1 | cut -d : -f 2,3 | xargs echo ) # xargs wget + # url=${url/"https://github.com"/"https://hub.fastgit.org"} # cdn + url="https://ghproxy.com/$url" # cdn + fi + case "$app" in + realm) + if [[ "$debug" != true ]]; then + rm -rf /usr/bin/realm ./realm; + fi + ;; + wtrace) + url="https://pkg.wtrace.app/linux/worsttrace" + ;; + esac + echo -e "\n[Download] $url" + if [[ "$debug" != true ]]; then + wget $url + fi + # echo -e "\n[Extract files]" + # tar xJvf .tar.xz/.txz # apt install -y xz-utils + # tar xzvf .tar.gz + # tar xvf .tar + # unzip -o .zip # apt install -y unzip + # gzip -d .gz + if [[ "$debug" = true ]]; then return; fi + case "$app" in + snell) + unzip -o snell*.zip; rm -rf snell-server-*.zip*; + mv ./snell-server /usr/bin/; + ;; + realm) + # curl -s https://api.github.com/repos/zhboner/realm/releases/latest | grep "browser_download_url.*" | cut -d : -f 2,3 | xargs wget -O ./realm {}; chmod +x realm + mv ./realm /usr/bin/realm; chmod +x /usr/bin/realm; + ;; + gost) + gzip -d gost-*.gz; mv ./gost-* /usr/bin/gost; chmod +x /usr/bin/gost; + ;; + ss) + tar xJf shadowsocks-*.xz && rm -rf shadowsocks-*.xz*; mv ./ssserver ./sslocal ./ssurl ./ssmanager ./ssservice /usr/bin/; + ;; + nali) + gzip -d nali-*.gz; mv ./nali-* /usr/bin/nali; chmod +x /usr/bin/nali; + ;; + wtrace) + mv ./worsttrace /usr/bin/worsttrace; chmod +x /usr/bin/worsttrace; + ;; + ddns-go) + tar xzf ddns-go_*tar.gz; mv ./ddns-go /usr/bin/; rm -rf ddns-go_*tar.gz* LICENSE README.md; + ;; + *);; + esac +} +gen_service () { + case "$app" in + snell) + service='[Unit]\nDescription=Snell Service\nAfter=network.target\n[Service]\nType=simple\nLimitNOFILE=32768\nRestart=on-failure\nExecStart=/usr/bin/snell-server -c /root/snell.conf\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=snell-server\n[Install]\nWantedBy=multi-user.target\n' + ;; + realm) + service='[Unit]\nDescription=realm\nAfter=network-online.target\nWants=network-online.target systemd-networkd-wait-online.service\n[Service]\nType=simple\nUser=root\nRestart=on-failure\nRestartSec=5s\nExecStart=/usr/bin/realm -c /root/realm.json\n[Install]\nWantedBy=multi-user.target' + ;; + gost) + service='[Unit]\nDescription=gost\nAfter=network-online.target\nWants=network-online.target systemd-networkd-wait-online.service\n[Service]\nType=simple\nUser=root\nRestart=on-failure\nRestartSec=5s\nExecStart=/usr/bin/gost -C /root/gost.json\n[Install]\nWantedBy=multi-user.target' + ;; + ss) + service='[Unit]\nDescription=Shadowsocks\nAfter=network.target\n[Service]\nType=simple\nRestart=on-failure\nExecStart=/usr/bin/ssserver -c /root/ss.json\n[Install]\nWantedBy=multi-user.target\n' + ;; + ddns-go) + service='[Unit]\nDescription=ddns-go\n[Service]\nExecStart=/usr/bin/ddns-go "-l" ":9876" "-f" "120" "-c" "/root/ddns-go.yaml"\nStartLimitInterval=5\nStartLimitBurst=10\nRestart=always\nRestartSec=120\n[Install]\nWantedBy=multi-user.target\n' + ;; + esac + if ! [[ -n "$service" ]]; then return; fi + echo -e "\n[Generate service]" + if [[ "$debug" = true ]]; then + echo -e $service + else + echo -e $service > "/etc/systemd/system/$app.service"; + systemctl daemon-reload; + systemctl enable "$app"; + fi +} +gen_config () { + if ! [[ -n "$config" ]]; then return; fi # no config path + # if [[ -f "$config" ]]; then + # if ! prompt_yn "\"$config\" already exists, do you want to overwrite it?"; then return; fi + # else + # if ! prompt_yn "Do you want to create \"$config\"?"; then return; fi + # fi + # read -p "Specify port number: " port + # while [[ ! ${port} =~ ^[0-9]+$ ]]; do + # echo "Please enter number of port:" + # read port + # done + # port=$(( ${RANDOM:0:4} + 10000 )) # random 10000-20000 + port="${port:-1234}" + pass=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | cut -b1-16) + echo -e "\n[Create config file] \"$config\", for example:" + # conf=('{' + # '}') + # conf="$(printf "%s\n" "${conf[@]}")" + # conf="$( + # echo '{' + # echo '}' + # )" + case "$app" in + snell) + conf="[snell-server]\nlisten = 0.0.0.0:$port\npsk = $pass\nobfs = tls" + ;; + realm) + conf=('{' + ' "listening_addresses": ["0.0.0.0"],' + ' "listening_ports": ["10001-10002"],' + ' "remote_addresses": [' + ' "1.1.1.1",' + ' "1.1.1.2"' + ' ],' + ' "remote_ports": [' + ' "80",' + ' "443"' + ' ]' + '}') + conf="$(printf "%s\n" "${conf[@]}")" + ;; + gost) + conf=('{' + ' "Debug": true,' + ' "Retries": 0,' + ' "ServeNodes": [' + ' "tcp://:24000/ipv6.itiioulet.dinghaojc.com:24000"' + ' ],' + ' "ChainNodes": [' + ' ],' + ' "Routes": [' + ' ]' + '}') + conf="$(printf "%s\n" "${conf[@]}")" + ;; + ss) + conf=('{' + ' "server": "0.0.0.0",' + ' "server_port": '$port',' + ' "method": "chacha20-ietf-poly1305",' + ' "password": "'$pass'",' + ' "mode": "tcp_only",' + ' "fast_open": false,' + ' "timeout": 300' + '}') + conf="$(printf "%s\n" "${conf[@]}")" + ;; + esac + if [[ -n "$config" ]]; then + echo -e "$conf" + fi +} +finally () { + # echo "Port: $port" + # echo "Password: $pass" + if [[ -n "$service" ]]; then + echo -e "\n[Enable and start service]" + if [[ -n "$config" ]]; then + echo -e "- Please make sure \"$config\" exists.\n- Run the following commands:" + fi + else + echo -e "\n[Usage]" + fi + case "$app" in + nali) + tips="nali update;\nping g.cn | nali;\ntraceroute 189.cn | nali" + ;; + wtrace) + tips="worsttrace g.cn;" + ;; + ddns-go) + tips="systemctl restart $app;\n\nOpen http://127.0.0.1:9876 for configuration." + ;; + *) + tips="systemctl restart $app; systemctl status $app;" + ;; + esac + if [[ -n "$tips" ]]; then + echo -e "$tips\n" + fi + if [[ -n "$autogen" ]]; then + echo -e "\n[Auto Generate file] \"$autogen\"\n" + fi +} + +# echo "name: $name; repo=$repo; prerelease=$prerelease" +init +check_root +download +gen_service +gen_config +finally From ebefd671512e1a1d10d888330c248c33d98d4959 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 17:43:46 +0800 Subject: [PATCH 008/165] Update README.md --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index af364fd..258df9f 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,16 @@ Tools and Scripts for Linux VPS ```sh bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh) -4 ``` + +- install ddns-go +```sh +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) ddns-go -p +``` +- install gost +```sh +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) gost -p +``` +- install realm +```sh +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) realm -p +``` From c7cc597a5ef20d73b22e29e79aac5b7455b1a26f Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 17:46:10 +0800 Subject: [PATCH 009/165] Create paste.sh --- paste.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 paste.sh diff --git a/paste.sh b/paste.sh new file mode 100644 index 0000000..612a19b --- /dev/null +++ b/paste.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +# Usage: +# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/paste.sh) [poster] +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/paste.sh) [poster] + +echo "Paste your content:" +IFS= read -d '' -n 1 text +while IFS= read -d '' -n 1 -t 2 c +do + text+=$c +done + +# text=$(cat <<- 'EOF' +# ~text~ +# EOF +# ); + +# echo "poster=$1" +# echo "content=$text" + +curl -w "URL: %{redirect_url}\n" -o /dev/null -s "https://paste.ubuntu.com" --data-urlencode "content=$text" -d "poster=$1" -d "syntax=bash" From bb40d23a180f9d5096d1319239dce84605e7d581 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 17:47:35 +0800 Subject: [PATCH 010/165] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 258df9f..fcf06cf 100644 --- a/README.md +++ b/README.md @@ -26,3 +26,8 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) ```sh bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) realm -p ``` + +- paste text and share +``` +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/paste.sh) +``` From 3b535f2be71cd7b464705629f24cf10da513810a Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 2 Mar 2022 17:50:29 +0800 Subject: [PATCH 011/165] Create autoWorstTrace.sh --- autoWorstTrace.sh | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 autoWorstTrace.sh diff --git a/autoWorstTrace.sh b/autoWorstTrace.sh new file mode 100644 index 0000000..8187566 --- /dev/null +++ b/autoWorstTrace.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +# Usage: +# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/autoWorstTrace.sh) +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTrace.sh) + +# install worsttrace +if [ ! -f "/usr/bin/worsttrace" ]; then + bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) wtrace -p +fi + +## start to use besttrace + +next() { + printf "%-70s\n" "-" | sed 's/\s/-/g' +} + +clear +next + +ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 202.112.14.151) +ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 成都教育网) +# ip_len=${#ip_list[@]} + +for i in {0..7} +do + echo ${ip_addr[$i]} + worsttrace ${ip_list[$i]} | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' + next +done +# worsttrace 202.112.14.151 | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' From f4cfb98d0e9fa0dedd60d73df89893b703a086b8 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 3 Mar 2022 09:15:26 +0800 Subject: [PATCH 012/165] arm support --- tools.sh | 134 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 97 insertions(+), 37 deletions(-) diff --git a/tools.sh b/tools.sh index d6f7498..9e0f0c6 100644 --- a/tools.sh +++ b/tools.sh @@ -8,7 +8,15 @@ # bash <(curl -Lso- https://raw.fastgit.org/cloudend/scripts/main/tools.sh) -OS=$(uname -s) +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BOLD="\033[1m" +NC='\033[0m' + +OS=$(uname -s) # Linux, FreeBSD, Darwin +ARCH=$(uname -m) # x86_64, arm64, aarch64 # DISTRO=$( [[ -e $(which lsb_release) ]] && (lsb_release -si) || echo 'unknown' ) which/lsb_release command not found DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) @@ -17,8 +25,8 @@ debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) check_root () { if [[ "$USER" != 'root' ]]; then - echo 'Please run this script as root!' - if [[ "$debug" != true ]]; then exit 1; fi + printf "${RED}[x] Please run this script as root! \n${NC}"; exit 1; + # if [[ "$debug" != true ]]; then exit 1; fi fi } prompt_yn () { @@ -32,62 +40,107 @@ prompt_yn () { done } init () { - case "${DISTRO}" in - Debian*|Ubuntu*) - apt install -y curl wget zip unzip tar xz-utils gzip; - ;; - CentOS*|RedHat*) - yum install -y curl wget zip unzip tar xz gzip; - ;; - *) - ;; - esac - case "$name" in snell) app="snell" - repo="surge-networks/snell" - match="linux-amd64" config="/root/snell.conf" + repo="surge-networks/snell" + case $ARCH in + aarch64) + match="linux-aarch64" + ;; + *) #x86_64 + match="linux-amd64" + ;; + esac ;; realm) app="realm" - repo="zhboner/realm" - match="" config="/root/realm.json" + # repo="zhboner/realm" + # match="" + repo="zephyrchien/realm" + case $ARCH in + aarch64) + match="aarch64.*linux-gnu.*.gz" + ;; + *) #x86_64 + match="x86_64.*linux-gnu.*.gz" + ;; + esac ;; gost) app="gost" - repo="ginuerzh/gost" - match="linux-amd64" config="/root/gost.json" + repo="ginuerzh/gost" + case $ARCH in + aarch64) + match="linux-armv8" + ;; + *) #x86_64 + match="linux-amd64" + ;; + esac ;; ss | shadowsocks) app="ss" - repo="shadowsocks/shadowsocks-rust" - match="x86_64.*linux-gnu" config="/root/ss.json" + repo="shadowsocks/shadowsocks-rust" + case $ARCH in + aarch64) + match="aarch64.*linux-gnu" + ;; + *) #x86_64 + match="x86_64.*linux-gnu" + ;; + esac ;; nali) app="nali" repo="zu1k/nali" - match="linux-amd64" + case $ARCH in + aarch64) + match="linux-armv8" + ;; + *) #x86_64 + match="linux-amd64" + ;; + esac ;; wtrace | worsttrace) app="wtrace" ;; ddns-go) app="ddns-go" + config="/root/ddns-go.yaml" repo="jeessy2/ddns-go" - match="Linux_*x86_64" - autogen="/root/ddns-go.yaml" + case $ARCH in + aarch64) + match="Linux_.*arm64" + ;; + *) #x86_64 + match="Linux_.*x86_64" + ;; + esac ;; *) - echo "Please specify app_name (snell|realm|gost|ss|nali|wtrace|ddns-go)" + printf "${YELLOW}Please specify app_name (snell|realm|gost|ss|nali|wtrace|ddns-go)\n\n${NC}"; exit ;; esac } +install_deps () { + case "${DISTRO}" in + Debian*|Ubuntu*) + apt install -y curl wget zip unzip tar xz-utils gzip; + ;; + CentOS*|RedHat*) + yum install -y curl wget zip unzip tar xz gzip; + ;; + *) + ;; + esac +} download () { suffix=$( [[ "$prerelease" = true ]] && echo "releases" || echo "releases/latest" ) if [[ -n "$repo" ]]; then @@ -103,10 +156,17 @@ download () { fi ;; wtrace) - url="https://pkg.wtrace.app/linux/worsttrace" + case $ARCH in + aarch64) + printf "${RED}[x] $ARCH not supported ${PLAIN}\n${NC}"; exit 1; + ;; + *) #x86_64 + url="https://pkg.wtrace.app/linux/worsttrace" + ;; + esac ;; esac - echo -e "\n[Download] $url" + echo -e "${GREEN}\n[Download]${NC} $url" if [[ "$debug" != true ]]; then wget $url fi @@ -124,6 +184,7 @@ download () { ;; realm) # curl -s https://api.github.com/repos/zhboner/realm/releases/latest | grep "browser_download_url.*" | cut -d : -f 2,3 | xargs wget -O ./realm {}; chmod +x realm + if [[ `compgen -G "realm*.tar.gz"` ]]; then tar xzvf realm*.tar.gz; rm -rf realm*.tar.gz; fi mv ./realm /usr/bin/realm; chmod +x /usr/bin/realm; ;; gost) @@ -163,7 +224,7 @@ gen_service () { ;; esac if ! [[ -n "$service" ]]; then return; fi - echo -e "\n[Generate service]" + echo -e "${GREEN}\n[Generate service]${NC}" if [[ "$debug" = true ]]; then echo -e $service else @@ -187,7 +248,6 @@ gen_config () { # port=$(( ${RANDOM:0:4} + 10000 )) # random 10000-20000 port="${port:-1234}" pass=$(openssl rand -base64 32 | tr -dc A-Za-z0-9 | cut -b1-16) - echo -e "\n[Create config file] \"$config\", for example:" # conf=('{' # '}') # conf="$(printf "%s\n" "${conf[@]}")" @@ -241,7 +301,8 @@ gen_config () { conf="$(printf "%s\n" "${conf[@]}")" ;; esac - if [[ -n "$config" ]]; then + if [[ -n "$config" && -n "$conf" ]]; then + echo -e "\n[Create config file] \"$config\", for example:" echo -e "$conf" fi } @@ -249,12 +310,12 @@ finally () { # echo "Port: $port" # echo "Password: $pass" if [[ -n "$service" ]]; then - echo -e "\n[Enable and start service]" - if [[ -n "$config" ]]; then + echo -e "${GREEN}\n[Enable and start service]${NC}" + if [[ -n "$config" && -n "$conf" ]]; then echo -e "- Please make sure \"$config\" exists.\n- Run the following commands:" fi else - echo -e "\n[Usage]" + echo -e "${GREEN}\n[Usage]${NC}" fi case "$app" in nali) @@ -265,6 +326,7 @@ finally () { ;; ddns-go) tips="systemctl restart $app;\n\nOpen http://127.0.0.1:9876 for configuration." + tips="$tips\n\n [Auto-generated] \"$config\"\n" ;; *) tips="systemctl restart $app; systemctl status $app;" @@ -273,14 +335,12 @@ finally () { if [[ -n "$tips" ]]; then echo -e "$tips\n" fi - if [[ -n "$autogen" ]]; then - echo -e "\n[Auto Generate file] \"$autogen\"\n" - fi } # echo "name: $name; repo=$repo; prerelease=$prerelease" init check_root +install_deps download gen_service gen_config From 072a7e44a51faf3a51b61857f349ca3238d46b05 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 3 Mar 2022 09:16:49 +0800 Subject: [PATCH 013/165] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index fcf06cf..e194ffb 100644 --- a/README.md +++ b/README.md @@ -31,3 +31,8 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) ``` bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/paste.sh) ``` + +update cache: + +https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh +https://purge.jsdelivr.net/gh/cloudend/scripts@main/speedtest.sh From 5cfe1efc64473230176d3f3462d3e921cc522725 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 3 Mar 2022 14:19:16 +0800 Subject: [PATCH 014/165] Update tools.sh --- tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools.sh b/tools.sh index 9e0f0c6..b56b7c5 100644 --- a/tools.sh +++ b/tools.sh @@ -24,7 +24,7 @@ prerelease=$( [[ "${2}" =~ ^(-p|prerelease)$ ]] && echo true || echo false ) debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) check_root () { - if [[ "$USER" != 'root' ]]; then + if [[ "$USER" != 'root' ]]; then # [[ "$EUID" -ne 0 ]] printf "${RED}[x] Please run this script as root! \n${NC}"; exit 1; # if [[ "$debug" != true ]]; then exit 1; fi fi From 900989a122fd260ea3795d3e3bbb40a4142f6d62 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 6 Mar 2022 18:32:47 +0800 Subject: [PATCH 015/165] Create unlockTest.sh --- unlockTest.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 unlockTest.sh diff --git a/unlockTest.sh b/unlockTest.sh new file mode 100644 index 0000000..b1bb5c5 --- /dev/null +++ b/unlockTest.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +# bash <(curl -L -s check.unlock.media) +# https://github.com/lmc999/RegionRestrictionCheck + +bash <( + curl -L -s check.unlock.media \ + | sed '/^[ \t]*echo\( -e\)\? "[-]*"\(.*\)\?$/d' \ + | sed '/^[ \t]*echo\( -e\)\? "[=]*"\(.*\)\?$/d' \ + | sed 's/ CheckV6().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ + | sed 's/ Goodbye().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ + | sed '/echo\( -e\)\? ""\(.*\)\?$/d' +) + From fc9f0ba408ef53eeb2e32e668b3b4d618c8ee434 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 6 Mar 2022 18:36:28 +0800 Subject: [PATCH 016/165] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index e194ffb..b2b6331 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,11 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/paste.sh) ``` +- unlockTest +``` +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.sh) +``` + update cache: https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh From 479164e9bcc622af48016f80bf53fbc8695410be Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 12:14:14 +0800 Subject: [PATCH 017/165] Create superBench --- superBench | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 superBench diff --git a/superBench b/superBench new file mode 100644 index 0000000..4ca0f67 --- /dev/null +++ b/superBench @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +# https://github.com/oooldking/script + +bash <( + curl -Lso- https://raw.githubusercontent.com/oooldking/script/master/superbench_git.sh \ + | sed '/^[ \t]*speed_fast_com$/d' +) From 7de5f8356383dc5f7c72aa2200dadb4be08b597f Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 12:36:22 +0800 Subject: [PATCH 018/165] Update and rename superBench to superBench.sh --- superBench => superBench.sh | 2 ++ 1 file changed, 2 insertions(+) rename superBench => superBench.sh (71%) diff --git a/superBench b/superBench.sh similarity index 71% rename from superBench rename to superBench.sh index 4ca0f67..cba4da1 100644 --- a/superBench +++ b/superBench.sh @@ -4,5 +4,7 @@ bash <( curl -Lso- https://raw.githubusercontent.com/oooldking/script/master/superbench_git.sh \ + | sed 's/^.*fast\.com.*$/:;/I' \ + | sed 's/^.*[ /]fast_com.*.py.*$/#/I' \ | sed '/^[ \t]*speed_fast_com$/d' ) From 68f8ba4e0013105ff30b687b6ad45f8613806710 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 12:39:13 +0800 Subject: [PATCH 019/165] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index b2b6331..17e877f 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,12 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/paste.sh) bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.sh) ``` +- superBench +``` +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh) +``` + + update cache: https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh From d708d3d5d23fd2d0568df093e2a589e36fdf65fd Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 12:40:58 +0800 Subject: [PATCH 020/165] Create autoBestTrace.sh --- autoBestTrace.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 autoBestTrace.sh diff --git a/autoBestTrace.sh b/autoBestTrace.sh new file mode 100644 index 0000000..cf5bfe9 --- /dev/null +++ b/autoBestTrace.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +# https://github.com/nyjx/autoBestTrace +# https://github.com/flyzy2005/shell + + +bash <( + curl -Lso- https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh +) From 06f8857e8058b113a15d24337f6f6c0c3c83bc0e Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 12:42:43 +0800 Subject: [PATCH 021/165] Update README.md --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 17e877f..d509407 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,14 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.s bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh) ``` +- autoBestTrace +``` +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoBestTrace.sh) +``` +- autoWorstTrace +``` +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTrace.sh) +``` update cache: From de138152a9cd7ec0ce0f887a3c617dc7a55335b4 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 16:13:52 +0800 Subject: [PATCH 022/165] Update worldSpeed.sh --- worldSpeed.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/worldSpeed.sh b/worldSpeed.sh index a9a95b2..a8f1ade 100644 --- a/worldSpeed.sh +++ b/worldSpeed.sh @@ -35,7 +35,7 @@ speed_test () { return fi local speedtest=$(curl $stack -m 12 -Lo /dev/null -skw "%{speed_download}\n" "$1" ) - local host=$(awk -F':' '{print $1}' <<< `awk -F'/' '{print $3}' <<< $1`) + local host=$((awk '{gsub(/^.*@/,"", $0); print $0}' | awk -F':' '{print $1}') <<< `awk -F'/' '{print $3}' <<< $1`) local ipaddress=$($PING -c1 -n ${host} | awk -F'[()]' '{print $2;exit}') local nodeName=$2 # printf "%-32s%-24s%-14s\n" "${nodeName}" "${ipaddress}" "$(FormatBytes $speedtest)" @@ -92,7 +92,8 @@ test () { # speed_test 'https://hk.edis.at/100MB.test' 'EDIS, HongKong, CN' '4,6' # speed_test 'http://hkg-speedtest.lg.bluevps.com/100MB.bin' 'BlueVPS, HongKong, CN' '4' # speed_test 'http://hk4.lg.starrydns.com/100MB.test' 'StarryDNS, HongKong, CN' '4' - speed_test 'http://tpdb.speed2.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' + # speed_test 'http://tpdb.speed2.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' # http (QoS) + speed_test 'ftp://ftp:ftp@ftp.speed.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' # ftp speed_test 'http://speedtest.tokyo2.linode.com/100MB-tokyo2.bin' 'Linode, Tokyo, JP' '4,6' speed_test 'http://speedtest.tok02.softlayer.com/downloads/test100.zip' 'Softlayer, Tokyo, JP' '4,6' speed_test 'http://speedtest.sng01.softlayer.com/downloads/test100.zip' 'Softlayer, Seoul, KR' '4,6' From 3b979558873942513b134d8b119a8f0d73939149 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 16:16:52 +0800 Subject: [PATCH 023/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d509407..0b1b01b 100644 --- a/README.md +++ b/README.md @@ -54,4 +54,4 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTra update cache: https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh -https://purge.jsdelivr.net/gh/cloudend/scripts@main/speedtest.sh +https://purge.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh From 07d96993aeca14c1ca34b1d2e87b1b09ff79a0b7 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 7 Mar 2022 16:31:12 +0800 Subject: [PATCH 024/165] Update worldSpeed.sh --- worldSpeed.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/worldSpeed.sh b/worldSpeed.sh index a8f1ade..067ec37 100644 --- a/worldSpeed.sh +++ b/worldSpeed.sh @@ -94,6 +94,7 @@ test () { # speed_test 'http://hk4.lg.starrydns.com/100MB.test' 'StarryDNS, HongKong, CN' '4' # speed_test 'http://tpdb.speed2.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' # http (QoS) speed_test 'ftp://ftp:ftp@ftp.speed.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' # ftp + speed_test 'http://ftp1.apol.com.tw/test_100m.dat' 'APOL, Taiwan' '4' speed_test 'http://speedtest.tokyo2.linode.com/100MB-tokyo2.bin' 'Linode, Tokyo, JP' '4,6' speed_test 'http://speedtest.tok02.softlayer.com/downloads/test100.zip' 'Softlayer, Tokyo, JP' '4,6' speed_test 'http://speedtest.sng01.softlayer.com/downloads/test100.zip' 'Softlayer, Seoul, KR' '4,6' From 6120a1df0042cf5c543e06be13772cf425613bef Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 11 Mar 2022 12:58:03 +0800 Subject: [PATCH 025/165] Update tools.sh --- tools.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools.sh b/tools.sh index b56b7c5..4b62090 100644 --- a/tools.sh +++ b/tools.sh @@ -195,6 +195,7 @@ download () { ;; nali) gzip -d nali-*.gz; mv ./nali-* /usr/bin/nali; chmod +x /usr/bin/nali; + nali update; ;; wtrace) mv ./worsttrace /usr/bin/worsttrace; chmod +x /usr/bin/worsttrace; From e8fefdf8f2e32541a994dc194c4144893a418c84 Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 11 Mar 2022 14:17:51 +0800 Subject: [PATCH 026/165] Create autoNaliTrace.sh --- autoNaliTrace.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 autoNaliTrace.sh diff --git a/autoNaliTrace.sh b/autoNaliTrace.sh new file mode 100644 index 0000000..677b1df --- /dev/null +++ b/autoNaliTrace.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +# Usage: +# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/autoNaliTrace.sh) +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoNaliTrace.sh) + +# install nali +if [ ! -f "/usr/bin/nali" ]; then + bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) nali -p +fi + +## start to use nali + +next() { + printf "%-70s\n" "-" | sed 's/\s/-/g' +} + +clear +next + +ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 202.112.14.151) +ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 成都教育网) +# ip_len=${#ip_list[@]} + +for i in {0..7} +do + echo ${ip_addr[$i]} + traceroute -AT4 -m30 -q1 ${ip_list[$i]} 30 | nali \ + | sed 's/ 对方和您在同一内部网//g; s/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\ *\[.*\]\) *([0-9\.]\+ [^)]\+)/\1/g; s/ \[\(as.*\/as.*\)\]/ [*]/Ig' + next +done +# echo '2 172.30.83.68 [局域网 对方和您在同一内部网] (172.30.83.68 [局域网 对方和您在同一内部网] ) [*] 2.847 ms' | sed 's/ 对方和您在同一内部网//g' +# echo '2 172.30.83.68 [局域网] (172.30.83.68 [局域网] ) [*] 1.956 ms' | sed 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\ *\[.*\]\) *([0-9\.]\+ [^)]\+)/#\1#/g' +# echo '2 172.30.83.68 [局域网] (172.30.83.68 [局域网] ) [*] 1.956 ms' | sed 's/ *([0-9\.]\+ [^)]\+)/#\0#/g' +# echo '8 104.254.115.46 [北美地区] [AS199524/AS133731/as21859/AS134671/AS40676/AS21859] 1.972 ms' | sed 's/ \[\(as.*\/as.*\)\]/ [*]/Ig' + From ef8d7dcdf20709b4591a07a5eca2c2e35ba642ea Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 11 Mar 2022 14:24:02 +0800 Subject: [PATCH 027/165] Update autoNaliTrace.sh --- autoNaliTrace.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/autoNaliTrace.sh b/autoNaliTrace.sh index 677b1df..c2859d4 100644 --- a/autoNaliTrace.sh +++ b/autoNaliTrace.sh @@ -10,6 +10,7 @@ if [ ! -f "/usr/bin/nali" ]; then fi ## start to use nali +nali update; next() { printf "%-70s\n" "-" | sed 's/\s/-/g' From 9b80e62c6babe16fd50538dfb3ae0daf89f160c1 Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 11 Mar 2022 14:30:47 +0800 Subject: [PATCH 028/165] Update autoWorstTrace.sh --- autoWorstTrace.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/autoWorstTrace.sh b/autoWorstTrace.sh index 8187566..8be4bf9 100644 --- a/autoWorstTrace.sh +++ b/autoWorstTrace.sh @@ -24,8 +24,9 @@ ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海 for i in {0..7} do - echo ${ip_addr[$i]} - worsttrace ${ip_list[$i]} | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' - next + echo ${ip_addr[$i]} + # currently doesn't support TCP + worsttrace ${ip_list[$i]} | sed ':a;N;s/.*WorstTrace.*\n//g;ta; s/^[[:space:]]*//;s/[[:space:]]*$//; /^$/d' + next done # worsttrace 202.112.14.151 | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' From 73d1a53504dfc797cd1e986b28248ad918450cbb Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 11 Mar 2022 14:37:44 +0800 Subject: [PATCH 029/165] fix autoWorstTrace ctrl+c --- autoWorstTrace.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoWorstTrace.sh b/autoWorstTrace.sh index 8be4bf9..02aa3ce 100644 --- a/autoWorstTrace.sh +++ b/autoWorstTrace.sh @@ -4,6 +4,9 @@ # bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/autoWorstTrace.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTrace.sh) +# Trap interrupts and exit instead of continuing the loop +trap "echo Exited!; exit;" SIGINT SIGTERM + # install worsttrace if [ ! -f "/usr/bin/worsttrace" ]; then bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) wtrace -p From 3b1ec6426a77f361f3f0e78e4f08719638f8c042 Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 11 Mar 2022 14:38:26 +0800 Subject: [PATCH 030/165] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 0b1b01b..fade2bf 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,10 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/superBench.s ``` bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoBestTrace.sh) ``` +- autoNaliTrace +``` + bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoNaliTrace.sh) +``` - autoWorstTrace ``` bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTrace.sh) From 7f47affea9793d7c24591ce916d8f9e781c0b90b Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 11 Mar 2022 15:07:20 +0800 Subject: [PATCH 031/165] Update autoBestTrace.sh --- autoBestTrace.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/autoBestTrace.sh b/autoBestTrace.sh index cf5bfe9..07f5e38 100644 --- a/autoBestTrace.sh +++ b/autoBestTrace.sh @@ -3,7 +3,8 @@ # https://github.com/nyjx/autoBestTrace # https://github.com/flyzy2005/shell - +# besttrace -q1 -T -g cn # 探测数据包数1, TCP, CN bash <( - curl -Lso- https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh + curl -Lso- https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh \ + | sed 's/ -q 1 / -q1 -g cn -T /g' ) From 13b76960bf211fa626a1b916d0bcf4e4a98f8455 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 14 Mar 2022 16:45:23 +0800 Subject: [PATCH 032/165] Update superBench.sh --- superBench.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/superBench.sh b/superBench.sh index cba4da1..570ec82 100644 --- a/superBench.sh +++ b/superBench.sh @@ -6,5 +6,19 @@ bash <( curl -Lso- https://raw.githubusercontent.com/oooldking/script/master/superbench_git.sh \ | sed 's/^.*fast\.com.*$/:;/I' \ | sed 's/^.*[ /]fast_com.*.py.*$/#/I' \ + | sed "s/27377' 'Beijing/34115' 'TianJin/Ig" \ + | sed "s/27154' 'TianJin/4870' 'Changsha/Ig" \ + | sed "s/26678' 'Guangzhou 5G/13704' 'Nanjing/Ig" \ + | sed "s/17184' 'Tianjin/26404' 'Hefei/Ig" \ + | sed "/.*26850' 'Wuxi/Id" \ + | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ + | sed "/.*28491' 'Changsha/Id" \ | sed '/^[ \t]*speed_fast_com$/d' ) + +# https://www.speedtest.net/api/js/servers?search=China%20Telecom +# https://www.speedtest.net/api/js/servers?search=电信 +# https://www.speedtest.net/api/js/servers?search=China%20Unicom +# https://www.speedtest.net/api/js/servers?search=联通 +# https://www.speedtest.net/api/js/servers?search=China%20Mobile +# https://www.speedtest.net/api/js/servers?search=移动 From 837365e1f6c2e14aa118e728ac220eb9d34f741a Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 14 Mar 2022 17:06:10 +0800 Subject: [PATCH 033/165] Create bench.sh --- bench.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 bench.sh diff --git a/bench.sh b/bench.sh new file mode 100644 index 0000000..abe188b --- /dev/null +++ b/bench.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash + +# https://github.com/teddysun/across/blob/master/bench.sh + +bash <( + curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bench.sh \ + | sed "/Los Angeles/Ii speed_test '34115' 'TianJin, CT CN'" \ + | sed "/Los Angeles/Ii speed_test '27594' 'Guangzhou, CT CN'" \ + | sed "/Los Angeles/Ii speed_test '4870' 'Changsha, CU CN'" \ + | sed "/Los Angeles/Ii speed_test '13704' 'Nanjing, CU CN'" \ + | sed "/Los Angeles/Ii speed_test '26404' 'Hefei, CM CN'" \ + | sed "/Los Angeles/Ii speed_test '15863' 'Nanning, CM CN'" \ + | sed "/.*, CN/Id" +) + +# https://www.speedtest.net/api/js/servers?search=China%20Telecom +# https://www.speedtest.net/api/js/servers?search=电信 +# https://www.speedtest.net/api/js/servers?search=China%20Unicom +# https://www.speedtest.net/api/js/servers?search=联通 +# https://www.speedtest.net/api/js/servers?search=China%20Mobile +# https://www.speedtest.net/api/js/servers?search=移动 From 562bbd0711a6bd370de148ca10a0949a58b20a32 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 14 Mar 2022 17:07:31 +0800 Subject: [PATCH 034/165] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index fade2bf..4a34c10 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.s ``` bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh) ``` +- bench +``` +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/bench.sh) +``` - autoBestTrace ``` From 42ee6f930ff35dec43a5df9e70edb4cf1ec94459 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 14 Mar 2022 17:08:51 +0800 Subject: [PATCH 035/165] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 4a34c10..11e567f 100644 --- a/README.md +++ b/README.md @@ -63,3 +63,7 @@ update cache: https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh https://purge.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh +https://purge.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.sh +https://purge.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh +https://purge.jsdelivr.net/gh/cloudend/scripts@main/bench.sh + From 2cb36c1237b97d6b82622a1fcfd1a8f7d582dd76 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 14 Mar 2022 17:09:17 +0800 Subject: [PATCH 036/165] Update README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 11e567f..4ee8ec0 100644 --- a/README.md +++ b/README.md @@ -61,9 +61,9 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTra update cache: -https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh -https://purge.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh -https://purge.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.sh -https://purge.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh -https://purge.jsdelivr.net/gh/cloudend/scripts@main/bench.sh +- https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh +- https://purge.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh +- https://purge.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.sh +- https://purge.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh +- https://purge.jsdelivr.net/gh/cloudend/scripts@main/bench.sh From a537e47f4af830f0ea6c104cb3283b55921dc1e1 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 15 Mar 2022 08:39:05 +0800 Subject: [PATCH 037/165] Update bench.sh --- bench.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bench.sh b/bench.sh index abe188b..69e3e62 100644 --- a/bench.sh +++ b/bench.sh @@ -4,12 +4,12 @@ bash <( curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bench.sh \ - | sed "/Los Angeles/Ii speed_test '34115' 'TianJin, CT CN'" \ - | sed "/Los Angeles/Ii speed_test '27594' 'Guangzhou, CT CN'" \ - | sed "/Los Angeles/Ii speed_test '4870' 'Changsha, CU CN'" \ - | sed "/Los Angeles/Ii speed_test '13704' 'Nanjing, CU CN'" \ - | sed "/Los Angeles/Ii speed_test '26404' 'Hefei, CM CN'" \ - | sed "/Los Angeles/Ii speed_test '15863' 'Nanning, CM CN'" \ + | sed "/Los Angeles/Ii speed_test '34115' 'TianJin CT'" \ + | sed "/Los Angeles/Ii speed_test '27594' 'Guangzhou CT'" \ + | sed "/Los Angeles/Ii speed_test '4870' 'Changsha CU'" \ + | sed "/Los Angeles/Ii speed_test '13704' 'Nanjing CU'" \ + | sed "/Los Angeles/Ii speed_test '26404' 'Hefei CM'" \ + | sed "/Los Angeles/Ii speed_test '15863' 'Nanning CM'" \ | sed "/.*, CN/Id" ) From 241cd2b7674b61fc6dfe53e5b64a8a30548d4f34 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 26 Mar 2022 18:19:48 +0800 Subject: [PATCH 038/165] Update worldSpeed.sh --- worldSpeed.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worldSpeed.sh b/worldSpeed.sh index 067ec37..1354b95 100644 --- a/worldSpeed.sh +++ b/worldSpeed.sh @@ -10,6 +10,7 @@ # References: # https://github.com/flyzy2005/scripts # https://github.com/manvari/server-speedtest +# https://cnman.github.io/speedtest.html # Colors RED='\033[0;31m' @@ -112,7 +113,8 @@ test () { speed_test 'https://il-us-ping.vultr.com/vultr.com.100MB.bin' 'Vultr, Chicago, US' '4' # speed_test 'http://lg.den2-c.fdcservers.net/100MBtest.zip' 'FDC, Denver, US' '4' region "Eastern US" - speed_test 'http://speedtest.newark.linode.com/100MB-newark.bin' 'Linode, Newark, NJ, US' '4,6' + # speed_test 'http://speedtest.newark.linode.com/100MB-newark.bin' 'Linode, Newark, NJ, US' '4,6' + speed_test 'http://speedtest-nyc1.digitalocean.com/100mb.test' 'Digital Ocean, New York, US' '4,6' speed_test 'http://mirror.wdc1.us.leaseweb.net/speedtest/100mb.bin' 'Softlayer, Washington, US' '4,6' region "Canada" speed_test 'http://speedtest-tor1.digitalocean.com/100mb.test' 'DO, Toronto, CA' '4,6' From 643f386c9bde9b3b903f14492b067403674f48e8 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:14:50 +0800 Subject: [PATCH 039/165] Update README.md --- README.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 4ee8ec0..5eba497 100644 --- a/README.md +++ b/README.md @@ -11,35 +11,35 @@ Tools and Scripts for Linux VPS - worldSpeed ```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh) -4 +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/worldSpeed.sh) -4 ``` - install ddns-go ```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) ddns-go -p +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) ddns-go -p ``` - install gost ```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) gost -p +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) gost -p ``` - install realm ```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/CloudEndIO/scripts@main/tools.sh) realm -p +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) realm -p ``` - paste text and share ``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/paste.sh) +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/paste.sh) ``` - unlockTest ``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.sh) +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/unlockTest.sh) ``` - superBench ``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh) +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/superBench.sh) ``` - bench ``` @@ -52,18 +52,18 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoBestTrac ``` - autoNaliTrace ``` - bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoNaliTrace.sh) + bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNaliTrace.sh) ``` - autoWorstTrace ``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTrace.sh) +bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoWorstTrace.sh) ``` update cache: -- https://purge.jsdelivr.net/gh/cloudend/scripts@main/tools.sh -- https://purge.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh -- https://purge.jsdelivr.net/gh/cloudend/scripts@main/unlockTest.sh -- https://purge.jsdelivr.net/gh/cloudend/scripts@main/superBench.sh -- https://purge.jsdelivr.net/gh/cloudend/scripts@main/bench.sh +- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh +- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/worldSpeed.sh +- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/unlockTest.sh +- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/superBench.sh +- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/bench.sh From d793ea9b88e3df43bae80e3355328bf98c12dea3 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:15:23 +0800 Subject: [PATCH 040/165] Update autoNaliTrace.sh --- autoNaliTrace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoNaliTrace.sh b/autoNaliTrace.sh index c2859d4..eceb142 100644 --- a/autoNaliTrace.sh +++ b/autoNaliTrace.sh @@ -6,7 +6,7 @@ # install nali if [ ! -f "/usr/bin/nali" ]; then - bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) nali -p + bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) nali -p fi ## start to use nali From ab0d9d389ec41559c22dc8ecde5c2fe07bae9cb0 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:16:16 +0800 Subject: [PATCH 041/165] Update autoWorstTrace.sh --- autoWorstTrace.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autoWorstTrace.sh b/autoWorstTrace.sh index 02aa3ce..a886816 100644 --- a/autoWorstTrace.sh +++ b/autoWorstTrace.sh @@ -1,15 +1,15 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/autoWorstTrace.sh) -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoWorstTrace.sh) +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoWorstTrace.sh) +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoWorstTrace.sh) # Trap interrupts and exit instead of continuing the loop trap "echo Exited!; exit;" SIGINT SIGTERM # install worsttrace if [ ! -f "/usr/bin/worsttrace" ]; then - bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) wtrace -p + bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) wtrace -p fi ## start to use besttrace From 76692ab935a6ac30dc00d287c447114b9d9abc65 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:16:46 +0800 Subject: [PATCH 042/165] Update worldSpeed.sh --- worldSpeed.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/worldSpeed.sh b/worldSpeed.sh index 1354b95..120d70b 100644 --- a/worldSpeed.sh +++ b/worldSpeed.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/worldSpeed.sh) [-4, -6] -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/worldSpeed.sh) -# bash <(curl -Lso- https://raw.githack.com/cloudend/scripts/main/worldSpeed.sh) -# bash <(curl -Lso- https://gitcdn.link/cdn/cloudend/scripts/main/worldSpeed.sh) -# bash <(curl -Lso- https://raw.fastgit.org/cloudend/scripts/main/worldSpeed.sh) +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/worldSpeed.sh) [-4, -6] +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/worldSpeed.sh) +# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/worldSpeed.sh) +# bash <(curl -Lso- https://gitcdn.link/cdn/VPSDance/scripts/main/worldSpeed.sh) +# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/worldSpeed.sh) # References: # https://github.com/flyzy2005/scripts From c404e0bd93eb689c5b73cdfe71ca573b57f92371 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:18:04 +0800 Subject: [PATCH 043/165] Update worldSpeed.sh --- worldSpeed.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/worldSpeed.sh b/worldSpeed.sh index 120d70b..94ee4dd 100644 --- a/worldSpeed.sh +++ b/worldSpeed.sh @@ -4,7 +4,6 @@ # bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/worldSpeed.sh) [-4, -6] # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/worldSpeed.sh) # bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/worldSpeed.sh) -# bash <(curl -Lso- https://gitcdn.link/cdn/VPSDance/scripts/main/worldSpeed.sh) # bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/worldSpeed.sh) # References: From 0f3b8f936a95cf3072ca53d6791910cbe7f63674 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:18:33 +0800 Subject: [PATCH 044/165] Update autoNaliTrace.sh --- autoNaliTrace.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoNaliTrace.sh b/autoNaliTrace.sh index eceb142..a6977a2 100644 --- a/autoNaliTrace.sh +++ b/autoNaliTrace.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/autoNaliTrace.sh) -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoNaliTrace.sh) +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoNaliTrace.sh) +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNaliTrace.sh) # install nali if [ ! -f "/usr/bin/nali" ]; then From 58117158c129d47e9d836de8489030f5bd5b91bc Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:19:04 +0800 Subject: [PATCH 045/165] Update paste.sh --- paste.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paste.sh b/paste.sh index 612a19b..ddff962 100644 --- a/paste.sh +++ b/paste.sh @@ -1,8 +1,8 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/paste.sh) [poster] -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/paste.sh) [poster] +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/paste.sh) [poster] +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/paste.sh) [poster] echo "Paste your content:" IFS= read -d '' -n 1 text From 1dcbe0f65335d23fcaa0a366a0641061e8090aeb Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:19:37 +0800 Subject: [PATCH 046/165] Update tools.sh --- tools.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools.sh b/tools.sh index 4b62090..488ba3e 100644 --- a/tools.sh +++ b/tools.sh @@ -1,11 +1,10 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/cloudend/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] -p -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/tools.sh) -# bash <(curl -Lso- https://raw.githack.com/cloudend/scripts/main/tools.sh) -# bash <(curl -Lso- https://gitcdn.link/cdn/cloudend/scripts/main/tools.sh) -# bash <(curl -Lso- https://raw.fastgit.org/cloudend/scripts/main/tools.sh) +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] -p +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) +# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/tools.sh) +# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/tools.sh) # Colors From 091eec92ea1110ceb81054e7b7be8f6167d3da7e Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 29 Mar 2022 14:22:26 +0800 Subject: [PATCH 047/165] Update tools.sh --- tools.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools.sh b/tools.sh index 488ba3e..084acaa 100644 --- a/tools.sh +++ b/tools.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] -p +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) # bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/tools.sh) # bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/tools.sh) @@ -19,7 +19,8 @@ ARCH=$(uname -m) # x86_64, arm64, aarch64 # DISTRO=$( [[ -e $(which lsb_release) ]] && (lsb_release -si) || echo 'unknown' ) which/lsb_release command not found DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) -prerelease=$( [[ "${2}" =~ ^(-p|prerelease)$ ]] && echo true || echo false ) +# prerelease=$( [[ "${2}" =~ ^(-p|prerelease)$ ]] && echo true || echo false ) +prerelease=true debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) check_root () { From 8546a3df1af180986aa71920878def478423e8f3 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 09:11:04 +0800 Subject: [PATCH 048/165] Update superBench.sh --- superBench.sh | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/superBench.sh b/superBench.sh index 570ec82..1b53840 100644 --- a/superBench.sh +++ b/superBench.sh @@ -2,19 +2,39 @@ # https://github.com/oooldking/script -bash <( - curl -Lso- https://raw.githubusercontent.com/oooldking/script/master/superbench_git.sh \ - | sed 's/^.*fast\.com.*$/:;/I' \ - | sed 's/^.*[ /]fast_com.*.py.*$/#/I' \ - | sed "s/27377' 'Beijing/34115' 'TianJin/Ig" \ - | sed "s/27154' 'TianJin/4870' 'Changsha/Ig" \ - | sed "s/26678' 'Guangzhou 5G/13704' 'Nanjing/Ig" \ - | sed "s/17184' 'Tianjin/26404' 'Hefei/Ig" \ - | sed "/.*26850' 'Wuxi/Id" \ - | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ - | sed "/.*28491' 'Changsha/Id" \ - | sed '/^[ \t]*speed_fast_com$/d' -) +ver_lte() { # <= + [ "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1" ] && return 0 || return 1 +} +python_version() { + python -V 2>&1 | awk '{print $2}' # | awk -F '.' '{print $1}' +} +main() { + # fix python3 error + local ver=$(python_version) # echo $ver + curl -Lso- https://cdn.jsdelivr.net/gh/oooldking/script@1.1.7/tools.py > tools.py + if (ver_lte 3 $ver); then + sed -i 's/print \(.*\)$/print(\1)/g' tools.py + sed -i 's/,urllib2,/,/g' tools.py + sed -i 's/,json,sys.*$/&\nimport urllib.request as urllib2/' tools.py + sed -i '/reload(sys).*$/d' tools.py + sed -i '/sys.setdefaultencoding.*$/d' tools.py + sed -i "s/para.encode('utf-8')/para/g" tools.py + fi + bash <( + curl -Lso- https://raw.githubusercontent.com/oooldking/script/master/superbench_git.sh \ + | sed 's/^.*fast\.com.*$/:;/I' \ + | sed 's/^.*[ /]fast_com.*.py.*$/#/I' \ + | sed "s/27377' 'Beijing/34115' 'TianJin/Ig" \ + | sed "s/27154' 'TianJin/4870' 'Changsha/Ig" \ + | sed "s/26678' 'Guangzhou 5G/13704' 'Nanjing/Ig" \ + | sed "s/17184' 'Tianjin/26404' 'Hefei/Ig" \ + | sed "/.*26850' 'Wuxi/Id" \ + | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ + | sed "/.*28491' 'Changsha/Id" \ + | sed '/^[ \t]*speed_fast_com$/d' + ) +} +main # https://www.speedtest.net/api/js/servers?search=China%20Telecom # https://www.speedtest.net/api/js/servers?search=电信 From 7a7715db41d30f3bc360369ded66a793431e53ec Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 10:19:22 +0800 Subject: [PATCH 049/165] rm --- worldSpeed.sh | 147 -------------------------------------------------- 1 file changed, 147 deletions(-) delete mode 100644 worldSpeed.sh diff --git a/worldSpeed.sh b/worldSpeed.sh deleted file mode 100644 index 94ee4dd..0000000 --- a/worldSpeed.sh +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/worldSpeed.sh) [-4, -6] -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/worldSpeed.sh) -# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/worldSpeed.sh) -# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/worldSpeed.sh) - -# References: -# https://github.com/flyzy2005/scripts -# https://github.com/manvari/server-speedtest -# https://cnman.github.io/speedtest.html - -# Colors -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -BLUE='\033[0;34m' -CYAN='\033[0;36m' -PLAIN='\033[0m' -BOLD="\033[1m" - -ipv6=$( [[ "${1}" =~ ^(-6)$ ]] && echo true || echo false ) -stack=$( [[ "$ipv6" = true ]] && echo "-6" || echo "-4" ) -if [ "`ping -6 2>&1 | grep 'invalid option'`" ]; then - PING=$( [[ "$ipv6" = true ]] && ([[ -x "`which ping6`" ]] && echo "ping6") || echo "ping" ) -else - PING=$( [[ "$ipv6" = true ]] && echo "ping -6" || echo "ping -4" ) -fi - -speed_test () { - local stacks=$3 - if [[ $stacks != *"${stack:1}"* ]]; then - # echo '- skip -' - return - fi - local speedtest=$(curl $stack -m 12 -Lo /dev/null -skw "%{speed_download}\n" "$1" ) - local host=$((awk '{gsub(/^.*@/,"", $0); print $0}' | awk -F':' '{print $1}') <<< `awk -F'/' '{print $3}' <<< $1`) - local ipaddress=$($PING -c1 -n ${host} | awk -F'[()]' '{print $2;exit}') - local nodeName=$2 - # printf "%-32s%-24s%-14s\n" "${nodeName}" "${ipaddress}" "$(FormatBytes $speedtest)" - printf "${YELLOW}%-32s${GREEN}%-24s${RED}%-14s${PLAIN}\n" "${nodeName}" "${ipaddress}" "$(FormatBytes $speedtest)" -} -region () { - printf "${CYAN}${BOLD}%-35s${PLAIN}\n" "----- $1 -----" -} -next () { - printf "%-70s\n" "-" | sed 's/\s/-/g' -} -promptYn () { - while true; do - read -p "$1 (y/n)" yn - case "${yn:-Y}" in - [Yy]* ) return 0;; - [Nn]* ) return 1;; - * ) echo "Please answer yes(y) or no(n).";; - esac - done -} -pastebin () { - text="$( sed "s/\x1B\[[0-9;]\{1,\}[A-Za-z]//g" <<< "${1}" )" - # echo "$text" - curl -w "URL: %{redirect_url}\n" -o /dev/null -s "https://paste.ubuntu.com" --data-urlencode "content=$text" -d "poster=speed_test" -d "syntax=bash" -} -FormatBytes () { - bytes=${1%.*} - local Mbps=$( printf "%s" "$bytes" | awk '{ printf "%.2f", $0 / 1024 / 1024 * 8 } END { if (NR == 0) { print "error" } }' ) - if [[ $bytes -lt 1000 ]]; then - printf "%8i B/s | N/A " $bytes - elif [[ $bytes -lt 1000000 ]]; then - local KiBs=$( printf "%s" "$bytes" | awk '{ printf "%.2f", $0 / 1024 } END { if (NR == 0) { print "error" } }' ) - printf "%7s KiB/s | %7s Mbps" "$KiBs" "$Mbps" - else - # awk way for accuracy - local MiBs=$( printf "%s" "$bytes" | awk '{ printf "%.2f", $0 / 1024 / 1024 } END { if (NR == 0) { print "error" } }' ) - printf "%7s MiB/s | %7s Mbps" "$MiBs" "$Mbps" - # bash way - # printf "%4s MiB/s | %4s Mbps""$(( bytes / 1024 / 1024 ))" "$(( bytes / 1024 / 1024 * 8 ))" - fi -} -# wget -O /dev/null http://www2.unicomtest.com:8080/download?size=100000000 -test () { - printf "%-32s%-31s%-14s\n" "Node Name" "IP address" "Download Speed" - - region "Global (CDN)" - speed_test 'http://cachefly.cachefly.net/100mb.test' 'CacheFly, CDN' '4' - speed_test 'https://speed.cloudflare.com/__down?bytes=100001000' 'Cloudflare, CDN' '4,6' - - region "Asia" - speed_test 'http://speedtest.hkg02.softlayer.com/downloads/test100.zip' 'Softlayer, HongKong, CN' '4,6' - speed_test 'http://mirror.hk.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, HongKong, CN' '4,6' - # speed_test 'https://hk.edis.at/100MB.test' 'EDIS, HongKong, CN' '4,6' - # speed_test 'http://hkg-speedtest.lg.bluevps.com/100MB.bin' 'BlueVPS, HongKong, CN' '4' - # speed_test 'http://hk4.lg.starrydns.com/100MB.test' 'StarryDNS, HongKong, CN' '4' - # speed_test 'http://tpdb.speed2.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' # http (QoS) - speed_test 'ftp://ftp:ftp@ftp.speed.hinet.net/test_100m.zip' 'Hinet, Taiwan' '4,6' # ftp - speed_test 'http://ftp1.apol.com.tw/test_100m.dat' 'APOL, Taiwan' '4' - speed_test 'http://speedtest.tokyo2.linode.com/100MB-tokyo2.bin' 'Linode, Tokyo, JP' '4,6' - speed_test 'http://speedtest.tok02.softlayer.com/downloads/test100.zip' 'Softlayer, Tokyo, JP' '4,6' - speed_test 'http://speedtest.sng01.softlayer.com/downloads/test100.zip' 'Softlayer, Seoul, KR' '4,6' - speed_test 'http://speedtest.singapore.linode.com/100MB-singapore.bin' 'Linode, Singapore, SG' '4,6' - speed_test 'http://speedtest.sng01.softlayer.com/downloads/test100.zip' 'Softlayer, Singapore, SG' '4,6' - # speed_test 'http://mirror.sg.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, Singapore, SG' '4,6' - - # Northern America - region "Western US" - # speed_test 'http://speedtest.sjc01.softlayer.com/downloads/test100.zip' 'Softlayer, San Jose, US' '4,6' - speed_test 'http://speedtest.fremont.linode.com/100MB-fremont.bin' 'Linode, Fremont, US' '4,6' - speed_test 'http://mirror.sfo12.us.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, San Francisco, US' '4,6' - region "Central US" - speed_test 'http://speedtest.dal13.softlayer.com/downloads/test100.zip' 'Softlayer, Dallas, US' '4,6' - speed_test 'https://il-us-ping.vultr.com/vultr.com.100MB.bin' 'Vultr, Chicago, US' '4' - # speed_test 'http://lg.den2-c.fdcservers.net/100MBtest.zip' 'FDC, Denver, US' '4' - region "Eastern US" - # speed_test 'http://speedtest.newark.linode.com/100MB-newark.bin' 'Linode, Newark, NJ, US' '4,6' - speed_test 'http://speedtest-nyc1.digitalocean.com/100mb.test' 'Digital Ocean, New York, US' '4,6' - speed_test 'http://mirror.wdc1.us.leaseweb.net/speedtest/100mb.bin' 'Softlayer, Washington, US' '4,6' - region "Canada" - speed_test 'http://speedtest-tor1.digitalocean.com/100mb.test' 'DO, Toronto, CA' '4,6' - speed_test 'http://speedtest.mon01.softlayer.com/downloads/test100.zip' 'Softlayer, Montreal, CA' '4,6' - - # Europe - region "Western & Southern Europe" - speed_test 'http://speedtest.london.linode.com/100MB-london.bin' 'Linode, London, UK' '4,6' - speed_test 'http://speedtest.frankfurt.linode.com/100MB-frankfurt.bin' 'Linode, Frankfurt, DE' '4,6' - speed_test 'http://speedtest.fra02.softlayer.com/downloads/test100.zip' 'Softlayer, Frankfurt, DE' '4,6' - speed_test 'http://speedtest.par01.softlayer.com/downloads/test100.zip' 'Softlayer, Paris, FR' '4,6' - speed_test 'http://mirror.nl.leaseweb.net/speedtest/100mb.bin' 'Leaseweb, Amsterdam, NL' '4,6' - region "Central & Eastern Europe" - speed_test 'http://ru.edis.at/100MB.test' 'EDIS, Moscow, RU' '4,6' - speed_test 'http://pl.edis.at/100MB.test' 'EDIS, Warsaw, PL' '4,6' - speed_test 'http://ro.edis.at/100MB.test' 'EDIS, Bucharest, RO' '4,6' - # speed_test 'http://hosthink.org/100mb.test' 'Hosthink, Istanbul, TR' '4' - speed_test 'http://lg.ist.binaryracks.com/100MB.test' 'Binaryracks, Istanbul, TR' '4' - # speed_test 'https://bg.edis.at/100MB.test' 'EDIS, Sofia, BG' '4,6' - next -} -# test - -tmp=$(mktemp) -test | tee $tmp -results="$(cat $tmp)" -rm -rf $tmp; - -if promptYn "Upload your results to to a \"PasteBin\" site?"; then - pastebin "$results" -fi From 18e3db420bad3b7cef41a7e6893e29fc0a43ab55 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 10:20:14 +0800 Subject: [PATCH 050/165] Update README.md --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 5eba497..c2b94cd 100644 --- a/README.md +++ b/README.md @@ -8,12 +8,6 @@ Tools and Scripts for Linux VPS # cdn: https://ghproxy.com/https://github.com/:user/:repo/, https://ghproxy.com/https://github.com/zhboner/realm/releases/download/v1.4/realm --> - -- worldSpeed -```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/worldSpeed.sh) -4 -``` - - install ddns-go ```sh bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) ddns-go -p @@ -62,7 +56,6 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoWorstTra update cache: - https://purge.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh -- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/worldSpeed.sh - https://purge.jsdelivr.net/gh/VPSDance/scripts@main/unlockTest.sh - https://purge.jsdelivr.net/gh/VPSDance/scripts@main/superBench.sh - https://purge.jsdelivr.net/gh/VPSDance/scripts@main/bench.sh From c286f358c3abafb5f930f6c5c3139b978bad1722 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 10:21:34 +0800 Subject: [PATCH 051/165] Update bench.sh --- bench.sh | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/bench.sh b/bench.sh index 69e3e62..c936121 100644 --- a/bench.sh +++ b/bench.sh @@ -2,16 +2,19 @@ # https://github.com/teddysun/across/blob/master/bench.sh -bash <( - curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bench.sh \ - | sed "/Los Angeles/Ii speed_test '34115' 'TianJin CT'" \ - | sed "/Los Angeles/Ii speed_test '27594' 'Guangzhou CT'" \ - | sed "/Los Angeles/Ii speed_test '4870' 'Changsha CU'" \ - | sed "/Los Angeles/Ii speed_test '13704' 'Nanjing CU'" \ - | sed "/Los Angeles/Ii speed_test '26404' 'Hefei CM'" \ - | sed "/Los Angeles/Ii speed_test '15863' 'Nanning CM'" \ - | sed "/.*, CN/Id" -) +main() { + bash <( + curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bench.sh \ + | sed "/Los Angeles/Ii speed_test '34115' 'TianJin CT'" \ + | sed "/Los Angeles/Ii speed_test '27594' 'Guangzhou CT'" \ + | sed "/Los Angeles/Ii speed_test '4870' 'Changsha CU'" \ + | sed "/Los Angeles/Ii speed_test '13704' 'Nanjing CU'" \ + | sed "/Los Angeles/Ii speed_test '26404' 'Hefei CM'" \ + | sed "/Los Angeles/Ii speed_test '15863' 'Nanning CM'" \ + | sed "/.*, CN/Id" + ) +} +main # https://www.speedtest.net/api/js/servers?search=China%20Telecom # https://www.speedtest.net/api/js/servers?search=电信 From cf0aed0fc26948971c1c50c6dc0bd7902a2f5890 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 10:22:33 +0800 Subject: [PATCH 052/165] Update unlockTest.sh --- unlockTest.sh | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/unlockTest.sh b/unlockTest.sh index b1bb5c5..912a7f2 100644 --- a/unlockTest.sh +++ b/unlockTest.sh @@ -3,12 +3,14 @@ # bash <(curl -L -s check.unlock.media) # https://github.com/lmc999/RegionRestrictionCheck -bash <( - curl -L -s check.unlock.media \ - | sed '/^[ \t]*echo\( -e\)\? "[-]*"\(.*\)\?$/d' \ - | sed '/^[ \t]*echo\( -e\)\? "[=]*"\(.*\)\?$/d' \ - | sed 's/ CheckV6().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ - | sed 's/ Goodbye().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ - | sed '/echo\( -e\)\? ""\(.*\)\?$/d' -) - +main() { + bash <( + curl -L -s check.unlock.media \ + | sed '/^[ \t]*echo\( -e\)\? "[-]*"\(.*\)\?$/d' \ + | sed '/^[ \t]*echo\( -e\)\? "[=]*"\(.*\)\?$/d' \ + | sed 's/ CheckV6().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ + | sed 's/ Goodbye().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ + | sed '/echo\( -e\)\? ""\(.*\)\?$/d' + ) +} +main From 4a10ee98190f103d7367a70f0237e01eae748611 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 15:26:51 +0800 Subject: [PATCH 053/165] Create init.sh --- init.sh | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 init.sh diff --git a/init.sh b/init.sh new file mode 100644 index 0000000..5b0427d --- /dev/null +++ b/init.sh @@ -0,0 +1,179 @@ +#!/usr/bin/env bash + +# Usage: +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/init.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/init.sh) +# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/init.sh) +# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/init.sh) + +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE="\033[34m" +PURPLE="\033[35m" +SKYBLUE="\033[36m" +BOLD="\033[1m" +NC='\033[0m' + +OS=$(uname -s) # Linux, FreeBSD, Darwin +ARCH=$(uname -m) # x86_64, arm64, aarch64 +DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) +# name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) +debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) + +check_root() { + if [[ "$USER" != 'root' ]]; then # [[ "$EUID" -ne 0 ]] + error "Please run this script as root!"; exit 1; + # if [[ "$debug" != true ]]; then exit 1; fi + fi +} +next() { + printf "%-37s\n" "-" | sed 's/\s/-/g' +} +error() { + printf "${RED}[x] %s${NC}\n" "$@" +} +info() { + printf "${SKYBLUE}%s${NC}\n" "$@" +} +warn() { + printf "${YELLOW}%s${NC}\n" "$@" +} +# if (ver_lte 3 3.0); then echo 3; else echo 2; fi # ver_lte 2.5.7 3 && echo "yes" || echo "no" +ver_lte() { # <= + [ "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1" ] && return 0 || return 1 +} +# if (ver_lt 2.9 3); then echo 2; else echo 3; fi +ver_lt() { # < + [ "$1" = "$2" ] && return 1 || ver_lte "$1" "$2" +} +python_version() { + python -V 2>&1 | awk '{print $2}' # | awk -F '.' '{print $1}' +} + +header() { + next + printf "%s\n" "[VPS Tool box]" + printf "%b\n" "${GREEN}VPS/IPLC测评:${NC} ${YELLOW}https://vps.dance/${NC}" + printf "%b\n" "目前支持: Ubuntu/Debian, Centos/Redhat" + next +} +footer() { + next + printf "%b\n" "Supported by: https://vps.dance" + next +} + +install_deps() { + case "${DISTRO}" in + Debian*|Ubuntu*) + apt update -y; + apt install -y curl wget htop zip unzip xz-utils gzip ca-certificates net-tools dnsutils iputils-ping mtr traceroute telnet tcpdump; + bash <(curl -s https://install.speedtest.net/app/cli/install.deb.sh); + apt install -y speedtest; + ;; + CentOS*|RedHat*) + yum update -y; + yum install -y epel-release which openssl curl wget htop zip unzip xz gzip ca-certificates net-tools bind-utils iputils mtr traceroute telnet tcpdump; + curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash + yum install -y speedtest + ;; + esac +} +install_bbr() { + bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bbr.sh) +} +install_tool() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) "$@" +} +install_wireguard(){ + curl -Ls https://raw.githubusercontent.com/teddysun/across/master/wireguard.sh | bash -s -- -r + # uninstall_wireguard + # curl -Ls https://raw.githubusercontent.com/teddysun/across/master/wireguard.sh | bash -s -- -n +} +unlock_test() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/unlockTest.sh) +} +super_bench() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/superBench.sh) + curl -sL https://raw.githubusercontent.com/VPSDance/scripts/main/superBench.sh | bash -s io +} +bench() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bench.sh) +} +super_speed() { + bash <(curl -Lso- https://raw.githubusercontent.com/flyzy2005/superspeed/master/superspeed.sh) +} +yabs() { + info "curl -sL yabs.sh | bash -s -- -dir" + curl -sL yabs.sh | bash -s -- -dir +} +unix_bench() { + bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/unixbench.sh) +} +reinstall() { + bash <(curl -Lso- https://raw.githubusercontent.com/hiCasper/Shell/master/AutoReinstall.sh) +} + +start() { + header + echo -e "${BLUE}请选择要使用的功能${NC}" + info "1. [推荐] 安装常用软件 (curl/wget/ping/traceroute...)" + info "2. [推荐] 安装并开启 BBR" + # info "3. [推荐] 系统配置优化" + info "11. 安装 shadowsocks" + info "12. 安装 snell" + info "13. 安装 realm (端口转发工具)" + info "14. 安装 gost (隧道/端口转发工具)" + info "15. 安装 nali (IP查询工具)" + info "16. 安装 wtrace (路由追踪工具 WorstTrace)" + info "17. 安装 ddns-go (DDNS工具)" + # info "19. 安装 wireguard" + info "21. 检测 VPS流媒体解锁 (RegionRestrictionCheck)" + info "22. 检测 VPS系统/IO/到国内网速 (SuperBench)" + info "23. 检测 VPS系统/IO/到国际网速 (Bench.sh)" + info "24. 性能测试 (YABS)" + # info "25. 检测 到国内网速(电信/移动/联通) (Superspeed)" + # info "29. 性能测试 (UnixBench)" + # info "31. DD重装Linux系统" + while :; do + read -p "输入数字以选择:" num + [[ $num =~ ^[0-9]+$ ]] || { error "请输入正确的数字"; continue; } + break + # if ((num >= 1 && num <= 5)); then + # break + # else + # error "请输入正确的数字"; + # fi + done +} + +main() { + clear + header + if [[ "$num" == "1" ]]; then install_deps + elif [[ "$num" == "2" ]]; then install_bbr + elif [[ "$num" == "3" ]]; then tcpx + elif [[ "$num" == "11" ]]; then install_tool "ss" + elif [[ "$num" == "12" ]]; then install_tool "snell" + elif [[ "$num" == "13" ]]; then install_tool "realm" + elif [[ "$num" == "14" ]]; then install_tool "gost" + elif [[ "$num" == "15" ]]; then install_tool "nali" + elif [[ "$num" == "16" ]]; then install_tool "wtrace" + elif [[ "$num" == "17" ]]; then install_tool "ddns-go" + # elif [[ "$num" == "19" ]]; then install_wireguard + elif [[ "$num" == "21" ]]; then unlock_test + elif [[ "$num" == "22" ]]; then super_bench + elif [[ "$num" == "23" ]]; then bench + elif [[ "$num" == "24" ]]; then yabs + # elif [[ "$num" == "25" ]]; then super_speed + # elif [[ "$num" == "29" ]]; then unix_bench + # elif [[ "$num" == "31" ]]; then reinstall + else exit + fi +} + +check_root +start +main From deb8d60b07d4f4ed10269c4ae933fb2b9e4e98fb Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 15:28:49 +0800 Subject: [PATCH 054/165] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index c2b94cd..9c9ab9e 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ Tools and Scripts for Linux VPS # cdn: https://ghproxy.com/https://github.com/:user/:repo/, https://ghproxy.com/https://github.com/zhboner/realm/releases/download/v1.4/realm --> +-- VPS Tool box(include all scripts) +```sh +bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/init.sh) +``` + - install ddns-go ```sh bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) ddns-go -p From a39724a53181d9a11c9ae334ba5cebccdeda62a0 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 15:29:01 +0800 Subject: [PATCH 055/165] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9c9ab9e..985cba7 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Tools and Scripts for Linux VPS # cdn: https://ghproxy.com/https://github.com/:user/:repo/, https://ghproxy.com/https://github.com/zhboner/realm/releases/download/v1.4/realm --> --- VPS Tool box(include all scripts) +- VPS Tool box(include all scripts) ```sh bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/init.sh) ``` From 89e8f309ad26ab3a3021c8470d218e768dabf0a1 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 15:51:27 +0800 Subject: [PATCH 056/165] Update init.sh --- init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.sh b/init.sh index 5b0427d..ff5ea68 100644 --- a/init.sh +++ b/init.sh @@ -127,7 +127,7 @@ start() { info "13. 安装 realm (端口转发工具)" info "14. 安装 gost (隧道/端口转发工具)" info "15. 安装 nali (IP查询工具)" - info "16. 安装 wtrace (路由追踪工具 WorstTrace)" + info "16. 安装 worsttrace (路由追踪工具)" info "17. 安装 ddns-go (DDNS工具)" # info "19. 安装 wireguard" info "21. 检测 VPS流媒体解锁 (RegionRestrictionCheck)" From 84c27ae3cc04b908f4a7126eadef5248932459c7 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 20:54:27 +0800 Subject: [PATCH 057/165] Create bashrc --- files/bashrc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 files/bashrc diff --git a/files/bashrc b/files/bashrc new file mode 100644 index 0000000..1ab9f67 --- /dev/null +++ b/files/bashrc @@ -0,0 +1,18 @@ +HISTCONTROL=ignoreboth:erasedups + +# search history +if [[ $- =~ i ]]; then + # setup functions and key binds + bind '"\x1b\x5b\x41":history-search-backward' + bind '"\x1b\x5b\x42":history-search-forward' +fi + +alias lsa="ls -lah --color=always" +lsp() { ls -lah --color=always "$@" | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'; } + +alias ls='ls --color=auto' +alias ll='ls --color=auto -lAF' +alias grep='grep --color=auto' +# alias cls="stat -c '%a %A %U %G %s %n' *" +# if [ "$color_prompt" = yes ]; then +export PS1='\[\e[\033[32m\]\D{%y%m%d}-\A \h:\w\[\e[0m\] \n\[\e[0;1;34m\]\u\$ \[\e[0m\]' From 9cdf949985a0abd55ce80775247d3d2552c37b8e Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 20:57:19 +0800 Subject: [PATCH 058/165] Create bashrc.sh --- bashrc.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 bashrc.sh diff --git a/bashrc.sh b/bashrc.sh new file mode 100644 index 0000000..54955d9 --- /dev/null +++ b/bashrc.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +# Usage: +# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bashrc.sh) + + +# allusers=$( cat /etc/passwd | grep -vE "(/bin/false|/sbin/nologin|/bin/sync|guest-)" | cut -d: -f1 ) +# allusers=$(awk -F':' '$2 ~ "\\$" {print $1}' /etc/shadow) +for file in /root/.bashrc /home/*/.bashrc ; do + # echo $file; + # delete lines between two patterns + sed -i '/^# => vps.dance/,/^# <= vps.dance/d' $file; + # insert lines + printf "%s\n" "# => vps.dance" >> $file; + printf "%s\n" "$(curl -Lso- jsonip.com)" >> $file; + printf "%s\n" "# <= vps.dance" >>$file; +done +source ~/.bashrc From 5596082db5f4d50c0e31c052e970267116b936ee Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 21:02:31 +0800 Subject: [PATCH 059/165] Update bashrc.sh --- bashrc.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bashrc.sh b/bashrc.sh index 54955d9..077cbb0 100644 --- a/bashrc.sh +++ b/bashrc.sh @@ -12,7 +12,7 @@ for file in /root/.bashrc /home/*/.bashrc ; do sed -i '/^# => vps.dance/,/^# <= vps.dance/d' $file; # insert lines printf "%s\n" "# => vps.dance" >> $file; - printf "%s\n" "$(curl -Lso- jsonip.com)" >> $file; + printf "%s\n" "$(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/files/bashrc)" >> $file; printf "%s\n" "# <= vps.dance" >>$file; done source ~/.bashrc From 781011167468c5c212e7bbe3e842fb84d24e084c Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 21:05:54 +0800 Subject: [PATCH 060/165] Update init.sh --- init.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.sh b/init.sh index ff5ea68..2850b80 100644 --- a/init.sh +++ b/init.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/init.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/init.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/init.sh) # bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/init.sh) # bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/init.sh) From 4b31cd77e04567a8f1441cf7771cf7d0e7e583e0 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 21:28:53 +0800 Subject: [PATCH 061/165] Update init.sh --- init.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/init.sh b/init.sh index 2850b80..9068f44 100644 --- a/init.sh +++ b/init.sh @@ -84,6 +84,9 @@ install_deps() { install_bbr() { bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bbr.sh) } +bashrc() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bashrc.sh) +} install_tool() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) "$@" } @@ -105,6 +108,9 @@ bench() { super_speed() { bash <(curl -Lso- https://raw.githubusercontent.com/flyzy2005/superspeed/master/superspeed.sh) } +lemon_bench() { + curl -fsSL http://ilemonra.in/LemonBenchIntl | bash -s fast +} yabs() { info "curl -sL yabs.sh | bash -s -- -dir" curl -sL yabs.sh | bash -s -- -dir @@ -121,20 +127,23 @@ start() { echo -e "${BLUE}请选择要使用的功能${NC}" info "1. [推荐] 安装常用软件 (curl/wget/ping/traceroute...)" info "2. [推荐] 安装并开启 BBR" + info "3. 终端优化 (颜色美化/上下键查找历史)" # info "3. [推荐] 系统配置优化" info "11. 安装 shadowsocks" info "12. 安装 snell" info "13. 安装 realm (端口转发工具)" info "14. 安装 gost (隧道/端口转发工具)" info "15. 安装 nali (IP查询工具)" - info "16. 安装 worsttrace (路由追踪工具)" + info "16. 安装 wtrace (路由追踪工具 WorstTrace)" info "17. 安装 ddns-go (DDNS工具)" # info "19. 安装 wireguard" info "21. 检测 VPS流媒体解锁 (RegionRestrictionCheck)" - info "22. 检测 VPS系统/IO/到国内网速 (SuperBench)" - info "23. 检测 VPS系统/IO/到国际网速 (Bench.sh)" + info "22. 检测 VPS信息/IO/到国内网速 (SuperBench)" + info "23. 检测 VPS信息/IO/到国际网速 (Bench.sh)" info "24. 性能测试 (YABS)" # info "25. 检测 到国内网速(电信/移动/联通) (Superspeed)" + # info "25. 检测 VPS信息/IO/路由 (LemonBench)" + info "25. " # info "29. 性能测试 (UnixBench)" # info "31. DD重装Linux系统" while :; do @@ -154,7 +163,8 @@ main() { header if [[ "$num" == "1" ]]; then install_deps elif [[ "$num" == "2" ]]; then install_bbr - elif [[ "$num" == "3" ]]; then tcpx + elif [[ "$num" == "3" ]]; then bashrc + # elif [[ "$num" == "4" ]]; then tcpx elif [[ "$num" == "11" ]]; then install_tool "ss" elif [[ "$num" == "12" ]]; then install_tool "snell" elif [[ "$num" == "13" ]]; then install_tool "realm" @@ -168,6 +178,7 @@ main() { elif [[ "$num" == "23" ]]; then bench elif [[ "$num" == "24" ]]; then yabs # elif [[ "$num" == "25" ]]; then super_speed + # elif [[ "$num" == "25" ]]; then lemon_bench # elif [[ "$num" == "29" ]]; then unix_bench # elif [[ "$num" == "31" ]]; then reinstall else exit From e7193ef3a0ccc4ffc5863ca4d26737ec582b974c Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 30 Mar 2022 21:45:57 +0800 Subject: [PATCH 062/165] Update bashrc.sh --- bashrc.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bashrc.sh b/bashrc.sh index 077cbb0..6388354 100644 --- a/bashrc.sh +++ b/bashrc.sh @@ -15,4 +15,6 @@ for file in /root/.bashrc /home/*/.bashrc ; do printf "%s\n" "$(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/files/bashrc)" >> $file; printf "%s\n" "# <= vps.dance" >>$file; done -source ~/.bashrc +# source ~/.bashrc +# fix: source bashrc not working +exec bash From e0eafa788908c5f3fb566e47b8da688ce02d4e53 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 09:16:21 +0800 Subject: [PATCH 063/165] Update init.sh --- init.sh | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/init.sh b/init.sh index 9068f44..d7b82f9 100644 --- a/init.sh +++ b/init.sh @@ -115,6 +115,15 @@ yabs() { info "curl -sL yabs.sh | bash -s -- -dir" curl -sL yabs.sh | bash -s -- -dir } +besttrace() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoBestTrace.sh) +} +worsttrace() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoWorstTrace.sh) +} +nalitrace() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoNaliTrace.sh) +} unix_bench() { bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/unixbench.sh) } @@ -127,7 +136,7 @@ start() { echo -e "${BLUE}请选择要使用的功能${NC}" info "1. [推荐] 安装常用软件 (curl/wget/ping/traceroute...)" info "2. [推荐] 安装并开启 BBR" - info "3. 终端优化 (颜色美化/上下键查找历史)" + info "3. [推荐] 终端优化 (颜色美化/上下键查找历史)" # info "3. [推荐] 系统配置优化" info "11. 安装 shadowsocks" info "12. 安装 snell" @@ -143,7 +152,9 @@ start() { info "24. 性能测试 (YABS)" # info "25. 检测 到国内网速(电信/移动/联通) (Superspeed)" # info "25. 检测 VPS信息/IO/路由 (LemonBench)" - info "25. " + info "25. 检测 回程路由 (BestTrace)" + info "26. 检测 回程路由 (WorstTrace)" + info "27. 检测 回程路由 (traceroute + nali)" # info "29. 性能测试 (UnixBench)" # info "31. DD重装Linux系统" while :; do @@ -177,8 +188,9 @@ main() { elif [[ "$num" == "22" ]]; then super_bench elif [[ "$num" == "23" ]]; then bench elif [[ "$num" == "24" ]]; then yabs - # elif [[ "$num" == "25" ]]; then super_speed - # elif [[ "$num" == "25" ]]; then lemon_bench + elif [[ "$num" == "25" ]]; then besttrace + elif [[ "$num" == "26" ]]; then worsttrace + elif [[ "$num" == "27" ]]; then nalitrace # elif [[ "$num" == "29" ]]; then unix_bench # elif [[ "$num" == "31" ]]; then reinstall else exit From a3a72c5be1c8d6974c5ba7c303672d2b2e84e052 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 10:01:03 +0800 Subject: [PATCH 064/165] Update tools.sh --- tools.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools.sh b/tools.sh index 084acaa..3f9e9f3 100644 --- a/tools.sh +++ b/tools.sh @@ -326,7 +326,8 @@ finally () { tips="worsttrace g.cn;" ;; ddns-go) - tips="systemctl restart $app;\n\nOpen http://127.0.0.1:9876 for configuration." + systemctl restart $app; + tips="\nOpen http://127.0.0.1:9876 for configuration." tips="$tips\n\n [Auto-generated] \"$config\"\n" ;; *) From f37a7360867fe356e2c007cacdfc8ffb264bceb8 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 11:09:03 +0800 Subject: [PATCH 065/165] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 985cba7..ec27fa5 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,9 @@ Tools and Scripts for Linux VPS # cdn: https://ghproxy.com/https://github.com/:user/:repo/, https://ghproxy.com/https://github.com/zhboner/realm/releases/download/v1.4/realm --> -- VPS Tool box(include all scripts) +- VPS ToolBox(include all scripts) ```sh -bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/init.sh) +bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) ``` - install ddns-go From d4a90e1d179df7b8167c51069f145a21a3487e52 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 11:09:38 +0800 Subject: [PATCH 066/165] Update and rename init.sh to toolbox.sh --- init.sh => toolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename init.sh => toolbox.sh (99%) diff --git a/init.sh b/toolbox.sh similarity index 99% rename from init.sh rename to toolbox.sh index d7b82f9..9fbd5ec 100644 --- a/init.sh +++ b/toolbox.sh @@ -1,10 +1,10 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/init.sh) -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/init.sh) -# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/init.sh) -# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/init.sh) +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/toolbox.sh) +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh) +# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/toolbox.sh) +# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/toolbox.sh) # Colors RED='\033[0;31m' From 48c876a9d7443e5c8925853f03f7afbf48f32b28 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 11:10:58 +0800 Subject: [PATCH 067/165] Update toolbox.sh --- toolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.sh b/toolbox.sh index 9fbd5ec..998afaa 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -54,7 +54,7 @@ python_version() { header() { next - printf "%s\n" "[VPS Tool box]" + printf "%s\n" "[VPS ToolBox]" printf "%b\n" "${GREEN}VPS/IPLC测评:${NC} ${YELLOW}https://vps.dance/${NC}" printf "%b\n" "目前支持: Ubuntu/Debian, Centos/Redhat" next From 9a97e5c2127525ae555d9cbbb4e3ebecc9e97e42 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 12:41:46 +0800 Subject: [PATCH 068/165] Update toolbox.sh --- toolbox.sh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index 998afaa..7335302 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -87,9 +87,15 @@ install_bbr() { bashrc() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bashrc.sh) } +tuning() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tuning.sh) +} install_tool() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) "$@" } +install_wrap() { + bash <(curl -fsSL https://raw.githubusercontent.com/P3TERX/warp.sh/main/warp.sh) menu +} install_wireguard(){ curl -Ls https://raw.githubusercontent.com/teddysun/across/master/wireguard.sh | bash -s -- -r # uninstall_wireguard @@ -100,7 +106,6 @@ unlock_test() { } super_bench() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/superBench.sh) - curl -sL https://raw.githubusercontent.com/VPSDance/scripts/main/superBench.sh | bash -s io } bench() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bench.sh) @@ -137,7 +142,7 @@ start() { info "1. [推荐] 安装常用软件 (curl/wget/ping/traceroute...)" info "2. [推荐] 安装并开启 BBR" info "3. [推荐] 终端优化 (颜色美化/上下键查找历史)" - # info "3. [推荐] 系统配置优化" + info "4. [推荐] 系统优化 (TCP网络/资源限制)" info "11. 安装 shadowsocks" info "12. 安装 snell" info "13. 安装 realm (端口转发工具)" @@ -145,6 +150,7 @@ start() { info "15. 安装 nali (IP查询工具)" info "16. 安装 wtrace (路由追踪工具 WorstTrace)" info "17. 安装 ddns-go (DDNS工具)" + # info "18. 安装 warp" # info "19. 安装 wireguard" info "21. 检测 VPS流媒体解锁 (RegionRestrictionCheck)" info "22. 检测 VPS信息/IO/到国内网速 (SuperBench)" @@ -175,7 +181,7 @@ main() { if [[ "$num" == "1" ]]; then install_deps elif [[ "$num" == "2" ]]; then install_bbr elif [[ "$num" == "3" ]]; then bashrc - # elif [[ "$num" == "4" ]]; then tcpx + elif [[ "$num" == "4" ]]; then tuning elif [[ "$num" == "11" ]]; then install_tool "ss" elif [[ "$num" == "12" ]]; then install_tool "snell" elif [[ "$num" == "13" ]]; then install_tool "realm" From f96a422bae17ae93808a56afc6d460e303576010 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 17:55:06 +0800 Subject: [PATCH 069/165] Update toolbox.sh --- toolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/toolbox.sh b/toolbox.sh index 7335302..79df938 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Usage: +# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) # bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/toolbox.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh) # bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/toolbox.sh) From ed3e3964808aa24e9503d34875621289b039d87b Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 18:05:33 +0800 Subject: [PATCH 070/165] Update bashrc.sh --- bashrc.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bashrc.sh b/bashrc.sh index 6388354..46a3460 100644 --- a/bashrc.sh +++ b/bashrc.sh @@ -6,8 +6,9 @@ # allusers=$( cat /etc/passwd | grep -vE "(/bin/false|/sbin/nologin|/bin/sync|guest-)" | cut -d: -f1 ) # allusers=$(awk -F':' '$2 ~ "\\$" {print $1}' /etc/shadow) -for file in /root/.bashrc /home/*/.bashrc ; do +for file in /root/.bashrc /home/*/.bashrc; do # echo $file; + if [[ ! -f "$file" ]]; then continue; fi; # delete lines between two patterns sed -i '/^# => vps.dance/,/^# <= vps.dance/d' $file; # insert lines From 5aa77f19258bdc0d6a16f8fde498d10a91cc0503 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 18:11:11 +0800 Subject: [PATCH 071/165] Update toolbox.sh --- toolbox.sh | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index 79df938..a8fba97 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -140,9 +140,9 @@ reinstall() { start() { header echo -e "${BLUE}请选择要使用的功能${NC}" - info "1. [推荐] 安装常用软件 (curl/wget/ping/traceroute...)" + info "1. [推荐] 终端优化 (颜色美化/上下键查找历史)" info "2. [推荐] 安装并开启 BBR" - info "3. [推荐] 终端优化 (颜色美化/上下键查找历史)" + info "3. [推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" info "4. [推荐] 系统优化 (TCP网络/资源限制)" info "11. 安装 shadowsocks" info "12. 安装 snell" @@ -179,29 +179,29 @@ start() { main() { clear header - if [[ "$num" == "1" ]]; then install_deps - elif [[ "$num" == "2" ]]; then install_bbr - elif [[ "$num" == "3" ]]; then bashrc - elif [[ "$num" == "4" ]]; then tuning - elif [[ "$num" == "11" ]]; then install_tool "ss" - elif [[ "$num" == "12" ]]; then install_tool "snell" - elif [[ "$num" == "13" ]]; then install_tool "realm" - elif [[ "$num" == "14" ]]; then install_tool "gost" - elif [[ "$num" == "15" ]]; then install_tool "nali" - elif [[ "$num" == "16" ]]; then install_tool "wtrace" - elif [[ "$num" == "17" ]]; then install_tool "ddns-go" - # elif [[ "$num" == "19" ]]; then install_wireguard - elif [[ "$num" == "21" ]]; then unlock_test - elif [[ "$num" == "22" ]]; then super_bench - elif [[ "$num" == "23" ]]; then bench - elif [[ "$num" == "24" ]]; then yabs - elif [[ "$num" == "25" ]]; then besttrace - elif [[ "$num" == "26" ]]; then worsttrace - elif [[ "$num" == "27" ]]; then nalitrace - # elif [[ "$num" == "29" ]]; then unix_bench - # elif [[ "$num" == "31" ]]; then reinstall + if [[ "$num" == "1" ]]; then bashrc + elif [[ "$num" == "2" ]]; then install_bbr + elif [[ "$num" == "3" ]]; then install_deps + elif [[ "$num" == "4" ]]; then tuning + elif [[ "$num" == "11" ]]; then install_tool "ss" + elif [[ "$num" == "12" ]]; then install_tool "snell" + elif [[ "$num" == "13" ]]; then install_tool "realm" + elif [[ "$num" == "14" ]]; then install_tool "gost" + elif [[ "$num" == "15" ]]; then install_tool "nali" + elif [[ "$num" == "16" ]]; then install_tool "wtrace" + elif [[ "$num" == "17" ]]; then install_tool "ddns-go" + # elif [[ "$num" == "19" ]]; then install_wireguard + elif [[ "$num" == "21" ]]; then unlock_test + elif [[ "$num" == "22" ]]; then super_bench + elif [[ "$num" == "23" ]]; then bench + elif [[ "$num" == "24" ]]; then yabs + elif [[ "$num" == "25" ]]; then besttrace + elif [[ "$num" == "26" ]]; then worsttrace + elif [[ "$num" == "27" ]]; then nalitrace + # elif [[ "$num" == "29" ]]; then unix_bench + # elif [[ "$num" == "31" ]]; then reinstall else exit - fi + fi } check_root From e60bd65f5dee263fc006efc6be6872c406ee0af7 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 18:17:37 +0800 Subject: [PATCH 072/165] Create ssh.sh --- ssh.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 ssh.sh diff --git a/ssh.sh b/ssh.sh new file mode 100644 index 0000000..3b109f1 --- /dev/null +++ b/ssh.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +# Set up SSH public key authentication + +mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys +main () { + echo "Paste your SSH public key `~/.ssh/id_rsa.pub`:" + IFS= read -d '' -n 1 text + while IFS= read -d '' -n 1 -t 2 c + do + text+=$c + done + echo "public key=$text" +} +main From 88897d932c1f0cbe7ddf504ebcea597c558b7fb3 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 18:20:22 +0800 Subject: [PATCH 073/165] Update ssh.sh --- ssh.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ssh.sh b/ssh.sh index 3b109f1..3ad89a1 100644 --- a/ssh.sh +++ b/ssh.sh @@ -1,10 +1,11 @@ #!/usr/bin/env bash # Set up SSH public key authentication +# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys main () { - echo "Paste your SSH public key `~/.ssh/id_rsa.pub`:" + echo "Paste your SSH public key (~/.ssh/id_rsa.pub):" IFS= read -d '' -n 1 text while IFS= read -d '' -n 1 -t 2 c do From eeba75fc6747dce818ad513e42697c05b12df47e Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 20:55:09 +0800 Subject: [PATCH 074/165] Update ssh.sh --- ssh.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ssh.sh b/ssh.sh index 3ad89a1..ac65fca 100644 --- a/ssh.sh +++ b/ssh.sh @@ -3,7 +3,12 @@ # Set up SSH public key authentication # bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) -mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys +# mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys + +mmkdir -p "${HOME}/.ssh"; chmod 700 "${HOME}/.ssh"; +if [[ ! -f "${HOME}/.ssh/authorized_keys" ]]; then echo '' >> ~/.ssh/authorized_keys; fi +chmod 600 "${HOME}/.ssh/authorized_keys" + main () { echo "Paste your SSH public key (~/.ssh/id_rsa.pub):" IFS= read -d '' -n 1 text From 06dc12114a36f8dda2576dbd89507d34833a3b78 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 31 Mar 2022 20:55:40 +0800 Subject: [PATCH 075/165] Update ssh.sh --- ssh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh.sh b/ssh.sh index ac65fca..082ffb1 100644 --- a/ssh.sh +++ b/ssh.sh @@ -5,7 +5,7 @@ # mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys -mmkdir -p "${HOME}/.ssh"; chmod 700 "${HOME}/.ssh"; +mkdir -p "${HOME}/.ssh"; chmod 700 "${HOME}/.ssh"; if [[ ! -f "${HOME}/.ssh/authorized_keys" ]]; then echo '' >> ~/.ssh/authorized_keys; fi chmod 600 "${HOME}/.ssh/authorized_keys" From 969da647cfb369cd2bc87489f9d612e2b064a4fc Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 1 Apr 2022 12:46:07 +0800 Subject: [PATCH 076/165] Update ssh.sh --- ssh.sh | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/ssh.sh b/ssh.sh index 082ffb1..668acec 100644 --- a/ssh.sh +++ b/ssh.sh @@ -5,9 +5,14 @@ # mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys -mkdir -p "${HOME}/.ssh"; chmod 700 "${HOME}/.ssh"; -if [[ ! -f "${HOME}/.ssh/authorized_keys" ]]; then echo '' >> ~/.ssh/authorized_keys; fi -chmod 600 "${HOME}/.ssh/authorized_keys" + +for home in /root /home/*; # do { if [[ ! -e "$home" ]]; then continue; fi; echo $home; }; done +do + if [[ ! -e "$home" ]]; then continue; fi; + mkdir -p "${home}/.ssh"; chmod 700 "${home}/.ssh"; + if [[ ! -f "${home}/.ssh/authorized_keys" ]]; then echo '' >> ~/.ssh/authorized_keys; fi + chmod 600 "${home}/.ssh/authorized_keys" +done main () { echo "Paste your SSH public key (~/.ssh/id_rsa.pub):" @@ -16,6 +21,22 @@ main () { do text+=$c done - echo "public key=$text" + text=$(echo "$text" | sed '/^$/d') + # echo "public key=$text" + # echo "$text" >> "${HOME}/.ssh/authorized_keys" + + # for line in $text; do echo "$line"; sed -i "/$line/d" test; done + # echo "$text" >> test + + for home in /root /home/*; + do + if [[ ! -e "$home" ]]; then continue; fi; # echo $home; + # remove-duplicates + # sed -nr 'G;/^([^\n]+\n)([^\n]+\n)*\1/!{P;h}' + # awk '!seen[$0]++' + sed -i "/^$/d" "${home}/.ssh/authorized_keys" + sed -i -nr 'G;/^([^\n]+\n)([^\n]+\n)*\1/!{P;h}' "${home}/.ssh/authorized_keys" + echo "$text" >> "${home}/.ssh/authorized_keys" + done } main From e7395d331ecd21af321cd6097472a879ebf10a2d Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 1 Apr 2022 12:50:48 +0800 Subject: [PATCH 077/165] Update ssh.sh --- ssh.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ssh.sh b/ssh.sh index 668acec..ab9800c 100644 --- a/ssh.sh +++ b/ssh.sh @@ -30,13 +30,14 @@ main () { for home in /root /home/*; do - if [[ ! -e "$home" ]]; then continue; fi; # echo $home; + if [[ ! -e "$home" ]]; then continue; fi; + # echo $home; + echo "$text" >> "${home}/.ssh/authorized_keys" # remove-duplicates # sed -nr 'G;/^([^\n]+\n)([^\n]+\n)*\1/!{P;h}' # awk '!seen[$0]++' sed -i "/^$/d" "${home}/.ssh/authorized_keys" sed -i -nr 'G;/^([^\n]+\n)([^\n]+\n)*\1/!{P;h}' "${home}/.ssh/authorized_keys" - echo "$text" >> "${home}/.ssh/authorized_keys" done } main From af97a646ab8d10fec831462a686b60794d4a6b41 Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 1 Apr 2022 12:56:56 +0800 Subject: [PATCH 078/165] Update toolbox.sh --- toolbox.sh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index a8fba97..81a4958 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -85,6 +85,9 @@ install_deps() { install_bbr() { bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bbr.sh) } +ssh_key() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) +} bashrc() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bashrc.sh) } @@ -140,10 +143,11 @@ reinstall() { start() { header echo -e "${BLUE}请选择要使用的功能${NC}" - info "1. [推荐] 终端优化 (颜色美化/上下键查找历史)" - info "2. [推荐] 安装并开启 BBR" - info "3. [推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" - info "4. [推荐] 系统优化 (TCP网络/资源限制)" + info "1. [推荐] 配置SSH Public Key (SSH免密登录)" + info "2. [推荐] 终端优化 (颜色美化/上下键查找历史)" + info "3. [推荐] 安装并开启 BBR" + info "4. [推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" + info "5. [推荐] 系统优化 (TCP网络/资源限制)" info "11. 安装 shadowsocks" info "12. 安装 snell" info "13. 安装 realm (端口转发工具)" @@ -179,10 +183,11 @@ start() { main() { clear header - if [[ "$num" == "1" ]]; then bashrc - elif [[ "$num" == "2" ]]; then install_bbr - elif [[ "$num" == "3" ]]; then install_deps - elif [[ "$num" == "4" ]]; then tuning + if [[ "$num" == "1" ]]; then ssh_key + if [[ "$num" == "2" ]]; then bashrc + elif [[ "$num" == "3" ]]; then install_bbr + elif [[ "$num" == "4" ]]; then install_deps + elif [[ "$num" == "5" ]]; then tuning elif [[ "$num" == "11" ]]; then install_tool "ss" elif [[ "$num" == "12" ]]; then install_tool "snell" elif [[ "$num" == "13" ]]; then install_tool "realm" From 6e76cd5facff46dcd1d2a2c3ffe01967a8a6d1d9 Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 1 Apr 2022 22:37:38 +0800 Subject: [PATCH 079/165] Update toolbox.sh --- toolbox.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index 81a4958..1b53305 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -140,7 +140,7 @@ reinstall() { bash <(curl -Lso- https://raw.githubusercontent.com/hiCasper/Shell/master/AutoReinstall.sh) } -start() { +menu() { header echo -e "${BLUE}请选择要使用的功能${NC}" info "1. [推荐] 配置SSH Public Key (SSH免密登录)" @@ -184,7 +184,7 @@ main() { clear header if [[ "$num" == "1" ]]; then ssh_key - if [[ "$num" == "2" ]]; then bashrc + elif [[ "$num" == "2" ]]; then bashrc elif [[ "$num" == "3" ]]; then install_bbr elif [[ "$num" == "4" ]]; then install_deps elif [[ "$num" == "5" ]]; then tuning @@ -210,5 +210,5 @@ main() { } check_root -start +menu main From d077329c9f466d1dd70ba82788a457f9ac5317a2 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 21:47:02 +0800 Subject: [PATCH 080/165] Create tuning.sh --- tuning.sh | 109 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 tuning.sh diff --git a/tuning.sh b/tuning.sh new file mode 100644 index 0000000..5c681d9 --- /dev/null +++ b/tuning.sh @@ -0,0 +1,109 @@ + +#!/usr/bin/env bash +# tuning.sh + +# Reference: +# https://www.cnblogs.com/tolimit/p/5065761.html +# https://cloud.google.com/architecture/tcp-optimization-for-network-performance-in-gcp-and-hybrid?hl=zh-cn +# [LFN网络下TCP性能的优化](https://github.com/acacia233/Project-Smalltrick/wiki/) +# https://github.com/ylx2016/Linux-NetSpeed/blob/master/tcp.sh +# http://sh.nekoneko.cloud/tools.sh + +pam_limits="/etc/pam.d/common-session" +limits_conf="/etc/security/limits.conf" +sysctl_conf="/etc/sysctl.conf" +allusers=$( cat /etc/passwd | grep -vE "(/bin/false|/sbin/nologin|/bin/sync|guest-)" | cut -d: -f1 ) +# allusers=$(awk -F':' '$2 ~ "\\$" {print $1}' /etc/shadow) + +reload_sysctl() { sysctl -q -p && sysctl -q --system; } +check_sysctl() { + if [ ! -f '/etc/sysctl.conf' ]; then touch /etc/sysctl.conf; fi +} + +ulimited_tuning() { + check_sysctl + # enable 'session required pam_limits.so' + if ! grep -q 'pam_limits.so' "$pam_limits"; then + sed -i '/required.* pam_limits.so/d' "$pam_limits" + echo 'session required pam_limits.so' >> "$pam_limits" + fi + # max open files + sed -i '/fs.file-max/d' "$sysctl_conf" + echo 'fs.file-max=102400' >> "$sysctl_conf" + + ulimit -SHn 65535 && ulimit -c unlimited + if ! grep -q "ulimit" /etc/profile; then + sed -i '/ulimit -SHn/d' /etc/profile + echo "ulimit -SHn 1000000" >> /etc/profile + fi + for usr in $allusers '\*'; do + usr="${usr/\\/}" + sed -i "/${usr}.*\(nproc\|nofile\|memlock\)/d" "$limits_conf" + echo "${usr} soft nproc 65536" >> "$limits_conf" + echo "${usr} hard nproc 65536" >> "$limits_conf" + echo "${usr} soft nofile 65535" >> "$limits_conf" + echo "${usr} hard nofile 65535" >> "$limits_conf" + echo "${usr} soft memlock unlimited" >> "$limits_conf" + echo "${usr} hard memlock unlimited" >> "$limits_conf" + done + reload_sysctl +} + +# sysctl -a | grep mem +tcp_tuning() { + check_sysctl + # incoming connections + sed -i '/net.core.somaxconn/d' >> "$sysctl_conf" + echo 'net.core.somaxconn=65535' >> "$sysctl_conf" + # 保持time_wait套接字的最大数 + sed -i '/net.ipv4.tcp_max_tw_buckets/d' >> "$sysctl_conf" + echo 'net.ipv4.tcp_max_tw_buckets=8192' >> "$sysctl_conf" + # 端口随机分配的范围 + sed -i '/net.ipv4.ip_local_port_range/d' >> "$sysctl_conf" + echo 'net.ipv4.ip_local_port_range=10240 65000' >> "$sysctl_conf" + # TCP内存自动调整 + sed -i '/net.ipv4.tcp_moderate_rcvbuf/d' >> "$sysctl_conf" + echo 'net.ipv4.tcp_moderate_rcvbuf=1' >> "$sysctl_conf" + # TCP窗口大小缩放 + sed -i '/net.ipv4.tcp_window_scaling/d' "$sysctl_conf" + echo 'net.ipv4.tcp_window_scaling=1' >> "$sysctl_conf" + # TCP缓冲区 + BDP='16777216' # 26214400 + # sed -i '/net.ipv4.tcp_rmem/d' >> "$sysctl_conf" + # sed -i '/net.ipv4.tcp_wmem/d' >> "$sysctl_conf" + # echo "net.ipv4.tcp_rmem=4096 131072 $BDP" >> "$sysctl_conf" + # echo "net.ipv4.tcp_wmem=4096 16384 $BDP" >> "$sysctl_conf" + sed -i '/net.core.rmem_max/d' >> "$sysctl_conf" + sed -i '/net.core.wmem_max/d' >> "$sysctl_conf" + echo "net.core.rmem_max=$BDP" >> "$sysctl_conf" + echo "net.core.wmem_max=$BDP" >> "$sysctl_conf" + sed -i '/net.core.rmem_default/d' >> "$sysctl_conf" + echo "net.core.rmem_default=$BDP" >> "$sysctl_conf" # 212992, `$BDP / 2` + # TCP Fast Open + sed -i '/net.ipv4.tcp_fastopen/d' "$sysctl_conf" + echo 'net.ipv4.tcp_fastopen=1' >> "$sysctl_conf" + # 网卡设备将请求放入队列的最大长度(默认值1000) + sed -i '/net.core.netdev_max_backlog/d' "$sysctl_conf" + echo 'net.core.netdev_max_backlog=32768' >> "$sysctl_conf" + # 接受SYN同步包的最大客户端数量(默认值128) + sed -i '/net.ipv4.tcp_max_syn_backlog/d' "$sysctl_conf" + echo 'net.ipv4.tcp_max_syn_backlog=8192' >> "$sysctl_conf" + # SYN洪水攻击保护, 可防范少量SYN攻击 (在syn_backlog队列满了之后才会触发) + sed -i '/net.ipv4.tcp_syncookies/d' "$sysctl_conf" + echo 'net.ipv4.tcp_syncookies=1' >> "$sysctl_conf" + # TCP失败重传次数(默认值15), 重传15次才彻底放弃, 适当改小,尽早释放资源 + sed -i '/net.ipv4.tcp_retries2/d' "$sysctl_conf" + echo 'net.ipv4.tcp_retries2=8' >> "$sysctl_conf" + # 放弃建立连接之前发送SYN包的数量(默认值6) 负载大且网络状况好的情况下建议更小 + sed -i '/net.ipv4.tcp_syn_retries/d' "$sysctl_conf" + echo 'net.ipv4.tcp_syn_retries=3' >> "$sysctl_conf" + # 放弃连接之前所送出的 SYN+ACK 数目(默认值5) + sed -i '/net.ipv4.tcp_synack_retries/d' "$sysctl_conf" + echo 'net.ipv4.tcp_synack_retries=3' >> "$sysctl_conf" + # 如果套接字由本端要求关闭, 保持FIN-WAIT-2状态的时间(默认值60) + sed -i '/net.ipv4.tcp_fin_timeout/d' "$sysctl_conf" + echo 'net.ipv4.tcp_fin_timeout=30' >> "$sysctl_conf" + reload_sysctl +} +ulimited_tuning +tcp_tuning From 230a939f951b91e7274306e2fddd362fc7c20896 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:12:03 +0800 Subject: [PATCH 081/165] Update tuning.sh --- tuning.sh | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tuning.sh b/tuning.sh index 5c681d9..1f77ac7 100644 --- a/tuning.sh +++ b/tuning.sh @@ -15,7 +15,7 @@ sysctl_conf="/etc/sysctl.conf" allusers=$( cat /etc/passwd | grep -vE "(/bin/false|/sbin/nologin|/bin/sync|guest-)" | cut -d: -f1 ) # allusers=$(awk -F':' '$2 ~ "\\$" {print $1}' /etc/shadow) -reload_sysctl() { sysctl -q -p && sysctl -q --system; } +reload_sysctl() { sysctl -q -p && sysctl --system; } check_sysctl() { if [ ! -f '/etc/sysctl.conf' ]; then touch /etc/sysctl.conf; fi } @@ -30,12 +30,7 @@ ulimited_tuning() { # max open files sed -i '/fs.file-max/d' "$sysctl_conf" echo 'fs.file-max=102400' >> "$sysctl_conf" - - ulimit -SHn 65535 && ulimit -c unlimited - if ! grep -q "ulimit" /etc/profile; then - sed -i '/ulimit -SHn/d' /etc/profile - echo "ulimit -SHn 1000000" >> /etc/profile - fi + # max user processes for usr in $allusers '\*'; do usr="${usr/\\/}" sed -i "/${usr}.*\(nproc\|nofile\|memlock\)/d" "$limits_conf" @@ -46,38 +41,43 @@ ulimited_tuning() { echo "${usr} soft memlock unlimited" >> "$limits_conf" echo "${usr} hard memlock unlimited" >> "$limits_conf" done - reload_sysctl + if ! grep -q "ulimit" /etc/profile; then + sed -i '/ulimit -SHn/d' /etc/profile + echo "ulimit -SHn 1000000" >> /etc/profile + fi + ulimit -SHn 65535 && ulimit -c unlimited + # reload_sysctl } # sysctl -a | grep mem tcp_tuning() { check_sysctl # incoming connections - sed -i '/net.core.somaxconn/d' >> "$sysctl_conf" + sed -i '/net.core.somaxconn/d' "$sysctl_conf" echo 'net.core.somaxconn=65535' >> "$sysctl_conf" # 保持time_wait套接字的最大数 - sed -i '/net.ipv4.tcp_max_tw_buckets/d' >> "$sysctl_conf" + sed -i '/net.ipv4.tcp_max_tw_buckets/d' "$sysctl_conf" echo 'net.ipv4.tcp_max_tw_buckets=8192' >> "$sysctl_conf" # 端口随机分配的范围 - sed -i '/net.ipv4.ip_local_port_range/d' >> "$sysctl_conf" + sed -i '/net.ipv4.ip_local_port_range/d' "$sysctl_conf" echo 'net.ipv4.ip_local_port_range=10240 65000' >> "$sysctl_conf" # TCP内存自动调整 - sed -i '/net.ipv4.tcp_moderate_rcvbuf/d' >> "$sysctl_conf" + sed -i '/net.ipv4.tcp_moderate_rcvbuf/d' "$sysctl_conf" echo 'net.ipv4.tcp_moderate_rcvbuf=1' >> "$sysctl_conf" # TCP窗口大小缩放 sed -i '/net.ipv4.tcp_window_scaling/d' "$sysctl_conf" echo 'net.ipv4.tcp_window_scaling=1' >> "$sysctl_conf" # TCP缓冲区 BDP='16777216' # 26214400 - # sed -i '/net.ipv4.tcp_rmem/d' >> "$sysctl_conf" - # sed -i '/net.ipv4.tcp_wmem/d' >> "$sysctl_conf" + # sed -i '/net.ipv4.tcp_rmem/d' "$sysctl_conf" + # sed -i '/net.ipv4.tcp_wmem/d' "$sysctl_conf" # echo "net.ipv4.tcp_rmem=4096 131072 $BDP" >> "$sysctl_conf" # echo "net.ipv4.tcp_wmem=4096 16384 $BDP" >> "$sysctl_conf" - sed -i '/net.core.rmem_max/d' >> "$sysctl_conf" - sed -i '/net.core.wmem_max/d' >> "$sysctl_conf" + sed -i '/net.core.rmem_max/d' "$sysctl_conf" + sed -i '/net.core.wmem_max/d' "$sysctl_conf" echo "net.core.rmem_max=$BDP" >> "$sysctl_conf" echo "net.core.wmem_max=$BDP" >> "$sysctl_conf" - sed -i '/net.core.rmem_default/d' >> "$sysctl_conf" + sed -i '/net.core.rmem_default/d' "$sysctl_conf" echo "net.core.rmem_default=$BDP" >> "$sysctl_conf" # 212992, `$BDP / 2` # TCP Fast Open sed -i '/net.ipv4.tcp_fastopen/d' "$sysctl_conf" @@ -103,7 +103,8 @@ tcp_tuning() { # 如果套接字由本端要求关闭, 保持FIN-WAIT-2状态的时间(默认值60) sed -i '/net.ipv4.tcp_fin_timeout/d' "$sysctl_conf" echo 'net.ipv4.tcp_fin_timeout=30' >> "$sysctl_conf" - reload_sysctl + # reload_sysctl } ulimited_tuning tcp_tuning +reload_sysctl From b64aeea9e055f285fbb009e03f41950f2481edba Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:20:47 +0800 Subject: [PATCH 082/165] Update toolbox.sh --- toolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.sh b/toolbox.sh index 1b53305..2973925 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -147,7 +147,7 @@ menu() { info "2. [推荐] 终端优化 (颜色美化/上下键查找历史)" info "3. [推荐] 安装并开启 BBR" info "4. [推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" - info "5. [推荐] 系统优化 (TCP网络/资源限制)" + info "5. [推荐] 系统优化 (TCP网络优化/资源限制优化)" info "11. 安装 shadowsocks" info "12. 安装 snell" info "13. 安装 realm (端口转发工具)" From 63674bb2dbfb0386be1b5f80fc9ece261b7fd519 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:26:56 +0800 Subject: [PATCH 083/165] Update autoWorstTrace.sh --- autoWorstTrace.sh | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/autoWorstTrace.sh b/autoWorstTrace.sh index a886816..21b813e 100644 --- a/autoWorstTrace.sh +++ b/autoWorstTrace.sh @@ -7,6 +7,13 @@ # Trap interrupts and exit instead of continuing the loop trap "echo Exited!; exit;" SIGINT SIGTERM +footer() { + BLUE="\033[34m"; NC='\033[0m' + printf "%-37s\n" "-" | sed 's/\s/-/g' + printf "%b\n" " Supported by: ${BLUE}https://vps.dance${NC}" + printf "%-37s\n" "-" | sed 's/\s/-/g' +} + # install worsttrace if [ ! -f "/usr/bin/worsttrace" ]; then bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) wtrace -p @@ -33,3 +40,5 @@ do next done # worsttrace 202.112.14.151 | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' +footer + From d53b7bd667d134cfb70a41d6c1d829c8b1f97bee Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:28:13 +0800 Subject: [PATCH 084/165] Update autoNaliTrace.sh --- autoNaliTrace.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoNaliTrace.sh b/autoNaliTrace.sh index a6977a2..e4026e9 100644 --- a/autoNaliTrace.sh +++ b/autoNaliTrace.sh @@ -4,6 +4,13 @@ # bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoNaliTrace.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNaliTrace.sh) +footer() { + BLUE="\033[34m"; NC='\033[0m' + printf "%-37s\n" "-" | sed 's/\s/-/g' + printf "%b\n" " Supported by: ${BLUE}https://vps.dance${NC}" + printf "%-37s\n" "-" | sed 's/\s/-/g' +} + # install nali if [ ! -f "/usr/bin/nali" ]; then bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) nali -p @@ -30,6 +37,7 @@ do | sed 's/ 对方和您在同一内部网//g; s/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\ *\[.*\]\) *([0-9\.]\+ [^)]\+)/\1/g; s/ \[\(as.*\/as.*\)\]/ [*]/Ig' next done +footer # echo '2 172.30.83.68 [局域网 对方和您在同一内部网] (172.30.83.68 [局域网 对方和您在同一内部网] ) [*] 2.847 ms' | sed 's/ 对方和您在同一内部网//g' # echo '2 172.30.83.68 [局域网] (172.30.83.68 [局域网] ) [*] 1.956 ms' | sed 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\ *\[.*\]\) *([0-9\.]\+ [^)]\+)/#\1#/g' # echo '2 172.30.83.68 [局域网] (172.30.83.68 [局域网] ) [*] 1.956 ms' | sed 's/ *([0-9\.]\+ [^)]\+)/#\0#/g' From 2aa24da1a6788106659cfe81ff3101929d725283 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:28:41 +0800 Subject: [PATCH 085/165] Update autoWorstTrace.sh --- autoWorstTrace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoWorstTrace.sh b/autoWorstTrace.sh index 21b813e..e7449be 100644 --- a/autoWorstTrace.sh +++ b/autoWorstTrace.sh @@ -39,6 +39,6 @@ do worsttrace ${ip_list[$i]} | sed ':a;N;s/.*WorstTrace.*\n//g;ta; s/^[[:space:]]*//;s/[[:space:]]*$//; /^$/d' next done -# worsttrace 202.112.14.151 | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' footer +# worsttrace 202.112.14.151 | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' From c4229fa147e70f22f8ade1d958886a7bfbfe5f88 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:35:09 +0800 Subject: [PATCH 086/165] Update README.md --- README.md | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/README.md b/README.md index ec27fa5..8dab96a 100644 --- a/README.md +++ b/README.md @@ -31,28 +31,10 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) re bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/paste.sh) ``` -- unlockTest -``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/unlockTest.sh) -``` - -- superBench -``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/superBench.sh) -``` -- bench -``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/bench.sh) -``` - - autoBestTrace ``` bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoBestTrace.sh) ``` -- autoNaliTrace -``` - bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNaliTrace.sh) -``` - autoWorstTrace ``` bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoWorstTrace.sh) @@ -60,8 +42,5 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoWorstTra update cache: +- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh - https://purge.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh -- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/unlockTest.sh -- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/superBench.sh -- https://purge.jsdelivr.net/gh/VPSDance/scripts@main/bench.sh - From bda2922aeaaa794ccc4062b94f1bdf56612e72b9 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:55:29 +0800 Subject: [PATCH 087/165] Update toolbox.sh --- toolbox.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index 2973925..e4217f4 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -57,13 +57,15 @@ header() { next printf "%s\n" "[VPS ToolBox]" printf "%b\n" "${GREEN}VPS/IPLC测评:${NC} ${YELLOW}https://vps.dance/${NC}" + printf "%b\n" "${GREEN}Telegram频道:${NC} ${YELLOW}https://https://t.me/vpsdance${NC}" printf "%b\n" "目前支持: Ubuntu/Debian, Centos/Redhat" next } footer() { - next - printf "%b\n" "Supported by: https://vps.dance" - next + BLUE="\033[34m"; NC='\033[0m' + printf "%-37s\n" "-" | sed 's/\s/-/g' + printf "%b\n" " Supported by: ${BLUE}https://vps.dance${NC}" + printf "%-37s\n" "-" | sed 's/\s/-/g' } install_deps() { From c9bd9f97cb900c62f763e60ba37e6dd4fbe96c0a Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:55:54 +0800 Subject: [PATCH 088/165] Update toolbox.sh --- toolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/toolbox.sh b/toolbox.sh index e4217f4..23e6964 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Usage: +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh) # bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) # bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/toolbox.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh) From 27de2e72347f0617775be27d4f02dbb14928be45 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sat, 2 Apr 2022 22:57:37 +0800 Subject: [PATCH 089/165] Update toolbox.sh --- toolbox.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index 23e6964..03a572a 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -56,10 +56,9 @@ python_version() { header() { next - printf "%s\n" "[VPS ToolBox]" + printf "%s\n" "[VPS ToolBox] 目前支持: Ubuntu/Debian, Centos/Redhat" printf "%b\n" "${GREEN}VPS/IPLC测评:${NC} ${YELLOW}https://vps.dance/${NC}" printf "%b\n" "${GREEN}Telegram频道:${NC} ${YELLOW}https://https://t.me/vpsdance${NC}" - printf "%b\n" "目前支持: Ubuntu/Debian, Centos/Redhat" next } footer() { From f960637ebcd7b9105fc7728f7a6af1e3940cddb7 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 09:54:31 +0800 Subject: [PATCH 090/165] Update superBench.sh --- superBench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superBench.sh b/superBench.sh index 1b53840..160aea3 100644 --- a/superBench.sh +++ b/superBench.sh @@ -11,7 +11,7 @@ python_version() { main() { # fix python3 error local ver=$(python_version) # echo $ver - curl -Lso- https://cdn.jsdelivr.net/gh/oooldking/script@1.1.7/tools.py > tools.py + curl -Lso- https://raw.githubusercontent.com/oooldking/script/master/tools.py > tools.py if (ver_lte 3 $ver); then sed -i 's/print \(.*\)$/print(\1)/g' tools.py sed -i 's/,urllib2,/,/g' tools.py From fa0160b198eee48a223f426368b350414468d8ec Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 09:55:32 +0800 Subject: [PATCH 091/165] Update superBench.sh --- superBench.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/superBench.sh b/superBench.sh index 160aea3..a74a615 100644 --- a/superBench.sh +++ b/superBench.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Usage: +# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/superBench.sh) +# Reference: # https://github.com/oooldking/script ver_lte() { # <= From c7caf5180e9af9f2ae38fa4cd0882a6e4f9da55e Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 14:15:08 +0800 Subject: [PATCH 092/165] Update toolbox.sh --- toolbox.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index 03a572a..a07b036 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -155,7 +155,7 @@ menu() { info "13. 安装 realm (端口转发工具)" info "14. 安装 gost (隧道/端口转发工具)" info "15. 安装 nali (IP查询工具)" - info "16. 安装 wtrace (路由追踪工具 WorstTrace)" + # info "16. 安装 wtrace (路由追踪工具 WorstTrace)" info "17. 安装 ddns-go (DDNS工具)" # info "18. 安装 warp" # info "19. 安装 wireguard" @@ -166,8 +166,8 @@ menu() { # info "25. 检测 到国内网速(电信/移动/联通) (Superspeed)" # info "25. 检测 VPS信息/IO/路由 (LemonBench)" info "25. 检测 回程路由 (BestTrace)" - info "26. 检测 回程路由 (WorstTrace)" - info "27. 检测 回程路由 (traceroute + nali)" + # info "26. 检测 回程路由 (WorstTrace)" + # info "27. 检测 回程路由 (traceroute + nali)" # info "29. 性能测试 (UnixBench)" # info "31. DD重装Linux系统" while :; do @@ -195,7 +195,7 @@ main() { elif [[ "$num" == "13" ]]; then install_tool "realm" elif [[ "$num" == "14" ]]; then install_tool "gost" elif [[ "$num" == "15" ]]; then install_tool "nali" - elif [[ "$num" == "16" ]]; then install_tool "wtrace" + # elif [[ "$num" == "16" ]]; then install_tool "wtrace" elif [[ "$num" == "17" ]]; then install_tool "ddns-go" # elif [[ "$num" == "19" ]]; then install_wireguard elif [[ "$num" == "21" ]]; then unlock_test @@ -203,8 +203,8 @@ main() { elif [[ "$num" == "23" ]]; then bench elif [[ "$num" == "24" ]]; then yabs elif [[ "$num" == "25" ]]; then besttrace - elif [[ "$num" == "26" ]]; then worsttrace - elif [[ "$num" == "27" ]]; then nalitrace + # elif [[ "$num" == "26" ]]; then worsttrace + # elif [[ "$num" == "27" ]]; then nalitrace # elif [[ "$num" == "29" ]]; then unix_bench # elif [[ "$num" == "31" ]]; then reinstall else exit From baebbc3d29299dfbd3feded17e78005a733b3622 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 14:17:41 +0800 Subject: [PATCH 093/165] Delete autoNaliTrace.sh --- autoNaliTrace.sh | 45 --------------------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 autoNaliTrace.sh diff --git a/autoNaliTrace.sh b/autoNaliTrace.sh deleted file mode 100644 index e4026e9..0000000 --- a/autoNaliTrace.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoNaliTrace.sh) -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNaliTrace.sh) - -footer() { - BLUE="\033[34m"; NC='\033[0m' - printf "%-37s\n" "-" | sed 's/\s/-/g' - printf "%b\n" " Supported by: ${BLUE}https://vps.dance${NC}" - printf "%-37s\n" "-" | sed 's/\s/-/g' -} - -# install nali -if [ ! -f "/usr/bin/nali" ]; then - bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) nali -p -fi - -## start to use nali -nali update; - -next() { - printf "%-70s\n" "-" | sed 's/\s/-/g' -} - -clear -next - -ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 202.112.14.151) -ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 成都教育网) -# ip_len=${#ip_list[@]} - -for i in {0..7} -do - echo ${ip_addr[$i]} - traceroute -AT4 -m30 -q1 ${ip_list[$i]} 30 | nali \ - | sed 's/ 对方和您在同一内部网//g; s/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\ *\[.*\]\) *([0-9\.]\+ [^)]\+)/\1/g; s/ \[\(as.*\/as.*\)\]/ [*]/Ig' - next -done -footer -# echo '2 172.30.83.68 [局域网 对方和您在同一内部网] (172.30.83.68 [局域网 对方和您在同一内部网] ) [*] 2.847 ms' | sed 's/ 对方和您在同一内部网//g' -# echo '2 172.30.83.68 [局域网] (172.30.83.68 [局域网] ) [*] 1.956 ms' | sed 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\ *\[.*\]\) *([0-9\.]\+ [^)]\+)/#\1#/g' -# echo '2 172.30.83.68 [局域网] (172.30.83.68 [局域网] ) [*] 1.956 ms' | sed 's/ *([0-9\.]\+ [^)]\+)/#\0#/g' -# echo '8 104.254.115.46 [北美地区] [AS199524/AS133731/as21859/AS134671/AS40676/AS21859] 1.972 ms' | sed 's/ \[\(as.*\/as.*\)\]/ [*]/Ig' - From d224c1138af3dd17a16e6eda17511be2c0eb0072 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 14:17:51 +0800 Subject: [PATCH 094/165] Delete autoWorstTrace.sh --- autoWorstTrace.sh | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 autoWorstTrace.sh diff --git a/autoWorstTrace.sh b/autoWorstTrace.sh deleted file mode 100644 index e7449be..0000000 --- a/autoWorstTrace.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/usr/bin/env bash - -# Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoWorstTrace.sh) -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoWorstTrace.sh) - -# Trap interrupts and exit instead of continuing the loop -trap "echo Exited!; exit;" SIGINT SIGTERM - -footer() { - BLUE="\033[34m"; NC='\033[0m' - printf "%-37s\n" "-" | sed 's/\s/-/g' - printf "%b\n" " Supported by: ${BLUE}https://vps.dance${NC}" - printf "%-37s\n" "-" | sed 's/\s/-/g' -} - -# install worsttrace -if [ ! -f "/usr/bin/worsttrace" ]; then - bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) wtrace -p -fi - -## start to use besttrace - -next() { - printf "%-70s\n" "-" | sed 's/\s/-/g' -} - -clear -next - -ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 202.112.14.151) -ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 成都教育网) -# ip_len=${#ip_list[@]} - -for i in {0..7} -do - echo ${ip_addr[$i]} - # currently doesn't support TCP - worsttrace ${ip_list[$i]} | sed ':a;N;s/.*WorstTrace.*\n//g;ta; s/^[[:space:]]*//;s/[[:space:]]*$//; /^$/d' - next -done -footer -# worsttrace 202.112.14.151 | sed ':a;N;s/.*WorstTrace.*\n//g;ta' | sed 's/^[[:space:]]*//;s/[[:space:]]*$//' | sed '/^$/d' - From f48205fbf95792866e5c3c61f9381abe1bee96ec Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 14:18:47 +0800 Subject: [PATCH 095/165] Update README.md --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 8dab96a..69d22f8 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,7 @@ bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/paste.sh) ``` bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoBestTrace.sh) ``` -- autoWorstTrace -``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoWorstTrace.sh) -``` + update cache: From 59323b80f75bd7ced33d0b563dccf356b6f77dcb Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 16:05:12 +0800 Subject: [PATCH 096/165] Update toolbox.sh --- toolbox.sh | 79 +++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index a07b036..1323559 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -14,7 +14,6 @@ GREEN='\033[0;32m' YELLOW='\033[0;33m' BLUE="\033[34m" PURPLE="\033[35m" -SKYBLUE="\033[36m" BOLD="\033[1m" NC='\033[0m' @@ -26,22 +25,29 @@ debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) check_root() { if [[ "$USER" != 'root' ]]; then # [[ "$EUID" -ne 0 ]] - error "Please run this script as root!"; exit 1; + danger "Please run this script as root!"; exit 1; # if [[ "$debug" != true ]]; then exit 1; fi fi } next() { printf "%-37s\n" "-" | sed 's/\s/-/g' } -error() { - printf "${RED}[x] %s${NC}\n" "$@" +success() { + printf "${GREEN}%s${NC} ${@:2}\n" "$1" } info() { - printf "${SKYBLUE}%s${NC}\n" "$@" + printf "${BLUE}%s${NC} ${@:2}\n" "$1" +} +danger() { + printf "${RED}[x] %s${NC}\n" "$@" } warn() { printf "${YELLOW}%s${NC}\n" "$@" } +nc() { + printf "${NC}%s${NC}\n" "$@" # No Color +} + # if (ver_lte 3 3.0); then echo 3; else echo 2; fi # ver_lte 2.5.7 3 && echo "yes" || echo "no" ver_lte() { # <= [ "$(printf '%s\n' "$@" | sort -V | head -n 1)" = "$1" ] && return 0 || return 1 @@ -144,40 +150,40 @@ reinstall() { menu() { header - echo -e "${BLUE}请选择要使用的功能${NC}" - info "1. [推荐] 配置SSH Public Key (SSH免密登录)" - info "2. [推荐] 终端优化 (颜色美化/上下键查找历史)" - info "3. [推荐] 安装并开启 BBR" - info "4. [推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" - info "5. [推荐] 系统优化 (TCP网络优化/资源限制优化)" - info "11. 安装 shadowsocks" - info "12. 安装 snell" - info "13. 安装 realm (端口转发工具)" - info "14. 安装 gost (隧道/端口转发工具)" - info "15. 安装 nali (IP查询工具)" - # info "16. 安装 wtrace (路由追踪工具 WorstTrace)" - info "17. 安装 ddns-go (DDNS工具)" - # info "18. 安装 warp" - # info "19. 安装 wireguard" - info "21. 检测 VPS流媒体解锁 (RegionRestrictionCheck)" - info "22. 检测 VPS信息/IO/到国内网速 (SuperBench)" - info "23. 检测 VPS信息/IO/到国际网速 (Bench.sh)" - info "24. 性能测试 (YABS)" - # info "25. 检测 到国内网速(电信/移动/联通) (Superspeed)" - # info "25. 检测 VPS信息/IO/路由 (LemonBench)" - info "25. 检测 回程路由 (BestTrace)" - # info "26. 检测 回程路由 (WorstTrace)" - # info "27. 检测 回程路由 (traceroute + nali)" - # info "29. 性能测试 (UnixBench)" - # info "31. DD重装Linux系统" + info "请选择要使用的功能" + success "1." "[推荐] 配置SSH Public Key (SSH免密登录)" + success "2." "[推荐] 终端优化 (颜色美化/上下键查找历史)" + success "3." "[推荐] 安装并开启 BBR" + success "4." "[推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" + success "5." "[推荐] 系统优化 (TCP网络优化/资源限制优化)" + success "11." "安装 shadowsocks" + success "12." "安装 snell" + success "13." "安装 realm (端口转发工具)" + success "14." "安装 gost (隧道/端口转发工具)" + success "15." "安装 nali (IP查询工具)" + success "16." "安装 ddns-go (DDNS工具)" + # success "17." "安装 warp" + # success "18." "安装 wireguard" + # success "19." "安装 wtrace (路由追踪工具 WorstTrace)" + success "21." "检测 VPS流媒体解锁 (RegionRestrictionCheck)" + success "22." "检测 VPS信息/IO/到国内网速 (SuperBench)" + success "23." "检测 VPS信息/IO/到国际网速 (Bench.sh)" + success "24." "性能测试 (YABS)" + success "25." "检测 回程路由 (BestTrace)" + # success "26." "检测 回程路由 (WorstTrace)" + # success "27." "检测 回程路由 (traceroute + nali)" + # success "25." "检测 到国内网速(电信/移动/联通) (Superspeed)" + # success "25." "检测 VPS信息/IO/路由 (LemonBench)" + # success "29." "性能测试 (UnixBench)" + # success "31." "DD重装Linux系统" while :; do read -p "输入数字以选择:" num - [[ $num =~ ^[0-9]+$ ]] || { error "请输入正确的数字"; continue; } + [[ $num =~ ^[0-9]+$ ]] || { danger "请输入正确的数字"; continue; } break # if ((num >= 1 && num <= 5)); then # break # else - # error "请输入正确的数字"; + # danger "请输入正确的数字"; # fi done } @@ -195,9 +201,10 @@ main() { elif [[ "$num" == "13" ]]; then install_tool "realm" elif [[ "$num" == "14" ]]; then install_tool "gost" elif [[ "$num" == "15" ]]; then install_tool "nali" - # elif [[ "$num" == "16" ]]; then install_tool "wtrace" - elif [[ "$num" == "17" ]]; then install_tool "ddns-go" - # elif [[ "$num" == "19" ]]; then install_wireguard + elif [[ "$num" == "16" ]]; then install_tool "ddns-go" + # elif [[ "$num" == "17" ]]; then install_wrap + # elif [[ "$num" == "18" ]]; then install_wireguard + # elif [[ "$num" == "19" ]]; then install_tool "wtrace" elif [[ "$num" == "21" ]]; then unlock_test elif [[ "$num" == "22" ]]; then super_bench elif [[ "$num" == "23" ]]; then bench From ad3e31d6532f3c308f477b941570b91b8a71dea7 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 16:24:13 +0800 Subject: [PATCH 097/165] Update toolbox.sh --- toolbox.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index 1323559..fdfbece 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -135,12 +135,6 @@ yabs() { besttrace() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoBestTrace.sh) } -worsttrace() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoWorstTrace.sh) -} -nalitrace() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoNaliTrace.sh) -} unix_bench() { bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/unixbench.sh) } @@ -170,8 +164,6 @@ menu() { success "23." "检测 VPS信息/IO/到国际网速 (Bench.sh)" success "24." "性能测试 (YABS)" success "25." "检测 回程路由 (BestTrace)" - # success "26." "检测 回程路由 (WorstTrace)" - # success "27." "检测 回程路由 (traceroute + nali)" # success "25." "检测 到国内网速(电信/移动/联通) (Superspeed)" # success "25." "检测 VPS信息/IO/路由 (LemonBench)" # success "29." "性能测试 (UnixBench)" @@ -210,8 +202,6 @@ main() { elif [[ "$num" == "23" ]]; then bench elif [[ "$num" == "24" ]]; then yabs elif [[ "$num" == "25" ]]; then besttrace - # elif [[ "$num" == "26" ]]; then worsttrace - # elif [[ "$num" == "27" ]]; then nalitrace # elif [[ "$num" == "29" ]]; then unix_bench # elif [[ "$num" == "31" ]]; then reinstall else exit From 42e7a30a26900faf0e7325368431893d4661fa1a Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 21:53:36 +0800 Subject: [PATCH 098/165] Update ssh.sh --- ssh.sh | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 82 insertions(+), 13 deletions(-) diff --git a/ssh.sh b/ssh.sh index ab9800c..cba298f 100644 --- a/ssh.sh +++ b/ssh.sh @@ -1,20 +1,35 @@ #!/usr/bin/env bash -# Set up SSH public key authentication -# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) - -# mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys - +# Usage: +# # bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) [key|port] -for home in /root /home/*; # do { if [[ ! -e "$home" ]]; then continue; fi; echo $home; }; done -do - if [[ ! -e "$home" ]]; then continue; fi; - mkdir -p "${home}/.ssh"; chmod 700 "${home}/.ssh"; - if [[ ! -f "${home}/.ssh/authorized_keys" ]]; then echo '' >> ~/.ssh/authorized_keys; fi - chmod 600 "${home}/.ssh/authorized_keys" -done +# DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) +# Colors +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +BLUE="\033[34m" +PURPLE="\033[35m" +BOLD="\033[1m" +NC='\033[0m' +name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) +info() { + printf "${BLUE}%s${NC} ${@:2}\n" "$1" +} +warn() { + printf "${YELLOW}%s${NC}\n" "$@" +} -main () { +# Set up SSH public key authentication +# mkdir -m 700 ~/.ssh; chmod 600 ~/.ssh/authorized_keys >> ~/.ssh/authorized_keys +ssh_key () { + for home in /root /home/*; # do { if [[ ! -e "$home" ]]; then continue; fi; echo $home; }; done + do + if [[ ! -e "$home" ]]; then continue; fi; + mkdir -p "${home}/.ssh"; chmod 700 "${home}/.ssh"; + if [[ ! -f "${home}/.ssh/authorized_keys" ]]; then echo '' >> ~/.ssh/authorized_keys; fi + chmod 600 "${home}/.ssh/authorized_keys" + done echo "Paste your SSH public key (~/.ssh/id_rsa.pub):" IFS= read -d '' -n 1 text while IFS= read -d '' -n 1 -t 2 c @@ -40,4 +55,58 @@ main () { sed -i -nr 'G;/^([^\n]+\n)([^\n]+\n)*\1/!{P;h}' "${home}/.ssh/authorized_keys" done } + +iptables_persistence() { # Debian/Ubuntu +cat > /etc/network/if-pre-up.d/iptables << EOF +#!/bin/sh +iptables-restore < /etc/iptables.rules +exit 0 +EOF +chmod +x /etc/network/if-pre-up.d/iptables +# iptables-save > /etc/iptables.rules # save current iptables rules +} + +ssh_port() { + # local port=$(( ${RANDOM:0:4} + 10000 )) # random 10000-20000 + # local port=$(shuf -i 10001-60000 -n 1); # echo $port + local port='35653'; + read -p "Please enter the SSH port [default=$port]: " _p && [ -n "$_p" ] && SSH_PORT=$_p || SSH_PORT=$port; + sed -i "s/#\?.*\Port\s*.*$/Port $SSH_PORT/" /etc/ssh/sshd_config; systemctl restart sshd; + # echo "Port $SSH_PORT" >> /etc/ssh/sshd_config; systemctl restart sshd; + info "[*] /etc/ssh/sshd_config has been modified." + if [ -e /etc/sysconfig/firewalld ]; then # CentOS + if [[ $( firewall-cmd --zone=public --query-port=${SSH_PORT}/tcp ) == 'no' ]]; then + firewall-cmd --permanent --zone=public --add-port=${SSH_PORT}/tcp + firewall-cmd --reload + fi + elif [ -e /etc/ufw/before.rules ]; then # Debian/Ubuntu + ufw allow $SSH_PORT/tcp + ufw reload + elif [ -e /etc/sysconfig/iptables ]; then # CentOS + iptables -I INPUT -p tcp --dport $SSH_PORT -j ACCEPT + service iptables save + service iptables restart + elif [ -e /etc/iptables.rules ]; then # Debian/Ubuntu + iptables -I INPUT -p tcp --dport $SSH_PORT -j ACCEPT + iptables-save > /etc/iptables.rules + fi + local ip=`curl -Ls ip.sb`; + warn "[*] 请勿退出当前ssh, 新开终端测试 \"ssh root@$ip -p $SSH_PORT\" 是否能登录" + warn "[*] 如不能登录, 重新执行本命令, 改回默认的 22 端口" +} +main() { + case "$name" in + key) + ssh_key + ;; + port) + ssh_port + ;; + *) + ssh_key + # warn "Please specify name (key|port)"; + exit + ;; + esac +} main From cd67d8f6cf52a280922f96ab3306284fd87f9e1f Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 21:57:50 +0800 Subject: [PATCH 099/165] Update toolbox.sh --- toolbox.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/toolbox.sh b/toolbox.sh index fdfbece..0159fba 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -102,6 +102,9 @@ bashrc() { tuning() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tuning.sh) } +ssh_port() { + bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) port +} install_tool() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) "$@" } @@ -150,6 +153,7 @@ menu() { success "3." "[推荐] 安装并开启 BBR" success "4." "[推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" success "5." "[推荐] 系统优化 (TCP网络优化/资源限制优化)" + success "6." "[推荐] 修改默认SSH端口 (防止被攻击)" success "11." "安装 shadowsocks" success "12." "安装 snell" success "13." "安装 realm (端口转发工具)" From 82ff4c7c49ce5da407b5685613390fe1b764cec5 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 21:59:52 +0800 Subject: [PATCH 100/165] Update toolbox.sh --- toolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/toolbox.sh b/toolbox.sh index 0159fba..ff76aa4 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -192,6 +192,7 @@ main() { elif [[ "$num" == "3" ]]; then install_bbr elif [[ "$num" == "4" ]]; then install_deps elif [[ "$num" == "5" ]]; then tuning + elif [[ "$num" == "6" ]]; then ssh_port elif [[ "$num" == "11" ]]; then install_tool "ss" elif [[ "$num" == "12" ]]; then install_tool "snell" elif [[ "$num" == "13" ]]; then install_tool "realm" From 0a075ace8614f63822863ad9acd015182f20e89d Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 22:37:39 +0800 Subject: [PATCH 101/165] Update superBench.sh --- superBench.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superBench.sh b/superBench.sh index a74a615..2a5f1dc 100644 --- a/superBench.sh +++ b/superBench.sh @@ -32,7 +32,7 @@ main() { | sed "s/26678' 'Guangzhou 5G/13704' 'Nanjing/Ig" \ | sed "s/17184' 'Tianjin/26404' 'Hefei/Ig" \ | sed "/.*26850' 'Wuxi/Id" \ - | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ + # | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ | sed "/.*28491' 'Changsha/Id" \ | sed '/^[ \t]*speed_fast_com$/d' ) From 3be360b2a270615b893f4cd83f34d5d933b4412e Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 22:38:41 +0800 Subject: [PATCH 102/165] Update superBench.sh --- superBench.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/superBench.sh b/superBench.sh index 2a5f1dc..f6ce311 100644 --- a/superBench.sh +++ b/superBench.sh @@ -31,8 +31,7 @@ main() { | sed "s/27154' 'TianJin/4870' 'Changsha/Ig" \ | sed "s/26678' 'Guangzhou 5G/13704' 'Nanjing/Ig" \ | sed "s/17184' 'Tianjin/26404' 'Hefei/Ig" \ - | sed "/.*26850' 'Wuxi/Id" \ - # | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ + | sed "/.*26850' 'Wuxi/Id" \ # | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ | sed "/.*28491' 'Changsha/Id" \ | sed '/^[ \t]*speed_fast_com$/d' ) From 40b0802eb8f34e05e086d27a8db2aa60612a0eb4 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 3 Apr 2022 22:41:25 +0800 Subject: [PATCH 103/165] Update superBench.sh --- superBench.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/superBench.sh b/superBench.sh index f6ce311..15c4409 100644 --- a/superBench.sh +++ b/superBench.sh @@ -31,9 +31,10 @@ main() { | sed "s/27154' 'TianJin/4870' 'Changsha/Ig" \ | sed "s/26678' 'Guangzhou 5G/13704' 'Nanjing/Ig" \ | sed "s/17184' 'Tianjin/26404' 'Hefei/Ig" \ - | sed "/.*26850' 'Wuxi/Id" \ # | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" \ + | sed "/.*26850' 'Wuxi/Id" \ | sed "/.*28491' 'Changsha/Id" \ | sed '/^[ \t]*speed_fast_com$/d' + # | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" ) } main From 85087f3de219dab6e3f8cb7c3a4bcf7075ca7fda Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 4 Apr 2022 09:17:26 +0800 Subject: [PATCH 104/165] Update superBench.sh --- superBench.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/superBench.sh b/superBench.sh index 15c4409..e1c08ee 100644 --- a/superBench.sh +++ b/superBench.sh @@ -30,10 +30,10 @@ main() { | sed "s/27377' 'Beijing/34115' 'TianJin/Ig" \ | sed "s/27154' 'TianJin/4870' 'Changsha/Ig" \ | sed "s/26678' 'Guangzhou 5G/13704' 'Nanjing/Ig" \ - | sed "s/17184' 'Tianjin/26404' 'Hefei/Ig" \ - | sed "/.*26850' 'Wuxi/Id" \ + | sed "/17184' 'Tianjin/Id" \ | sed "/.*28491' 'Changsha/Id" \ | sed '/^[ \t]*speed_fast_com$/d' + # | sed "/.*26850' 'Wuxi/Id" # | sed "s/27249' 'Nanjing 5G/15863' 'Nanning/Ig" ) } From 98e5ca7144a80e4dc69296b273a6c183485a96eb Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 4 Apr 2022 09:48:32 +0800 Subject: [PATCH 105/165] Update toolbox.sh --- toolbox.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolbox.sh b/toolbox.sh index ff76aa4..ea4e841 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -64,7 +64,7 @@ header() { next printf "%s\n" "[VPS ToolBox] 目前支持: Ubuntu/Debian, Centos/Redhat" printf "%b\n" "${GREEN}VPS/IPLC测评:${NC} ${YELLOW}https://vps.dance/${NC}" - printf "%b\n" "${GREEN}Telegram频道:${NC} ${YELLOW}https://https://t.me/vpsdance${NC}" + printf "%b\n" "${GREEN}Telegram频道:${NC} ${YELLOW}https://t.me/vpsdance${NC}" next } footer() { From 33390ccfc2d488bf73ee3a100f50d376bb3fcb27 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 4 Apr 2022 19:47:44 +0800 Subject: [PATCH 106/165] Create ipt.js --- files/ipt.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 files/ipt.js diff --git a/files/ipt.js b/files/ipt.js new file mode 100644 index 0000000..80373fc --- /dev/null +++ b/files/ipt.js @@ -0,0 +1,21 @@ +(function(){ + const from = $('#note :selected').text(); + const ip = $('#ip').val(); + const ipMask = ip.split('.').slice(0, 2).concat('*', '*').join('.'); + const ipReg = new RegExp(`\\b${ip.split('.').join('\\.')}\\b`, 'g'); + let html = `traceroute to ${ip}, 30 hops max, 32 byte packets\n`; + + $('#trace tbody tr').map((_, line) => { + let [ttl, ip, host, location, as, time] = $(line).find('td').toArray().map(o => o.innerText.split('\n')); + const valIndex = ip.findIndex(o => !!o && o !== '*'); + const val = (arr) => arr[valIndex] || arr[0]; + [ttl, host, ip, time, as, location] = [val(ttl), val(host), val(ip), val(time), val(as), val(location)]; + ip = (ip === host ? '' : ` (${ip})`); + time = time.split(' / ')[1] || time; + const item = ip === '*' ? `${ttl} *` : `${ttl} ${host}${ip} ${time} ms ${as} ${location}`; + html+= `${item}\n`; + }); + html = html.replace(ipReg, ipMask); + console.warn(html); + copy(html); +}()); From 6f10fdc5673642cc57bdfbb62946714f884c0c45 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 4 Apr 2022 21:18:49 +0800 Subject: [PATCH 107/165] Update ipt.js --- files/ipt.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/ipt.js b/files/ipt.js index 80373fc..f0a1c82 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -1,4 +1,5 @@ -(function(){ +// (function(){ +window.tr = () => { const from = $('#note :selected').text(); const ip = $('#ip').val(); const ipMask = ip.split('.').slice(0, 2).concat('*', '*').join('.'); @@ -18,4 +19,5 @@ html = html.replace(ipReg, ipMask); console.warn(html); copy(html); -}()); +} +// }()); From 553b12b7ec70194c0e03559e3c9c0136f9e35aa5 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 4 Apr 2022 21:20:25 +0800 Subject: [PATCH 108/165] Update ipt.js --- files/ipt.js | 1 + 1 file changed, 1 insertion(+) diff --git a/files/ipt.js b/files/ipt.js index f0a1c82..5cb818b 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -1,4 +1,5 @@ // (function(){ +// https://purge.jsdelivr.net/gh/VPSDance/scripts@main/files/ipt.js window.tr = () => { const from = $('#note :selected').text(); const ip = $('#ip').val(); From 9c3136d2813798dff909aaa1e3da5c8d9a00e451 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 4 Apr 2022 21:24:42 +0800 Subject: [PATCH 109/165] Update ipt.js --- files/ipt.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/ipt.js b/files/ipt.js index 5cb818b..e6ee0de 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -14,11 +14,12 @@ window.tr = () => { [ttl, host, ip, time, as, location] = [val(ttl), val(host), val(ip), val(time), val(as), val(location)]; ip = (ip === host ? '' : ` (${ip})`); time = time.split(' / ')[1] || time; - const item = ip === '*' ? `${ttl} *` : `${ttl} ${host}${ip} ${time} ms ${as} ${location}`; + const item = host === '*' ? `${ttl} *` : `${ttl} ${host}${ip} ${time} ms ${as} ${location}`; html+= `${item}\n`; }); html = html.replace(ipReg, ipMask); console.warn(html); copy(html); } +tr(); // }()); From e27917e5ac04591505330bc239471eb7626c6558 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 5 Apr 2022 19:45:48 +0800 Subject: [PATCH 110/165] Update ipt.js --- files/ipt.js | 89 +++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 84 insertions(+), 5 deletions(-) diff --git a/files/ipt.js b/files/ipt.js index e6ee0de..0e7907a 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -1,7 +1,18 @@ // (function(){ // https://purge.jsdelivr.net/gh/VPSDance/scripts@main/files/ipt.js -window.tr = () => { - const from = $('#note :selected').text(); + +// cp(text) +window.__cp = (text) => { + const dummy = document.createElement('textarea'); + document.body.appendChild(dummy); + dummy.value = text; + dummy.select(); + document.execCommand('copy'); + document.body.removeChild(dummy); +} + +window.__tr = () => { + // const name = $('#note :selected').text(); const ip = $('#ip').val(); const ipMask = ip.split('.').slice(0, 2).concat('*', '*').join('.'); const ipReg = new RegExp(`\\b${ip.split('.').join('\\.')}\\b`, 'g'); @@ -18,8 +29,76 @@ window.tr = () => { html+= `${item}\n`; }); html = html.replace(ipReg, ipMask); - console.warn(html); - copy(html); + // console.warn(html); + // __cp(html); + return html; +} +// tr(); + +__IDS__ = [ + {id: '502', name: '广东电信'}, + {id: '764', name: '江苏电信'}, + // {id: '896', name: 'Shanghai CT'}, + {id: '11', name: 'Chongqing CT'}, + + {id: '503', name: '广东联通'}, + {id: '765', name: '江苏联通'}, + // {id: '1078', name: '上海联通'}, + // {id: '1240', name: '上海联通9929'}, + {id: '12', name: '重庆联通'}, + // {id: '662', name: '湖南联通'}, + + {id: '424', name: '广东移动'}, + {id: '766', name: '江苏移动'}, + {id: '924', name: '重庆移动'}, + // {id: '946', name: '重庆移动'}, +]; + +window.__process = (item) => new Promise((resolve, reject) => { + const cb = (text) => { + clearInterval(item._t); + resolve({ ...item, text }); + } + $('select[name="id"]').val(item.id); + // return setTimeout(() => cb('test ' + item.name), 2 * 1000); + $('#btn').trigger('click'); + const l = $('#load'); + setTimeout(() => cb(''), 60 * 1000); // timeout + item._t = setInterval(() => { + const done = l.is(':hidden'); + if (!done) return; + cb($('#trace tbody tr').length > 1 ? __tr() : ''); + }, 1000); +}); +window.__queue = (items) => { + if (!$('#ip').val()) return Promise.reject('no ip'); + let arr = []; + const run = async () => { + for(let o of items) { + let v = await __process(o); + arr.push(v); + } + return arr; + } + return run(); +}; +// __IDS__ = [ {id: '503', name: '广东联通'}, {id: '424', name: '广东移动'}, ]; +window.__fetch = () => __queue(__IDS__).then(arr => { + // console.warn(arr); + const r = arr.filter(o => !!o.text) + .map(({ name, text }) => `${name}\n${text}`).join(`\n${new Array(70).join('-')}\n`); + console.warn(r); + window.__d__ = r; + __cp(window.__d__); +}); +window.__init = () => { + const form = $('#ps'); + form.next('button').remove(); + form.after(''); + $('select[name="t"]').val('T'); + // $('select[name="id"]').val(); } -tr(); +__init(); + + // }()); From f3a8817c639f3a502c8410d3a25fc17dee046187 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 5 Apr 2022 20:02:32 +0800 Subject: [PATCH 111/165] Update ipt.js --- files/ipt.js | 59 +++++++++++++++++++++++++++------------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/files/ipt.js b/files/ipt.js index 0e7907a..1162d19 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -35,25 +35,6 @@ window.__tr = () => { } // tr(); -__IDS__ = [ - {id: '502', name: '广东电信'}, - {id: '764', name: '江苏电信'}, - // {id: '896', name: 'Shanghai CT'}, - {id: '11', name: 'Chongqing CT'}, - - {id: '503', name: '广东联通'}, - {id: '765', name: '江苏联通'}, - // {id: '1078', name: '上海联通'}, - // {id: '1240', name: '上海联通9929'}, - {id: '12', name: '重庆联通'}, - // {id: '662', name: '湖南联通'}, - - {id: '424', name: '广东移动'}, - {id: '766', name: '江苏移动'}, - {id: '924', name: '重庆移动'}, - // {id: '946', name: '重庆移动'}, -]; - window.__process = (item) => new Promise((resolve, reject) => { const cb = (text) => { clearInterval(item._t); @@ -61,7 +42,10 @@ window.__process = (item) => new Promise((resolve, reject) => { } $('select[name="id"]').val(item.id); // return setTimeout(() => cb('test ' + item.name), 2 * 1000); - $('#btn').trigger('click'); + try { + $('#btn').trigger('click'); + } catch (error) { console.warn(error); } + $('#ps').submit(); const l = $('#load'); setTimeout(() => cb(''), 60 * 1000); // timeout item._t = setInterval(() => { @@ -82,6 +66,33 @@ window.__queue = (items) => { } return run(); }; +window.__init = () => { + const form = $('#ps'); + form.next('button').remove(); + form.after(''); + $('select[name="t"]').val('T'); + // $('select[name="id"]').val(); +} +__init(); + +__IDS__ = [ + {id: '502', name: '广东电信'}, + {id: '764', name: '江苏电信'}, + // {id: '896', name: 'Shanghai CT'}, + {id: '11', name: 'Chongqing CT'}, + + {id: '503', name: '广东联通'}, + {id: '765', name: '江苏联通'}, + // {id: '1078', name: '上海联通'}, + // {id: '1240', name: '上海联通9929'}, + {id: '12', name: '重庆联通'}, + // {id: '662', name: '湖南联通'}, + + {id: '424', name: '广东移动'}, + {id: '766', name: '江苏移动'}, + {id: '924', name: '重庆移动'}, + // {id: '946', name: '重庆移动'}, +]; // __IDS__ = [ {id: '503', name: '广东联通'}, {id: '424', name: '广东移动'}, ]; window.__fetch = () => __queue(__IDS__).then(arr => { // console.warn(arr); @@ -91,14 +102,6 @@ window.__fetch = () => __queue(__IDS__).then(arr => { window.__d__ = r; __cp(window.__d__); }); -window.__init = () => { - const form = $('#ps'); - form.next('button').remove(); - form.after(''); - $('select[name="t"]').val('T'); - // $('select[name="id"]').val(); -} -__init(); // }()); From d7d6ed1c8d19af9b3b85beb2aa17535b6a57c92c Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 5 Apr 2022 20:07:39 +0800 Subject: [PATCH 112/165] Update ipt.js --- files/ipt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/ipt.js b/files/ipt.js index 1162d19..00b1252 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -100,7 +100,7 @@ window.__fetch = () => __queue(__IDS__).then(arr => { .map(({ name, text }) => `${name}\n${text}`).join(`\n${new Array(70).join('-')}\n`); console.warn(r); window.__d__ = r; - __cp(window.__d__); + $('#map_view').before(''); }); From ed91deb33c299f32ad7752374d3c0797653606e5 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 6 Apr 2022 10:57:32 +0800 Subject: [PATCH 113/165] Create ipt.js --- files/ipt.js | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/files/ipt.js b/files/ipt.js index 00b1252..52d69b4 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -13,23 +13,18 @@ window.__cp = (text) => { window.__tr = () => { // const name = $('#note :selected').text(); - const ip = $('#ip').val(); - const ipMask = ip.split('.').slice(0, 2).concat('*', '*').join('.'); - const ipReg = new RegExp(`\\b${ip.split('.').join('\\.')}\\b`, 'g'); - let html = `traceroute to ${ip}, 30 hops max, 32 byte packets\n`; - - $('#trace tbody tr').map((_, line) => { + let html = ``; + const lines = $('#trace tbody tr').map((_, line) => { let [ttl, ip, host, location, as, time] = $(line).find('td').toArray().map(o => o.innerText.split('\n')); - const valIndex = ip.findIndex(o => !!o && o !== '*'); + const valIndex = ip.findLastIndex(o => !!o && o !== '*'); const val = (arr) => arr[valIndex] || arr[0]; [ttl, host, ip, time, as, location] = [val(ttl), val(host), val(ip), val(time), val(as), val(location)]; ip = (ip === host ? '' : ` (${ip})`); time = time.split(' / ')[1] || time; - const item = host === '*' ? `${ttl} *` : `${ttl} ${host}${ip} ${time} ms ${as} ${location}`; - html+= `${item}\n`; + return host === '*' ? `${ttl} *` : `${ttl} ${host}${ip} ${time}ms ${as} ${location}`; }); - html = html.replace(ipReg, ipMask); - // console.warn(html); + html = lines.toArray().join('\n'); + console.warn(html); // __cp(html); return html; } @@ -37,7 +32,8 @@ window.__tr = () => { window.__process = (item) => new Promise((resolve, reject) => { const cb = (text) => { - clearInterval(item._t); + clearTimeout(item._t); + clearInterval(item._i); resolve({ ...item, text }); } $('select[name="id"]').val(item.id); @@ -45,10 +41,12 @@ window.__process = (item) => new Promise((resolve, reject) => { try { $('#btn').trigger('click'); } catch (error) { console.warn(error); } - $('#ps').submit(); + try { + $('#ps').submit(); + } catch (error) { console.warn(error); } const l = $('#load'); - setTimeout(() => cb(''), 60 * 1000); // timeout - item._t = setInterval(() => { + item._t = setTimeout(() => cb(''), 1000 * 60 * 2); // timeout + item._i = setInterval(() => { const done = l.is(':hidden'); if (!done) return; cb($('#trace tbody tr').length > 1 ? __tr() : ''); @@ -79,7 +77,7 @@ __IDS__ = [ {id: '502', name: '广东电信'}, {id: '764', name: '江苏电信'}, // {id: '896', name: 'Shanghai CT'}, - {id: '11', name: 'Chongqing CT'}, + {id: '11', name: '重庆电信'}, {id: '503', name: '广东联通'}, {id: '765', name: '江苏联通'}, @@ -96,10 +94,14 @@ __IDS__ = [ // __IDS__ = [ {id: '503', name: '广东联通'}, {id: '424', name: '广东移动'}, ]; window.__fetch = () => __queue(__IDS__).then(arr => { // console.warn(arr); - const r = arr.filter(o => !!o.text) - .map(({ name, text }) => `${name}\n${text}`).join(`\n${new Array(70).join('-')}\n`); - console.warn(r); - window.__d__ = r; + const ip = $('#ip').val(); + const ipMask = ip.split('.').slice(0, 2).concat('*', '*').join('.'); + const ipReg = new RegExp(`\\b${ip.split('.').join('\\.')}\\b`, 'g'); + const data = [{text: `traceroute to ${ip}, 30 hops max, 32 byte packets` }, ...arr].filter(o => !!o.text) + .map(({ name, text }) => [name, text].join('\n')).join(`\n${new Array(50).join('-')}\n`) + .replace(ipReg, ipMask); + console.warn(data); + window.__d__ = data; $('#map_view').before(''); }); From c95fd82d346b152936e8218708df28b8fcf3e95e Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 8 Apr 2022 13:58:55 +0800 Subject: [PATCH 114/165] Update ipt.js --- files/ipt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/ipt.js b/files/ipt.js index 52d69b4..c047a49 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -98,7 +98,7 @@ window.__fetch = () => __queue(__IDS__).then(arr => { const ipMask = ip.split('.').slice(0, 2).concat('*', '*').join('.'); const ipReg = new RegExp(`\\b${ip.split('.').join('\\.')}\\b`, 'g'); const data = [{text: `traceroute to ${ip}, 30 hops max, 32 byte packets` }, ...arr].filter(o => !!o.text) - .map(({ name, text }) => [name, text].join('\n')).join(`\n${new Array(50).join('-')}\n`) + .map(({ name, text }) => [name, text].filter(o => !!o).join('\n')).join(`\n${new Array(50).join('-')}\n`) .replace(ipReg, ipMask); console.warn(data); window.__d__ = data; From 44a0002adaaea623925c2b927aa4ed53191306d8 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 11 Apr 2022 16:17:47 +0800 Subject: [PATCH 115/165] Create tools.sh --- tools.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/tools.sh b/tools.sh index 3f9e9f3..849ac6d 100644 --- a/tools.sh +++ b/tools.sh @@ -261,18 +261,15 @@ gen_config () { conf="[snell-server]\nlisten = 0.0.0.0:$port\npsk = $pass\nobfs = tls" ;; realm) - conf=('{' - ' "listening_addresses": ["0.0.0.0"],' - ' "listening_ports": ["10001-10002"],' - ' "remote_addresses": [' - ' "1.1.1.1",' - ' "1.1.1.2"' - ' ],' - ' "remote_ports": [' - ' "80",' - ' "443"' - ' ]' - '}') + conf=('' + '[[endpoints]]' + 'listen = "0.0.0.0:10001"' + 'remote = "test.com:80"' + '' + '[[endpoints]]' + 'listen = "0.0.0.0:10002"' + 'remote = "1.1.1.1:443"' + '') conf="$(printf "%s\n" "${conf[@]}")" ;; gost) From d6997a9cda6db5d632fc5e13a3a6e08339c9662a Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 12 Apr 2022 10:53:13 +0800 Subject: [PATCH 116/165] Update tools.sh --- tools.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools.sh b/tools.sh index 849ac6d..c1a38a5 100644 --- a/tools.sh +++ b/tools.sh @@ -56,7 +56,7 @@ init () { ;; realm) app="realm" - config="/root/realm.json" + config="/root/realm.toml" # repo="zhboner/realm" # match="" repo="zephyrchien/realm" @@ -212,7 +212,7 @@ gen_service () { service='[Unit]\nDescription=Snell Service\nAfter=network.target\n[Service]\nType=simple\nLimitNOFILE=32768\nRestart=on-failure\nExecStart=/usr/bin/snell-server -c /root/snell.conf\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=snell-server\n[Install]\nWantedBy=multi-user.target\n' ;; realm) - service='[Unit]\nDescription=realm\nAfter=network-online.target\nWants=network-online.target systemd-networkd-wait-online.service\n[Service]\nType=simple\nUser=root\nRestart=on-failure\nRestartSec=5s\nExecStart=/usr/bin/realm -c /root/realm.json\n[Install]\nWantedBy=multi-user.target' + service='[Unit]\nDescription=realm\nAfter=network-online.target\nWants=network-online.target systemd-networkd-wait-online.service\n[Service]\nType=simple\nUser=root\nRestart=on-failure\nRestartSec=5s\nExecStart=/usr/bin/realm -c /root/realm.toml\n[Install]\nWantedBy=multi-user.target' ;; gost) service='[Unit]\nDescription=gost\nAfter=network-online.target\nWants=network-online.target systemd-networkd-wait-online.service\n[Service]\nType=simple\nUser=root\nRestart=on-failure\nRestartSec=5s\nExecStart=/usr/bin/gost -C /root/gost.json\n[Install]\nWantedBy=multi-user.target' @@ -270,6 +270,7 @@ gen_config () { 'listen = "0.0.0.0:10002"' 'remote = "1.1.1.1:443"' '') + conf="$(printf "%s\n" "${conf[@]}")" ;; gost) @@ -303,6 +304,9 @@ gen_config () { echo -e "\n[Create config file] \"$config\", for example:" echo -e "$conf" fi + if [[ -f "/root/realm.json" && "$app" == "realm" ]]; then + printf "\n%b\n" "${YELLOW}Convert Realm1 to Realm2 config${NC}: realm convert realm.json > realm.toml"; + fi } finally () { # echo "Port: $port" From 085aa1d6fce140978a82bbe07a54f65d81644423 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 20 Apr 2022 09:29:00 +0800 Subject: [PATCH 117/165] Update unlockTest.sh --- unlockTest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unlockTest.sh b/unlockTest.sh index 912a7f2..2cc229c 100644 --- a/unlockTest.sh +++ b/unlockTest.sh @@ -5,7 +5,7 @@ main() { bash <( - curl -L -s check.unlock.media \ + curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh \ | sed '/^[ \t]*echo\( -e\)\? "[-]*"\(.*\)\?$/d' \ | sed '/^[ \t]*echo\( -e\)\? "[=]*"\(.*\)\?$/d' \ | sed 's/ CheckV6().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ From 9025ddf32369b2b001ec8fdfb8b5cfcf3cd4afe3 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 20 Apr 2022 09:36:16 +0800 Subject: [PATCH 118/165] Update toolbox.sh --- toolbox.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/toolbox.sh b/toolbox.sh index ea4e841..49ce249 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -117,6 +117,7 @@ install_wireguard(){ # curl -Ls https://raw.githubusercontent.com/teddysun/across/master/wireguard.sh | bash -s -- -n } unlock_test() { + info "bash <(curl -Lso- https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)" bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/unlockTest.sh) } super_bench() { From 3f65449c9f27b20a8b8278136750929725d58036 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 20 Apr 2022 19:38:42 +0800 Subject: [PATCH 119/165] Update tuning.sh --- tuning.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuning.sh b/tuning.sh index 1f77ac7..d53f197 100644 --- a/tuning.sh +++ b/tuning.sh @@ -7,7 +7,7 @@ # https://cloud.google.com/architecture/tcp-optimization-for-network-performance-in-gcp-and-hybrid?hl=zh-cn # [LFN网络下TCP性能的优化](https://github.com/acacia233/Project-Smalltrick/wiki/) # https://github.com/ylx2016/Linux-NetSpeed/blob/master/tcp.sh -# http://sh.nekoneko.cloud/tools.sh +# bash <(curl -Lso- http://sh.nekoneko.cloud/tools.sh) pam_limits="/etc/pam.d/common-session" limits_conf="/etc/security/limits.conf" From 049f1feeeae5acf04b2ddf8b89ed3362619bd013 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 25 Apr 2022 11:24:33 +0800 Subject: [PATCH 120/165] realm --- tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools.sh b/tools.sh index c1a38a5..6c4b3b5 100644 --- a/tools.sh +++ b/tools.sh @@ -57,9 +57,9 @@ init () { realm) app="realm" config="/root/realm.toml" - # repo="zhboner/realm" + repo="zhboner/realm" + # repo="zephyrchien/realm" # match="" - repo="zephyrchien/realm" case $ARCH in aarch64) match="aarch64.*linux-gnu.*.gz" From 63d575da6c84ca5af56c98f3fafb285c7d39226f Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 25 Apr 2022 11:35:16 +0800 Subject: [PATCH 121/165] Update toolbox.sh --- toolbox.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/toolbox.sh b/toolbox.sh index 49ce249..83d85c7 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -108,6 +108,12 @@ ssh_port() { install_tool() { bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) "$@" } +install_xray() { + bash <(curl -fsSL https://github.com/XTLS/Xray-install/raw/main/install-release.sh) install + info "configuration file: /usr/local/etc/xray/config.json" + info "status: systemctl status xray" + info "restart: systemctl restart xray" +} install_wrap() { bash <(curl -fsSL https://raw.githubusercontent.com/P3TERX/warp.sh/main/warp.sh) menu } @@ -155,6 +161,7 @@ menu() { success "4." "[推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" success "5." "[推荐] 系统优化 (TCP网络优化/资源限制优化)" success "6." "[推荐] 修改默认SSH端口 (防止被攻击)" + success "10." "安装 xray" success "11." "安装 shadowsocks" success "12." "安装 snell" success "13." "安装 realm (端口转发工具)" @@ -194,6 +201,7 @@ main() { elif [[ "$num" == "4" ]]; then install_deps elif [[ "$num" == "5" ]]; then tuning elif [[ "$num" == "6" ]]; then ssh_port + elif [[ "$num" == "10" ]]; then install_xray elif [[ "$num" == "11" ]]; then install_tool "ss" elif [[ "$num" == "12" ]]; then install_tool "snell" elif [[ "$num" == "13" ]]; then install_tool "realm" From 81dd992c5e09d829ec530372850b7ee96c0dc456 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 25 Apr 2022 11:38:45 +0800 Subject: [PATCH 122/165] xray + geosite/geoip --- toolbox.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/toolbox.sh b/toolbox.sh index 83d85c7..b207a4a 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -110,6 +110,9 @@ install_tool() { } install_xray() { bash <(curl -fsSL https://github.com/XTLS/Xray-install/raw/main/install-release.sh) install + # 使用增强版的 geosite/geoip 规则 + wget -O /usr/local/share/xray/geoip.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat + wget -O /usr/local/share/xray/geosite.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat info "configuration file: /usr/local/etc/xray/config.json" info "status: systemctl status xray" info "restart: systemctl restart xray" From 9d34697ff64aa529c9daff575b865cef5cb82a45 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 11 May 2022 11:45:13 +0800 Subject: [PATCH 123/165] docs: gost --- tools.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools.sh b/tools.sh index 6c4b3b5..b8d1efc 100644 --- a/tools.sh +++ b/tools.sh @@ -278,7 +278,7 @@ gen_config () { ' "Debug": true,' ' "Retries": 0,' ' "ServeNodes": [' - ' "tcp://:24000/ipv6.itiioulet.dinghaojc.com:24000"' + ' "tcp://:10002/1.1.1.1:443"' ' ],' ' "ChainNodes": [' ' ],' From c0c3380c1d4853e26b7fc453617923c4381fb4d3 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 11 May 2022 12:56:50 +0800 Subject: [PATCH 124/165] Update autoBestTrace.sh --- autoBestTrace.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoBestTrace.sh b/autoBestTrace.sh index 07f5e38..8c76868 100644 --- a/autoBestTrace.sh +++ b/autoBestTrace.sh @@ -4,7 +4,10 @@ # https://github.com/flyzy2005/shell # besttrace -q1 -T -g cn # 探测数据包数1, TCP, CN +url="https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh" +url="https://ghproxy.com/$url" # cdn bash <( - curl -Lso- https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh \ + curl -Lso- $url \ + | sed "s/https:\/\/github.com/https:\/\/ghproxy.com\/https:\/\/github.com/Ig" \ | sed 's/ -q 1 / -q1 -g cn -T /g' ) From a5829cadff3c0b67b7e720c31f040e7ce844b520 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 11 May 2022 13:49:13 +0800 Subject: [PATCH 125/165] feat: + cdn --- toolbox.sh | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index b207a4a..12f89a1 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -20,8 +20,11 @@ NC='\033[0m' OS=$(uname -s) # Linux, FreeBSD, Darwin ARCH=$(uname -m) # x86_64, arm64, aarch64 DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) -# name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) +cnd=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) +CDN='https://raw.githubusercontent.com' +if [[ "${1}" =~ ^(fastgit)$ ]]; then CDN='https://raw.fastgit.org'; fi +echo $CDN check_root() { if [[ "$USER" != 'root' ]]; then # [[ "$EUID" -ne 0 ]] @@ -91,25 +94,25 @@ install_deps() { esac } install_bbr() { - bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/bbr.sh) + bash <(curl -Lso- $CDN/teddysun/across/master/bbr.sh) } ssh_key() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) + bash <(curl -Lso- $CDN/VPSDance/scripts/main/ssh.sh) } bashrc() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bashrc.sh) + bash <(curl -Lso- $CDN/VPSDance/scripts/main/bashrc.sh) } tuning() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tuning.sh) + bash <(curl -Lso- $CDN/VPSDance/scripts/main/tuning.sh) } ssh_port() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) port + bash <(curl -Lso- $CDN/VPSDance/scripts/main/ssh.sh) port } install_tool() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) "$@" + bash <(curl -Lso- $CDN/VPSDance/scripts/main/tools.sh) "$@" } install_xray() { - bash <(curl -fsSL https://github.com/XTLS/Xray-install/raw/main/install-release.sh) install + bash <(curl -fsSL $CDN/XTLS/Xray-install/main/install-release.sh) install # 使用增强版的 geosite/geoip 规则 wget -O /usr/local/share/xray/geoip.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat wget -O /usr/local/share/xray/geosite.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat @@ -118,25 +121,25 @@ install_xray() { info "restart: systemctl restart xray" } install_wrap() { - bash <(curl -fsSL https://raw.githubusercontent.com/P3TERX/warp.sh/main/warp.sh) menu + bash <(curl -fsSL $CDN/P3TERX/warp.sh/main/warp.sh) menu } install_wireguard(){ - curl -Ls https://raw.githubusercontent.com/teddysun/across/master/wireguard.sh | bash -s -- -r + curl -Ls $CDN/teddysun/across/master/wireguard.sh | bash -s -- -r # uninstall_wireguard - # curl -Ls https://raw.githubusercontent.com/teddysun/across/master/wireguard.sh | bash -s -- -n + # curl -Ls $CDN/teddysun/across/master/wireguard.sh | bash -s -- -n } unlock_test() { - info "bash <(curl -Lso- https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)" - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/unlockTest.sh) + info "bash <(curl -Lso- $CDN/lmc999/RegionRestrictionCheck/main/check.sh)" + bash <(curl -Lso- $CDN/VPSDance/scripts/main/unlockTest.sh) } super_bench() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/superBench.sh) + bash <(curl -Lso- $CDN/VPSDance/scripts/main/superBench.sh) } bench() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bench.sh) + bash <(curl -Lso- $CDN/VPSDance/scripts/main/bench.sh) } super_speed() { - bash <(curl -Lso- https://raw.githubusercontent.com/flyzy2005/superspeed/master/superspeed.sh) + bash <(curl -Lso- $CDN/flyzy2005/superspeed/master/superspeed.sh) } lemon_bench() { curl -fsSL http://ilemonra.in/LemonBenchIntl | bash -s fast @@ -146,13 +149,13 @@ yabs() { curl -sL yabs.sh | bash -s -- -dir } besttrace() { - bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoBestTrace.sh) + bash <(curl -Lso- $CDN/VPSDance/scripts/main/autoBestTrace.sh) } unix_bench() { - bash <(curl -Lso- https://raw.githubusercontent.com/teddysun/across/master/unixbench.sh) + bash <(curl -Lso- $CDN/teddysun/across/master/unixbench.sh) } reinstall() { - bash <(curl -Lso- https://raw.githubusercontent.com/hiCasper/Shell/master/AutoReinstall.sh) + bash <(curl -Lso- $CDN/hiCasper/Shell/master/AutoReinstall.sh) } menu() { From 2640de0d8a9b3ba0212bbeb9c6ed329d0ea51c58 Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 13 May 2022 12:38:27 +0800 Subject: [PATCH 126/165] Update ssh.sh --- ssh.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ssh.sh b/ssh.sh index cba298f..26e149b 100644 --- a/ssh.sh +++ b/ssh.sh @@ -27,7 +27,7 @@ ssh_key () { do if [[ ! -e "$home" ]]; then continue; fi; mkdir -p "${home}/.ssh"; chmod 700 "${home}/.ssh"; - if [[ ! -f "${home}/.ssh/authorized_keys" ]]; then echo '' >> ~/.ssh/authorized_keys; fi + if [[ ! -f "${home}/.ssh/authorized_keys" ]]; then echo '' >> "${home}/.ssh/authorized_keys"; fi chmod 600 "${home}/.ssh/authorized_keys" done echo "Paste your SSH public key (~/.ssh/id_rsa.pub):" From 99d936d4e8b8bc97e933ee5d7869d586352d150f Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 29 May 2022 22:42:41 +0800 Subject: [PATCH 127/165] feat: + nexttrace --- tools.sh | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/tools.sh b/tools.sh index b8d1efc..356d3e0 100644 --- a/tools.sh +++ b/tools.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go] +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go|nexttrace] # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) # bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/tools.sh) # bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/tools.sh) @@ -15,7 +15,7 @@ BOLD="\033[1m" NC='\033[0m' OS=$(uname -s) # Linux, FreeBSD, Darwin -ARCH=$(uname -m) # x86_64, arm64, aarch64 +ARCH=$(uname -m) # x86_64, arm64, arm64/aarch64 # DISTRO=$( [[ -e $(which lsb_release) ]] && (lsb_release -si) || echo 'unknown' ) which/lsb_release command not found DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) @@ -123,8 +123,20 @@ init () { ;; esac ;; + nexttrace) + app="nexttrace" + repo="xgadget-lab/nexttrace" + case $ARCH in + aarch64) + match="linux_arm64" + ;; + *) #x86_64 + match="linux_amd64" + ;; + esac + ;; *) - printf "${YELLOW}Please specify app_name (snell|realm|gost|ss|nali|wtrace|ddns-go)\n\n${NC}"; + printf "${YELLOW}Please specify app_name (snell|realm|gost|ss|nali|wtrace|ddns-go|nexttrace)\n\n${NC}"; exit ;; esac @@ -203,6 +215,9 @@ download () { ddns-go) tar xzf ddns-go_*tar.gz; mv ./ddns-go /usr/bin/; rm -rf ddns-go_*tar.gz* LICENSE README.md; ;; + nexttrace) + mv ./nexttrace_* /usr/bin/nexttrace; chmod +x /usr/bin/nexttrace; + ;; *);; esac } @@ -331,6 +346,9 @@ finally () { tips="\nOpen http://127.0.0.1:9876 for configuration." tips="$tips\n\n [Auto-generated] \"$config\"\n" ;; + nexttrace) + tips="nexttrace -T -rdns 189.cn" + ;; *) tips="systemctl restart $app; systemctl status $app;" ;; From e050063edf45650c69c29a0a92c3e92ef8b6c4df Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 29 May 2022 22:48:24 +0800 Subject: [PATCH 128/165] feat: + nexttrace --- toolbox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolbox.sh b/toolbox.sh index 12f89a1..deb5df7 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -174,6 +174,7 @@ menu() { success "14." "安装 gost (隧道/端口转发工具)" success "15." "安装 nali (IP查询工具)" success "16." "安装 ddns-go (DDNS工具)" + success "17." "安装 nexttrace (路由追踪工具)" # success "17." "安装 warp" # success "18." "安装 wireguard" # success "19." "安装 wtrace (路由追踪工具 WorstTrace)" @@ -214,6 +215,7 @@ main() { elif [[ "$num" == "14" ]]; then install_tool "gost" elif [[ "$num" == "15" ]]; then install_tool "nali" elif [[ "$num" == "16" ]]; then install_tool "ddns-go" + elif [[ "$num" == "17" ]]; then install_tool "nexttrace" # elif [[ "$num" == "17" ]]; then install_wrap # elif [[ "$num" == "18" ]]; then install_wireguard # elif [[ "$num" == "19" ]]; then install_tool "wtrace" From d6058e6bf891c9f450cfd3b6e7b134e395bc5ac7 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 31 May 2022 22:21:11 +0800 Subject: [PATCH 129/165] Create autoNexttrace.sh --- autoNexttrace.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 autoNexttrace.sh diff --git a/autoNexttrace.sh b/autoNexttrace.sh new file mode 100644 index 0000000..851b7e3 --- /dev/null +++ b/autoNexttrace.sh @@ -0,0 +1,44 @@ +#!/usr/bin/env bash + +# Usage: +# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoNexttrace.sh) +# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNexttrace.sh) + +footer() { + BLUE="\033[34m"; NC='\033[0m' + printf "%b\n" " Supported by: ${BLUE}https://vps.dance${NC}" + printf "%-37s\n" "-" | sed 's/\s/-/g' +} + +# install nexttrace +if [ ! -f "/usr/bin/nexttrace" ]; then + bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) nexttrace -p +fi + +next() { + printf "%-70s\n" "-" | sed 's/\s/-/g' +} + +clear +next + +ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 202.112.14.151) +ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 成都教育网) +# ip_len=${#ip_list[@]} + +for i in {0..7} +do + echo ${ip_addr[$i]} + nexttrace -T -rdns -q 1 ${ip_list[$i]} \ + | sed '/^.*Geo Data.*$/d' \ + | tac | awk '{ if (substr($0,3) != PREV) print $0; PREV=substr($0,3); }' | tac + next +done +footer +# echo -e "NextTrace v0.1.5-beta.2 2022-05-27T18:30:16Z d690f68\n1" | sed '/^NextTrace.*$/Id' +# echo "XGadget-lab Leo (leo.moe) & Vincent (vincent.moe) & zhshch (xzhsh.ch)" | sed '/^XGadget.*$/d' +# echo "IP Geo Data Provider: LeoMoeAPI" | sed '/^.*Geo Data.*$/d' +# echo -e "5 123\n5 *\n7 *\n9 666\n10 *\n11 *\n15 *\n16 *\n20 666" + # tac | awk '{ if (substr($0,3) != PREV) print $0; PREV=substr($0,3); }' | tac + # | awk '{line=substr($0,3); print line;}' + # | awk '{print $0,$4;}' From b3192dcc68146afe5b9cdaa98dc591ca91f1dd2f Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 31 May 2022 22:49:59 +0800 Subject: [PATCH 130/165] Update autoNexttrace.sh --- autoNexttrace.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoNexttrace.sh b/autoNexttrace.sh index 851b7e3..b8fdc65 100644 --- a/autoNexttrace.sh +++ b/autoNexttrace.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Usage: +# bash <(curl -Lso- https://sh.vps.dance/autoNexttrace.sh) # bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoNexttrace.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNexttrace.sh) @@ -12,7 +13,7 @@ footer() { # install nexttrace if [ ! -f "/usr/bin/nexttrace" ]; then - bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) nexttrace -p + bash <(curl -Lso- https://sh.vps.dance/tools.sh) nexttrace -p fi next() { From e4135b3b357128672655526ad97fe666e63ff136 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 31 May 2022 22:50:55 +0800 Subject: [PATCH 131/165] Update autoBestTrace.sh --- autoBestTrace.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/autoBestTrace.sh b/autoBestTrace.sh index 8c76868..7fc3b7b 100644 --- a/autoBestTrace.sh +++ b/autoBestTrace.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +# # bash <(curl -Lso- https://sh.vps.dance/autoBestTrace.sh) # https://github.com/nyjx/autoBestTrace # https://github.com/flyzy2005/shell From 5129bfdc2b91a932980e803e45062e764458dd0b Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 31 May 2022 22:58:30 +0800 Subject: [PATCH 132/165] Update toolbox.sh --- toolbox.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index deb5df7..e25da7b 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -151,6 +151,9 @@ yabs() { besttrace() { bash <(curl -Lso- $CDN/VPSDance/scripts/main/autoBestTrace.sh) } +nexttrace() { + bash <(curl -Lso- $CDN/VPSDance/scripts/main/autoNexttrace.sh) +} unix_bench() { bash <(curl -Lso- $CDN/teddysun/across/master/unixbench.sh) } @@ -174,7 +177,6 @@ menu() { success "14." "安装 gost (隧道/端口转发工具)" success "15." "安装 nali (IP查询工具)" success "16." "安装 ddns-go (DDNS工具)" - success "17." "安装 nexttrace (路由追踪工具)" # success "17." "安装 warp" # success "18." "安装 wireguard" # success "19." "安装 wtrace (路由追踪工具 WorstTrace)" @@ -183,6 +185,7 @@ menu() { success "23." "检测 VPS信息/IO/到国际网速 (Bench.sh)" success "24." "性能测试 (YABS)" success "25." "检测 回程路由 (BestTrace)" + success "26." "检测 回程路由 (NextTrace)" # success "25." "检测 到国内网速(电信/移动/联通) (Superspeed)" # success "25." "检测 VPS信息/IO/路由 (LemonBench)" # success "29." "性能测试 (UnixBench)" @@ -215,7 +218,7 @@ main() { elif [[ "$num" == "14" ]]; then install_tool "gost" elif [[ "$num" == "15" ]]; then install_tool "nali" elif [[ "$num" == "16" ]]; then install_tool "ddns-go" - elif [[ "$num" == "17" ]]; then install_tool "nexttrace" + # elif [[ "$num" == "17" ]]; then install_tool "nexttrace" # elif [[ "$num" == "17" ]]; then install_wrap # elif [[ "$num" == "18" ]]; then install_wireguard # elif [[ "$num" == "19" ]]; then install_tool "wtrace" @@ -224,6 +227,7 @@ main() { elif [[ "$num" == "23" ]]; then bench elif [[ "$num" == "24" ]]; then yabs elif [[ "$num" == "25" ]]; then besttrace + elif [[ "$num" == "26" ]]; then nexttrace # elif [[ "$num" == "29" ]]; then unix_bench # elif [[ "$num" == "31" ]]; then reinstall else exit From 7e873bf9abb174722b66f456a78ed68387bb9d82 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 1 Jun 2022 21:50:58 +0800 Subject: [PATCH 133/165] feat: cdn --- toolbox.sh | 65 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index e25da7b..c16831c 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -1,11 +1,10 @@ #!/usr/bin/env bash # Usage: +# bash <(curl -Lso- https://sh.vps.dance/toolbox.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh) # bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) # bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/toolbox.sh) -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh) -# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/toolbox.sh) # bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/toolbox.sh) # Colors @@ -22,9 +21,23 @@ ARCH=$(uname -m) # x86_64, arm64, aarch64 DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) debug=$( [[ $OS == "Darwin" ]] && echo true || echo false ) cnd=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) -CDN='https://raw.githubusercontent.com' -if [[ "${1}" =~ ^(fastgit)$ ]]; then CDN='https://raw.fastgit.org'; fi -echo $CDN +SH='https://sh.vps.dance' +GH='https://ghproxy.com' + +raw() { + RAW='https://raw.githubusercontent.com' + if [[ "$cnd" =~ ^(fastgit)$ ]]; then + echo "https://raw.fastgit.org" + elif [[ "$cnd" =~ ^(ghproxy)$ ]]; then + echo "${GH}/${RAW}" + elif [[ "${1}" =~ ^(ghproxy)$ ]]; then + echo "${GH}/${RAW}" + else + echo $RAW + fi +} +# echo $(raw 'ghproxy') +# curl -Ls "$(raw '')/VPSDance/scripts/main/ssh.sh" check_root() { if [[ "$USER" != 'root' ]]; then # [[ "$EUID" -ne 0 ]] @@ -94,52 +107,52 @@ install_deps() { esac } install_bbr() { - bash <(curl -Lso- $CDN/teddysun/across/master/bbr.sh) + bash <(curl -Lso- $(raw 'ghproxy')/teddysun/across/master/bbr.sh) } ssh_key() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/ssh.sh) + bash <(curl -Lso- ${SH}/ssh.sh) } bashrc() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/bashrc.sh) + bash <(curl -Lso- ${SH}/bashrc.sh) } tuning() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/tuning.sh) + bash <(curl -Lso- ${SH}/tuning.sh) } ssh_port() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/ssh.sh) port + bash <(curl -Lso- ${SH}/ssh.sh) port } install_tool() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/tools.sh) "$@" + bash <(curl -Lso- ${SH}/tools.sh) "$@" } install_xray() { - bash <(curl -fsSL $CDN/XTLS/Xray-install/main/install-release.sh) install + bash <(curl -fsSL $(raw 'ghproxy')/XTLS/Xray-install/main/install-release.sh) install # 使用增强版的 geosite/geoip 规则 - wget -O /usr/local/share/xray/geoip.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geoip.dat - wget -O /usr/local/share/xray/geosite.dat https://cdn.jsdelivr.net/gh/Loyalsoldier/v2ray-rules-dat@release/geosite.dat + wget -O /usr/local/share/xray/geoip.dat ${GH}/https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geoip.dat + wget -O /usr/local/share/xray/geosite.dat ${GH}/https://github.com/Loyalsoldier/v2ray-rules-dat/releases/latest/download/geosite.dat info "configuration file: /usr/local/etc/xray/config.json" info "status: systemctl status xray" info "restart: systemctl restart xray" } install_wrap() { - bash <(curl -fsSL $CDN/P3TERX/warp.sh/main/warp.sh) menu + bash <(curl -fsSL $(raw 'ghproxy')/P3TERX/warp.sh/main/warp.sh) menu } install_wireguard(){ - curl -Ls $CDN/teddysun/across/master/wireguard.sh | bash -s -- -r + curl -Ls $(raw 'ghproxy')/teddysun/across/master/wireguard.sh | bash -s -- -r # uninstall_wireguard - # curl -Ls $CDN/teddysun/across/master/wireguard.sh | bash -s -- -n + # curl -Ls $(raw 'ghproxy')/teddysun/across/master/wireguard.sh | bash -s -- -n } unlock_test() { - info "bash <(curl -Lso- $CDN/lmc999/RegionRestrictionCheck/main/check.sh)" - bash <(curl -Lso- $CDN/VPSDance/scripts/main/unlockTest.sh) + info "bash <(curl -Lso- "$(raw 'ghproxy')/lmc999/RegionRestrictionCheck/main/check.sh")" + bash <(curl -Lso- ${SH}/unlockTest.sh) } super_bench() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/superBench.sh) + bash <(curl -Lso- ${SH}/superBench.sh) } bench() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/bench.sh) + bash <(curl -Lso- ${SH}/bench.sh) } super_speed() { - bash <(curl -Lso- $CDN/flyzy2005/superspeed/master/superspeed.sh) + bash <(curl -Lso- $(raw 'ghproxy')/flyzy2005/superspeed/master/superspeed.sh) } lemon_bench() { curl -fsSL http://ilemonra.in/LemonBenchIntl | bash -s fast @@ -149,16 +162,16 @@ yabs() { curl -sL yabs.sh | bash -s -- -dir } besttrace() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/autoBestTrace.sh) + bash <(curl -Lso- ${SH}/autoBestTrace.sh) } nexttrace() { - bash <(curl -Lso- $CDN/VPSDance/scripts/main/autoNexttrace.sh) + bash <(curl -Lso- ${SH}/autoNexttrace.sh) } unix_bench() { - bash <(curl -Lso- $CDN/teddysun/across/master/unixbench.sh) + bash <(curl -Lso- $(raw 'ghproxy')/teddysun/across/master/unixbench.sh) } reinstall() { - bash <(curl -Lso- $CDN/hiCasper/Shell/master/AutoReinstall.sh) + bash <(curl -Lso- $(raw 'ghproxy')/hiCasper/Shell/master/AutoReinstall.sh) } menu() { From 4ddcc3eba8dd461b4232cd7817bbbeb18e64d1ab Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 1 Jun 2022 21:54:38 +0800 Subject: [PATCH 134/165] feat: cdn --- toolbox.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index c16831c..408da32 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -2,10 +2,7 @@ # Usage: # bash <(curl -Lso- https://sh.vps.dance/toolbox.sh) -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/toolbox.sh) # bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/toolbox.sh) -# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/toolbox.sh) # Colors RED='\033[0;31m' From 5c2b127b693e5366e5ff82cfa212a19703b89d5e Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 1 Jun 2022 21:57:09 +0800 Subject: [PATCH 135/165] feat: cdn --- tools.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tools.sh b/tools.sh index 356d3e0..7a391af 100644 --- a/tools.sh +++ b/tools.sh @@ -1,11 +1,8 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go|nexttrace] -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) -# bash <(curl -Lso- https://raw.githack.com/VPSDance/scripts/main/tools.sh) -# bash <(curl -Lso- https://raw.fastgit.org/VPSDance/scripts/main/tools.sh) - +# bash <(curl -Lso- https://sh.vps.dance/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go|nexttrace] +# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) # Colors RED='\033[0;31m' From 8a54282ab2a617e26275ef227033c5cc037c898e Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 1 Jun 2022 21:59:42 +0800 Subject: [PATCH 136/165] feat: cdn --- paste.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/paste.sh b/paste.sh index ddff962..9a39e5b 100644 --- a/paste.sh +++ b/paste.sh @@ -1,8 +1,7 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/paste.sh) [poster] -# bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/paste.sh) [poster] +# bash <(curl -Lso- https://sh.vps.dance/paste.sh) [poster] echo "Paste your content:" IFS= read -d '' -n 1 text From 78d84ebe302536346f980822462d979d4bdef93b Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 1 Jun 2022 22:02:59 +0800 Subject: [PATCH 137/165] feat: cdn --- unlockTest.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unlockTest.sh b/unlockTest.sh index 2cc229c..ebf41cd 100644 --- a/unlockTest.sh +++ b/unlockTest.sh @@ -3,9 +3,11 @@ # bash <(curl -L -s check.unlock.media) # https://github.com/lmc999/RegionRestrictionCheck +url="https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh" +url="https://ghproxy.com/$url" # cdn main() { bash <( - curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh \ + curl -L -s $url \ | sed '/^[ \t]*echo\( -e\)\? "[-]*"\(.*\)\?$/d' \ | sed '/^[ \t]*echo\( -e\)\? "[=]*"\(.*\)\?$/d' \ | sed 's/ CheckV6().*$/&\n printf "%-39s\\n" \| sed "s\/\\s\/-\/g"/' \ From fd5de69b4872c2b09a2a404b9a22a7acfd9749f0 Mon Sep 17 00:00:00 2001 From: cloudend Date: Wed, 1 Jun 2022 22:08:27 +0800 Subject: [PATCH 138/165] Update README.md --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 69d22f8..1f87584 100644 --- a/README.md +++ b/README.md @@ -10,34 +10,36 @@ Tools and Scripts for Linux VPS - VPS ToolBox(include all scripts) ```sh -bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) +bash <(curl -Lso- https://sh.vps.dance/toolbox.sh) +# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) ``` - install ddns-go ```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) ddns-go -p +bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) ddns-go -p ``` - install gost ```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) gost -p +bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) gost -p ``` - install realm ```sh -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/tools.sh) realm -p +bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) realm -p ``` - paste text and share ``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/paste.sh) +bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/paste.sh) ``` - autoBestTrace ``` -bash <(curl -Lso- https://cdn.jsdelivr.net/gh/cloudend/scripts@main/autoBestTrace.sh) +bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/autoBestTrace.sh) ``` - + From 30971fa8ddb453be34855685a4709abfa9088f18 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 7 Jun 2022 22:55:07 +0800 Subject: [PATCH 139/165] Update ipt.js --- files/ipt.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/files/ipt.js b/files/ipt.js index c047a49..c4b015c 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -23,7 +23,12 @@ window.__tr = () => { time = time.split(' / ')[1] || time; return host === '*' ? `${ttl} *` : `${ttl} ${host}${ip} ${time}ms ${as} ${location}`; }); - html = lines.toArray().join('\n'); + html = lines.toArray().reduce((acc, curr) => { + [last = ''] = acc.slice(-1) + if (last.slice(-1) + curr.slice(-1) === '**') acc.pop(); + acc.push(curr); + return acc; + }, []).join('\n'); console.warn(html); // __cp(html); return html; From 768d794d55db8277e84e3909febe77eb4c431185 Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 7 Jun 2022 23:06:54 +0800 Subject: [PATCH 140/165] Update ipt.js --- files/ipt.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/ipt.js b/files/ipt.js index c4b015c..3627e09 100644 --- a/files/ipt.js +++ b/files/ipt.js @@ -79,15 +79,15 @@ window.__init = () => { __init(); __IDS__ = [ + {id: '896', name: '上海电信'}, {id: '502', name: '广东电信'}, {id: '764', name: '江苏电信'}, - // {id: '896', name: 'Shanghai CT'}, {id: '11', name: '重庆电信'}, + {id: '1240', name: '上海联通9929'}, {id: '503', name: '广东联通'}, {id: '765', name: '江苏联通'}, // {id: '1078', name: '上海联通'}, - // {id: '1240', name: '上海联通9929'}, {id: '12', name: '重庆联通'}, // {id: '662', name: '湖南联通'}, From c04ad249b4d28447c9ac7494e7263f82b4e2df02 Mon Sep 17 00:00:00 2001 From: cloudend Date: Fri, 10 Jun 2022 23:25:48 +0800 Subject: [PATCH 141/165] + hping for tcp ping --- toolbox.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/toolbox.sh b/toolbox.sh index 408da32..e2498d3 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -92,12 +92,14 @@ install_deps() { Debian*|Ubuntu*) apt update -y; apt install -y curl wget htop zip unzip xz-utils gzip ca-certificates net-tools dnsutils iputils-ping mtr traceroute telnet tcpdump; + apt install -y hping3; bash <(curl -s https://install.speedtest.net/app/cli/install.deb.sh); apt install -y speedtest; ;; CentOS*|RedHat*) yum update -y; yum install -y epel-release which openssl curl wget htop zip unzip xz gzip ca-certificates net-tools bind-utils iputils mtr traceroute telnet tcpdump; + yum install -y hping3; # @epel-release curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash yum install -y speedtest ;; From 793cc25b2baa5758b1a1ec63f38104419ce6babd Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 21 Jun 2022 09:08:19 +0800 Subject: [PATCH 142/165] Update tools.sh --- tools.sh | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/tools.sh b/tools.sh index 7a391af..4293d54 100644 --- a/tools.sh +++ b/tools.sh @@ -87,7 +87,7 @@ init () { aarch64) match="aarch64.*linux-gnu" ;; - *) #x86_64 + *) match="x86_64.*linux-gnu" ;; esac @@ -99,7 +99,7 @@ init () { aarch64) match="linux-armv8" ;; - *) #x86_64 + *) match="linux-amd64" ;; esac @@ -115,7 +115,7 @@ init () { aarch64) match="Linux_.*arm64" ;; - *) #x86_64 + *) match="Linux_.*x86_64" ;; esac @@ -127,7 +127,7 @@ init () { aarch64) match="linux_arm64" ;; - *) #x86_64 + *) match="linux_amd64" ;; esac @@ -169,7 +169,7 @@ download () { aarch64) printf "${RED}[x] $ARCH not supported ${PLAIN}\n${NC}"; exit 1; ;; - *) #x86_64 + *) url="https://pkg.wtrace.app/linux/worsttrace" ;; esac @@ -274,6 +274,9 @@ gen_config () { ;; realm) conf=('' + '[log]' + 'level = "warn"' + '' '[[endpoints]]' 'listen = "0.0.0.0:10001"' 'remote = "test.com:80"' @@ -300,15 +303,17 @@ gen_config () { conf="$(printf "%s\n" "${conf[@]}")" ;; ss) - conf=('{' - ' "server": "0.0.0.0",' - ' "server_port": '$port',' - ' "method": "chacha20-ietf-poly1305",' + conf=('{"servers": [' + '{' + ' "address": "0.0.0.0",' + ' "port": '$port',' ' "password": "'$pass'",' - ' "mode": "tcp_only",' + ' "method": "chacha20-ietf-poly1305",' + ' "mode": "tcp_and_udp",' ' "fast_open": false,' ' "timeout": 300' - '}') + '}' + ']}') conf="$(printf "%s\n" "${conf[@]}")" ;; esac From 0f5ea2731f8abb4b82132f12e732d7dbf11cf3fd Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 4 Jul 2022 17:27:32 +0800 Subject: [PATCH 143/165] fix: speedtest --- toolbox.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index e2498d3..c471c38 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -93,15 +93,15 @@ install_deps() { apt update -y; apt install -y curl wget htop zip unzip xz-utils gzip ca-certificates net-tools dnsutils iputils-ping mtr traceroute telnet tcpdump; apt install -y hping3; - bash <(curl -s https://install.speedtest.net/app/cli/install.deb.sh); - apt install -y speedtest; + apt install -y python3 python3-pip; + pip3 install speedtest-cli ;; CentOS*|RedHat*) yum update -y; yum install -y epel-release which openssl curl wget htop zip unzip xz gzip ca-certificates net-tools bind-utils iputils mtr traceroute telnet tcpdump; yum install -y hping3; # @epel-release - curl -s https://install.speedtest.net/app/cli/install.rpm.sh | sudo bash - yum install -y speedtest + yum install -y python3 python3-pip; + pip3 install speedtest-cli ;; esac } From cb41431de52bc915e0d5c17caa1dca4a405d0bbf Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 5 Jul 2022 09:13:37 +0800 Subject: [PATCH 144/165] Update autoBestTrace.sh --- autoBestTrace.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoBestTrace.sh b/autoBestTrace.sh index 7fc3b7b..7e5193c 100644 --- a/autoBestTrace.sh +++ b/autoBestTrace.sh @@ -7,6 +7,14 @@ # besttrace -q1 -T -g cn # 探测数据包数1, TCP, CN url="https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh" url="https://ghproxy.com/$url" # cdn + +# clean faild file +if [ -f "besttrace2021" ]; then + if [[ ! $(./besttrace2021 -V) ]]; then + rm -rf besttrace2021; + fi +fi + bash <( curl -Lso- $url \ | sed "s/https:\/\/github.com/https:\/\/ghproxy.com\/https:\/\/github.com/Ig" \ From 509298fb43a875a312ab3ea7a9a95e78edd7f7bf Mon Sep 17 00:00:00 2001 From: cloudend Date: Tue, 5 Jul 2022 09:22:28 +0800 Subject: [PATCH 145/165] Update autoNexttrace.sh --- autoNexttrace.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoNexttrace.sh b/autoNexttrace.sh index b8fdc65..53d4b2b 100644 --- a/autoNexttrace.sh +++ b/autoNexttrace.sh @@ -30,7 +30,7 @@ ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海 for i in {0..7} do echo ${ip_addr[$i]} - nexttrace -T -rdns -q 1 ${ip_list[$i]} \ + nexttrace -T -q 1 ${ip_list[$i]} \ | sed '/^.*Geo Data.*$/d' \ | tac | awk '{ if (substr($0,3) != PREV) print $0; PREV=substr($0,3); }' | tac next From b5edbb39f0f1fc2f1217a683308eab7ba2940be3 Mon Sep 17 00:00:00 2001 From: cloudend Date: Thu, 13 Oct 2022 09:30:10 +0800 Subject: [PATCH 146/165] feat: watch limit --- tuning.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tuning.sh b/tuning.sh index d53f197..6ffaba2 100644 --- a/tuning.sh +++ b/tuning.sh @@ -30,6 +30,9 @@ ulimited_tuning() { # max open files sed -i '/fs.file-max/d' "$sysctl_conf" echo 'fs.file-max=102400' >> "$sysctl_conf" + # watch limit + echo 'fs.inotify.max_user_instances=999' >> "$sysctl_conf" + echo 'fs.inotify.max_user_watches=81920' >> "$sysctl_conf" # max user processes for usr in $allusers '\*'; do usr="${usr/\\/}" From b8010d25f3568fbe9cf192c5f5382280e99829d5 Mon Sep 17 00:00:00 2001 From: cloudend Date: Sun, 30 Oct 2022 19:45:11 +0800 Subject: [PATCH 147/165] feat: snell --- tools.sh | 38 ++++++++++++++++++++++++++++++++------ 1 file changed, 32 insertions(+), 6 deletions(-) diff --git a/tools.sh b/tools.sh index 4293d54..33487f2 100644 --- a/tools.sh +++ b/tools.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://sh.vps.dance/tools.sh) [snell|realm|gost|ss|nali|wtrace|ddns-go|nexttrace] +# bash <(curl -Lso- https://sh.vps.dance/tools.sh) [snell|snell4|realm|gost|ss|nali|wtrace|ddns-go|nexttrace] # bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) # Colors @@ -38,14 +38,17 @@ prompt_yn () { } init () { case "$name" in - snell) - app="snell" - config="/root/snell.conf" - repo="surge-networks/snell" + snell | snell4) + app="$name" + config="/root/$app.conf" + # repo="surge-networks/snell" case $ARCH in - aarch64) + aarch64 | armv8) match="linux-aarch64" ;; + armv7 | armv6l) + match="linux-armv7l" + ;; *) #x86_64 match="linux-amd64" ;; @@ -158,7 +161,20 @@ download () { # url=${url/"https://github.com"/"https://hub.fastgit.org"} # cdn url="https://ghproxy.com/$url" # cdn fi + echo $app case "$app" in + snell) + version="v3.0.1" + url="https://raw.githubusercontent.com/VPSDance/files/main/snell/${version}/snell-server-${version}-${match}.zip" + url="https://ghproxy.com/$url" # cdn + ;; + snell4) + # https://manual.nssurge.com/others/snell.html + version="v4.0.0" + # url="https://raw.githubusercontent.com/VPSDance/files/main/snell/${version}/snell-server-${version}-${match}.zip" + # url="https://ghproxy.com/$url" # cdn + url="https://dl.nssurge.com/snell/snell-server-${version}-${match}.zip" + ;; realm) if [[ "$debug" != true ]]; then rm -rf /usr/bin/realm ./realm; @@ -191,6 +207,10 @@ download () { unzip -o snell*.zip; rm -rf snell-server-*.zip*; mv ./snell-server /usr/bin/; ;; + snell4) + unzip -o snell*.zip; rm -rf snell-server-*.zip*; + mv ./snell-server /usr/bin/snell4-server; + ;; realm) # curl -s https://api.github.com/repos/zhboner/realm/releases/latest | grep "browser_download_url.*" | cut -d : -f 2,3 | xargs wget -O ./realm {}; chmod +x realm if [[ `compgen -G "realm*.tar.gz"` ]]; then tar xzvf realm*.tar.gz; rm -rf realm*.tar.gz; fi @@ -223,6 +243,9 @@ gen_service () { snell) service='[Unit]\nDescription=Snell Service\nAfter=network.target\n[Service]\nType=simple\nLimitNOFILE=32768\nRestart=on-failure\nExecStart=/usr/bin/snell-server -c /root/snell.conf\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=snell-server\n[Install]\nWantedBy=multi-user.target\n' ;; + snell4) + service='[Unit]\nDescription=Snell Service\nAfter=network.target\n[Service]\nType=simple\nLimitNOFILE=32768\nRestart=on-failure\nExecStart=/usr/bin/snell4-server -c /root/snell4.conf\nStandardOutput=syslog\nStandardError=syslog\nSyslogIdentifier=snell-server\n[Install]\nWantedBy=multi-user.target\n' + ;; realm) service='[Unit]\nDescription=realm\nAfter=network-online.target\nWants=network-online.target systemd-networkd-wait-online.service\n[Service]\nType=simple\nUser=root\nRestart=on-failure\nRestartSec=5s\nExecStart=/usr/bin/realm -c /root/realm.toml\n[Install]\nWantedBy=multi-user.target' ;; @@ -272,6 +295,9 @@ gen_config () { snell) conf="[snell-server]\nlisten = 0.0.0.0:$port\npsk = $pass\nobfs = tls" ;; + snell4) + conf="[snell-server]\nlisten = 0.0.0.0:$port\npsk = $pass\nipv6 = false" #v4 + ;; realm) conf=('' '[log]' From 2b1ea60926be3aac3f0e41811926ee2ee011f644 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:09:02 +0800 Subject: [PATCH 148/165] rm speedtest --- toolbox.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/toolbox.sh b/toolbox.sh index c471c38..c4b1c9d 100644 --- a/toolbox.sh +++ b/toolbox.sh @@ -94,14 +94,12 @@ install_deps() { apt install -y curl wget htop zip unzip xz-utils gzip ca-certificates net-tools dnsutils iputils-ping mtr traceroute telnet tcpdump; apt install -y hping3; apt install -y python3 python3-pip; - pip3 install speedtest-cli ;; CentOS*|RedHat*) yum update -y; yum install -y epel-release which openssl curl wget htop zip unzip xz gzip ca-certificates net-tools bind-utils iputils mtr traceroute telnet tcpdump; yum install -y hping3; # @epel-release yum install -y python3 python3-pip; - pip3 install speedtest-cli ;; esac } From ed95ef9aa8c51b240bcee6f1227ec3e575116e43 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:09:09 +0800 Subject: [PATCH 149/165] feat: + trace node --- autoBestTrace.sh | 61 ++++++++++++++++++++++++++++++++++++++++++------ autoNexttrace.sh | 9 ++++--- tools.sh | 2 +- 3 files changed, 61 insertions(+), 11 deletions(-) mode change 100644 => 100755 autoBestTrace.sh diff --git a/autoBestTrace.sh b/autoBestTrace.sh old mode 100644 new mode 100755 index 7e5193c..cb1c58b --- a/autoBestTrace.sh +++ b/autoBestTrace.sh @@ -5,8 +5,6 @@ # https://github.com/flyzy2005/shell # besttrace -q1 -T -g cn # 探测数据包数1, TCP, CN -url="https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh" -url="https://ghproxy.com/$url" # cdn # clean faild file if [ -f "besttrace2021" ]; then @@ -15,8 +13,57 @@ if [ -f "besttrace2021" ]; then fi fi -bash <( - curl -Lso- $url \ - | sed "s/https:\/\/github.com/https:\/\/ghproxy.com\/https:\/\/github.com/Ig" \ - | sed 's/ -q 1 / -q1 -g cn -T /g' -) +# url="https://raw.githubusercontent.com/nyjx/autoBestTrace/main/autoBestTrace.sh" +# url="https://ghproxy.com/$url" # cdn +# bash <( +# curl -Lso- $url \ +# | sed "s/https:\/\/github.com/https:\/\/ghproxy.com\/https:\/\/github.com/Ig" \ +# | sed 's/ -q 1 / -q1 -g cn -T /g' +# ) + + +OSARCH=$(uname -m) +case $OSARCH in + x86_64) + BINTAG="" + ;; + i*86) + BINTAG="32" + ;; + arm64|aarch64) + BINTAG="arm" + ;; + *) + echo "unsupported OSARCH: $OSARCH" + exit 1 + ;; +esac + +# install besttrace +if [ ! -f "besttrace2021" ]; then + wget -O besttrace2021 "https://github.com/nyjx/autoBestTrace/raw/main/besttrace4linux/besttrace${BINTAG}" + chmod +x besttrace2021 +fi + +## start to use besttrace + +next() { + printf "%-70s\n" "-" | sed 's/\s/-/g' +} + +clear +next + +# 广东电信 gd.189.cn +# 广东联通 221.5.88.88 +# 广东移动 211.139.145.129 gd.10086.cn +ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 211.139.145.129 202.112.14.151) +ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 广东移动 成都教育网) + +# ip_len=${#ip_list[@]} + +for i in {0..8}; do + echo ${ip_addr[$i]} + ./besttrace2021 -q1 -g cn -T ${ip_list[$i]} + next +done diff --git a/autoNexttrace.sh b/autoNexttrace.sh index 53d4b2b..8e6c5ab 100644 --- a/autoNexttrace.sh +++ b/autoNexttrace.sh @@ -23,11 +23,14 @@ next() { clear next -ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 202.112.14.151) -ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 成都教育网) +# 广东电信 gd.189.cn +# 广东联通 221.5.88.88 +# 广东移动 211.139.145.129 gd.10086.cn +ip_list=(14.215.116.1 202.96.209.133 117.28.254.129 113.207.25.138 119.6.6.6 120.204.197.126 183.221.253.100 211.139.145.129 202.112.14.151) +ip_addr=(广州电信 上海电信 厦门电信 重庆联通 成都联通 上海移动 成都移动 广东移动 成都教育网) # ip_len=${#ip_list[@]} -for i in {0..7} +for i in {0..8} do echo ${ip_addr[$i]} nexttrace -T -q 1 ${ip_list[$i]} \ diff --git a/tools.sh b/tools.sh index 33487f2..5d43b3c 100644 --- a/tools.sh +++ b/tools.sh @@ -12,7 +12,7 @@ BOLD="\033[1m" NC='\033[0m' OS=$(uname -s) # Linux, FreeBSD, Darwin -ARCH=$(uname -m) # x86_64, arm64, arm64/aarch64 +ARCH=$(uname -m) # x86_64, arm64/aarch64, i386, # DISTRO=$( [[ -e $(which lsb_release) ]] && (lsb_release -si) || echo 'unknown' ) which/lsb_release command not found DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) name=$( tr '[:upper:]' '[:lower:]' <<<"$1" ) From 89ebbea6606c1d589238d02df2b5037040ca2742 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:09:12 +0800 Subject: [PATCH 150/165] fix: nexttrace --- tools.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 tools.sh diff --git a/tools.sh b/tools.sh old mode 100644 new mode 100755 index 5d43b3c..1b3ee20 --- a/tools.sh +++ b/tools.sh @@ -125,7 +125,7 @@ init () { ;; nexttrace) app="nexttrace" - repo="xgadget-lab/nexttrace" + repo="sjlleo/nexttrace" case $ARCH in aarch64) match="linux_arm64" @@ -375,7 +375,7 @@ finally () { tips="$tips\n\n [Auto-generated] \"$config\"\n" ;; nexttrace) - tips="nexttrace -T -rdns 189.cn" + tips="nexttrace -T -f" ;; *) tips="systemctl restart $app; systemctl status $app;" From bf72a6172ad152c368571ecd404fbc994faaee18 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:09:14 +0800 Subject: [PATCH 151/165] feat: + speedtest --- speedtest.sh | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100755 speedtest.sh diff --git a/speedtest.sh b/speedtest.sh new file mode 100755 index 0000000..919d2b3 --- /dev/null +++ b/speedtest.sh @@ -0,0 +1,110 @@ +#!/usr/bin/env bash + +# References: +# https://github.com/ernisn/superspeed/blob/master/ServerList.md +# https://github.com/flyzy2005/superspeed/blob/master/superspeed.sh +# https://github.com/oooldking/script/blob/master/superbench.sh + +ARCH=$(uname -m) +# VERSION="1.1.1" +VERSION="1.2.0" + +check_root() { + if [[ "$USER" != 'root' ]]; then # [[ "$EUID" -ne 0 ]] + danger "Please run this script as root!"; exit 1; + # if [[ "$debug" != true ]]; then exit 1; fi + fi +} +next() { + printf "%-70s\n" "-" | sed 's/\s/-/g' +} +footer() { + BLUE="\033[34m"; NC='\033[0m' + printf "%b\n" " Supported by: ${BLUE}https://vps.dance${NC}" + printf "%-37s\n" "-" | sed 's/\s/-/g' +} + +check_speedtest() { + # curl -Lo /usr/bin/speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py;chmod +x /usr/bin/speedtest-cli + if [ -e "./speedtest-cli/speedtest" ]; then + return; + fi + arch="" + case $ARCH in + i386 | i686) + arch="i386" + ;; + armv8 | armv8l | aarch64 |arm64) + arch="aarch64" + ;; + armv7 | armv7l) + arch="armhf" + ;; + armv6) + arch="armel" + ;; + *) # x86_64 + arch="$ARCH" + ;; + esac + [ -z "${arch}" ] && _red "Error: Unsupported system architecture (${sysarch}).\n" && exit 1 + url1="https://install.speedtest.net/app/cli/ookla-speedtest-$VERSION-linux-$arch.tgz" + # url2="https://raw.githubusercontent.com/VPSDance/files/main/speedtest/$VERSION/ookla-speedtest-$VERSION-linux-$arch.tgz" + wget --no-check-certificate -q -T10 -O speedtest.tgz ${url1} + if [ $? -ne 0 ]; then + # wget --no-check-certificate -q -T10 -O speedtest.tgz ${url2} + [ $? -ne 0 ] && _red "Error: Failed to download speedtest-cli.\n" && exit 1 + fi + mkdir -p speedtest-cli && tar zxf speedtest.tgz -C ./speedtest-cli && chmod +x ./speedtest-cli/speedtest + rm -f speedtest.tgz +} + +speed_test() { + local nodeName="$2" + [ -z "$1" ] && ./speedtest-cli/speedtest --progress=no --accept-license --accept-gdpr > ./speedtest-cli/speedtest.log 2>&1 || \ + ./speedtest-cli/speedtest --progress=no --server-id=$1 --accept-license --accept-gdpr > ./speedtest-cli/speedtest.log 2>&1 + if [ $? -eq 0 ]; then + local dl_speed=$(awk '/Download/{print $3" "$4}' ./speedtest-cli/speedtest.log) + local up_speed=$(awk '/Upload/{print $3" "$4}' ./speedtest-cli/speedtest.log) + local latency=$(awk '/Latency/{print $3" "$4}' ./speedtest-cli/speedtest.log) + if [[ -n "${dl_speed}" && -n "${up_speed}" && -n "${latency}" ]]; then + printf "\033[0;33m%-18s\033[0;32m%-18s\033[0;31m%-20s\033[0;36m%-12s\033[0m\n" " ${nodeName}" "${up_speed}" "${dl_speed}" "${latency}" + fi + fi +} + +# https://www.speedtest.net/api/js/servers?search=China%20Telecom +# https://www.speedtest.net/api/js/servers?search=电信 +# https://www.speedtest.net/api/js/servers?search=China%20Unicom +# https://www.speedtest.net/api/js/servers?search=联通 +# https://www.speedtest.net/api/js/servers?search=China%20Mobile +# https://www.speedtest.net/api/js/servers?search=移动 + +runtest() { + printf "%-18s%-18s%-20s%-12s\n" " Node Name" "Upload Speed" "Download Speed" "Latency" + speed_test '3633' 'CT|Shanghai' + # speed_test '28225' 'CT|Changsha 5G' + # # speed_test '17145' 'CT|Hefei 5G' + # # speed_test '28225' 'CT|Nanjing 5G' + # speed_test '24447' 'CU|ShangHai 5G' + # speed_test '4870' 'CU|Changsha 5G' + # speed_test '25637' 'CM|Shanghai 5G' + # speed_test '28491' 'CM|Changsha 5G' + # speed_test '26404' 'CM|Hefei 5G' + + # speed_test '21541' 'Los Angeles, US' + # speed_test '43860' 'Dallas, US' + # speed_test '40879' 'Montreal, CA' + # speed_test '24215' 'Paris, FR' + # speed_test '28922' 'Amsterdam, NL' + # speed_test '32155' 'Hongkong, CN' + # speed_test '6527' 'Seoul, KR' + # speed_test '7311' 'Singapore, SG' + # speed_test '21569' 'Tokyo, JP' +} + +check_root +check_speedtest +runtest +next +footer \ No newline at end of file From 571ee9f885969d5fb5a8744000af0ec6b7d63989 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:09:15 +0800 Subject: [PATCH 152/165] fix: rm superBench; add speedtest --- .gitignore | 1 + superBench.sh => old/superBench.sh | 0 speedtest.sh | 16 ++++++++-------- toolbox.sh | 21 ++++++++++++--------- 4 files changed, 21 insertions(+), 17 deletions(-) rename superBench.sh => old/superBench.sh (100%) mode change 100644 => 100755 toolbox.sh diff --git a/.gitignore b/.gitignore index b6e4761..6fc1f56 100644 --- a/.gitignore +++ b/.gitignore @@ -127,3 +127,4 @@ dmypy.json # Pyre type checker .pyre/ +speedtest-cli/ diff --git a/superBench.sh b/old/superBench.sh similarity index 100% rename from superBench.sh rename to old/superBench.sh diff --git a/speedtest.sh b/speedtest.sh index 919d2b3..6ced3b8 100755 --- a/speedtest.sh +++ b/speedtest.sh @@ -83,14 +83,14 @@ speed_test() { runtest() { printf "%-18s%-18s%-20s%-12s\n" " Node Name" "Upload Speed" "Download Speed" "Latency" speed_test '3633' 'CT|Shanghai' - # speed_test '28225' 'CT|Changsha 5G' - # # speed_test '17145' 'CT|Hefei 5G' - # # speed_test '28225' 'CT|Nanjing 5G' - # speed_test '24447' 'CU|ShangHai 5G' - # speed_test '4870' 'CU|Changsha 5G' - # speed_test '25637' 'CM|Shanghai 5G' - # speed_test '28491' 'CM|Changsha 5G' - # speed_test '26404' 'CM|Hefei 5G' + speed_test '28225' 'CT|Changsha 5G' + # speed_test '17145' 'CT|Hefei 5G' + # speed_test '28225' 'CT|Nanjing 5G' + speed_test '24447' 'CU|ShangHai 5G' + speed_test '4870' 'CU|Changsha 5G' + speed_test '25637' 'CM|Shanghai 5G' + speed_test '28491' 'CM|Changsha 5G' + speed_test '26404' 'CM|Hefei 5G' # speed_test '21541' 'Los Angeles, US' # speed_test '43860' 'Dallas, US' diff --git a/toolbox.sh b/toolbox.sh old mode 100644 new mode 100755 index c4b1c9d..82243ce --- a/toolbox.sh +++ b/toolbox.sh @@ -121,6 +121,9 @@ ssh_port() { install_tool() { bash <(curl -Lso- ${SH}/tools.sh) "$@" } +speedtest() { + bash <(curl -Lso- ${SH}/speedtest.sh) +} install_xray() { bash <(curl -fsSL $(raw 'ghproxy')/XTLS/Xray-install/main/install-release.sh) install # 使用增强版的 geosite/geoip 规则 @@ -142,9 +145,9 @@ unlock_test() { info "bash <(curl -Lso- "$(raw 'ghproxy')/lmc999/RegionRestrictionCheck/main/check.sh")" bash <(curl -Lso- ${SH}/unlockTest.sh) } -super_bench() { - bash <(curl -Lso- ${SH}/superBench.sh) -} +# super_bench() { +# bash <(curl -Lso- ${SH}/superBench.sh) +# } bench() { bash <(curl -Lso- ${SH}/bench.sh) } @@ -177,7 +180,7 @@ menu() { success "1." "[推荐] 配置SSH Public Key (SSH免密登录)" success "2." "[推荐] 终端优化 (颜色美化/上下键查找历史)" success "3." "[推荐] 安装并开启 BBR" - success "4." "[推荐] 安装常用软件 (curl/wget/ping/traceroute/speedtest)" + success "4." "[推荐] 安装常用软件 (curl/wget/ping/traceroute)" success "5." "[推荐] 系统优化 (TCP网络优化/资源限制优化)" success "6." "[推荐] 修改默认SSH端口 (防止被攻击)" success "10." "安装 xray" @@ -191,12 +194,12 @@ menu() { # success "18." "安装 wireguard" # success "19." "安装 wtrace (路由追踪工具 WorstTrace)" success "21." "检测 VPS流媒体解锁 (RegionRestrictionCheck)" - success "22." "检测 VPS信息/IO/到国内网速 (SuperBench)" - success "23." "检测 VPS信息/IO/到国际网速 (Bench.sh)" + success "22." "检测 VPS信息/IO/网速 (Bench.sh)" + success "23." "检测 VPS到国内网速" + # success "23." "检测 VPS到国内网速 (Superspeed)" success "24." "性能测试 (YABS)" success "25." "检测 回程路由 (BestTrace)" success "26." "检测 回程路由 (NextTrace)" - # success "25." "检测 到国内网速(电信/移动/联通) (Superspeed)" # success "25." "检测 VPS信息/IO/路由 (LemonBench)" # success "29." "性能测试 (UnixBench)" # success "31." "DD重装Linux系统" @@ -233,8 +236,8 @@ main() { # elif [[ "$num" == "18" ]]; then install_wireguard # elif [[ "$num" == "19" ]]; then install_tool "wtrace" elif [[ "$num" == "21" ]]; then unlock_test - elif [[ "$num" == "22" ]]; then super_bench - elif [[ "$num" == "23" ]]; then bench + elif [[ "$num" == "22" ]]; then bench + elif [[ "$num" == "23" ]]; then speedtest elif [[ "$num" == "24" ]]; then yabs elif [[ "$num" == "25" ]]; then besttrace elif [[ "$num" == "26" ]]; then nexttrace From 94be3255b115335eb068566add9463fc81a80fe2 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:09:17 +0800 Subject: [PATCH 153/165] fix: gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6fc1f56..b126229 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,4 @@ dmypy.json # Pyre type checker .pyre/ speedtest-cli/ +besttrace2021 From 3810e2e155a89d27d6b737b242b713ed19fb33b5 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:09:18 +0800 Subject: [PATCH 154/165] gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index b126229..4b04994 100644 --- a/.gitignore +++ b/.gitignore @@ -129,3 +129,4 @@ dmypy.json .pyre/ speedtest-cli/ besttrace2021 +geekbench_claim.url From fc130a2af51421e42ebcb306285ab03d5ef12e62 Mon Sep 17 00:00:00 2001 From: VPSDance Date: Tue, 1 Nov 2022 13:41:54 +0800 Subject: [PATCH 155/165] docs --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 1f87584..2efe2e8 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ Tools and Scripts for Linux VPS - VPS ToolBox(include all scripts) ```sh bash <(curl -Lso- https://sh.vps.dance/toolbox.sh) -# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) ``` - install ddns-go From b607406b36722a0b1c9854d4d9c9f756e332686d Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 1 Nov 2022 14:40:44 +0800 Subject: [PATCH 156/165] feat: docs --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 2efe2e8..11135b3 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ Tools and Scripts for Linux VPS diff --git a/autoNexttrace.sh b/autoNexttrace.sh index 8e6c5ab..8edb3fb 100644 --- a/autoNexttrace.sh +++ b/autoNexttrace.sh @@ -2,7 +2,6 @@ # Usage: # bash <(curl -Lso- https://sh.vps.dance/autoNexttrace.sh) -# bash <(curl -Lso- https://cdn.statically.io/gh/VPSDance/scripts/main/autoNexttrace.sh) # bash <(curl -Lso- https://cdn.jsdelivr.net/gh/VPSDance/scripts@main/autoNexttrace.sh) footer() { From 1335dd0ccc621de91c0160822afad3d0a83c14d7 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 8 Nov 2022 13:30:29 +0800 Subject: [PATCH 158/165] feat: speedtest --- files/ipt.js | 114 --------------------------------------------------- speedtest.sh | 2 + toolbox.sh | 4 ++ 3 files changed, 6 insertions(+), 114 deletions(-) delete mode 100644 files/ipt.js diff --git a/files/ipt.js b/files/ipt.js deleted file mode 100644 index 3627e09..0000000 --- a/files/ipt.js +++ /dev/null @@ -1,114 +0,0 @@ -// (function(){ -// https://purge.jsdelivr.net/gh/VPSDance/scripts@main/files/ipt.js - -// cp(text) -window.__cp = (text) => { - const dummy = document.createElement('textarea'); - document.body.appendChild(dummy); - dummy.value = text; - dummy.select(); - document.execCommand('copy'); - document.body.removeChild(dummy); -} - -window.__tr = () => { - // const name = $('#note :selected').text(); - let html = ``; - const lines = $('#trace tbody tr').map((_, line) => { - let [ttl, ip, host, location, as, time] = $(line).find('td').toArray().map(o => o.innerText.split('\n')); - const valIndex = ip.findLastIndex(o => !!o && o !== '*'); - const val = (arr) => arr[valIndex] || arr[0]; - [ttl, host, ip, time, as, location] = [val(ttl), val(host), val(ip), val(time), val(as), val(location)]; - ip = (ip === host ? '' : ` (${ip})`); - time = time.split(' / ')[1] || time; - return host === '*' ? `${ttl} *` : `${ttl} ${host}${ip} ${time}ms ${as} ${location}`; - }); - html = lines.toArray().reduce((acc, curr) => { - [last = ''] = acc.slice(-1) - if (last.slice(-1) + curr.slice(-1) === '**') acc.pop(); - acc.push(curr); - return acc; - }, []).join('\n'); - console.warn(html); - // __cp(html); - return html; -} -// tr(); - -window.__process = (item) => new Promise((resolve, reject) => { - const cb = (text) => { - clearTimeout(item._t); - clearInterval(item._i); - resolve({ ...item, text }); - } - $('select[name="id"]').val(item.id); - // return setTimeout(() => cb('test ' + item.name), 2 * 1000); - try { - $('#btn').trigger('click'); - } catch (error) { console.warn(error); } - try { - $('#ps').submit(); - } catch (error) { console.warn(error); } - const l = $('#load'); - item._t = setTimeout(() => cb(''), 1000 * 60 * 2); // timeout - item._i = setInterval(() => { - const done = l.is(':hidden'); - if (!done) return; - cb($('#trace tbody tr').length > 1 ? __tr() : ''); - }, 1000); -}); -window.__queue = (items) => { - if (!$('#ip').val()) return Promise.reject('no ip'); - let arr = []; - const run = async () => { - for(let o of items) { - let v = await __process(o); - arr.push(v); - } - return arr; - } - return run(); -}; -window.__init = () => { - const form = $('#ps'); - form.next('button').remove(); - form.after(''); - $('select[name="t"]').val('T'); - // $('select[name="id"]').val(); -} -__init(); - -__IDS__ = [ - {id: '896', name: '上海电信'}, - {id: '502', name: '广东电信'}, - {id: '764', name: '江苏电信'}, - {id: '11', name: '重庆电信'}, - - {id: '1240', name: '上海联通9929'}, - {id: '503', name: '广东联通'}, - {id: '765', name: '江苏联通'}, - // {id: '1078', name: '上海联通'}, - {id: '12', name: '重庆联通'}, - // {id: '662', name: '湖南联通'}, - - {id: '424', name: '广东移动'}, - {id: '766', name: '江苏移动'}, - {id: '924', name: '重庆移动'}, - // {id: '946', name: '重庆移动'}, -]; -// __IDS__ = [ {id: '503', name: '广东联通'}, {id: '424', name: '广东移动'}, ]; -window.__fetch = () => __queue(__IDS__).then(arr => { - // console.warn(arr); - const ip = $('#ip').val(); - const ipMask = ip.split('.').slice(0, 2).concat('*', '*').join('.'); - const ipReg = new RegExp(`\\b${ip.split('.').join('\\.')}\\b`, 'g'); - const data = [{text: `traceroute to ${ip}, 30 hops max, 32 byte packets` }, ...arr].filter(o => !!o.text) - .map(({ name, text }) => [name, text].filter(o => !!o).join('\n')).join(`\n${new Array(50).join('-')}\n`) - .replace(ipReg, ipMask); - console.warn(data); - window.__d__ = data; - $('#map_view').before(''); -}); - - -// }()); diff --git a/speedtest.sh b/speedtest.sh index 6ced3b8..97227b6 100755 --- a/speedtest.sh +++ b/speedtest.sh @@ -4,6 +4,8 @@ # https://github.com/ernisn/superspeed/blob/master/ServerList.md # https://github.com/flyzy2005/superspeed/blob/master/superspeed.sh # https://github.com/oooldking/script/blob/master/superbench.sh +# https://bench.im/hyperspeed +# https://www.infski.com/files/superspeed.sh ARCH=$(uname -m) # VERSION="1.1.1" diff --git a/toolbox.sh b/toolbox.sh index 82243ce..b504fe6 100755 --- a/toolbox.sh +++ b/toolbox.sh @@ -154,6 +154,9 @@ bench() { super_speed() { bash <(curl -Lso- $(raw 'ghproxy')/flyzy2005/superspeed/master/superspeed.sh) } +hyperspeed() { + bash <(curl -Lso- https://bench.im/hyperspeed) +} lemon_bench() { curl -fsSL http://ilemonra.in/LemonBenchIntl | bash -s fast } @@ -197,6 +200,7 @@ menu() { success "22." "检测 VPS信息/IO/网速 (Bench.sh)" success "23." "检测 VPS到国内网速" # success "23." "检测 VPS到国内网速 (Superspeed)" + # success "23." "检测 VPS网速 (hyperspeed)" success "24." "性能测试 (YABS)" success "25." "检测 回程路由 (BestTrace)" success "26." "检测 回程路由 (NextTrace)" From c7b07ea67e74bd1da566198f8a21ba0b566587f0 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 8 Nov 2022 13:32:25 +0800 Subject: [PATCH 159/165] feat: bashrc --- files/bashrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/files/bashrc b/files/bashrc index 1ab9f67..7633994 100644 --- a/files/bashrc +++ b/files/bashrc @@ -9,6 +9,9 @@ fi alias lsa="ls -lah --color=always" lsp() { ls -lah --color=always "$@" | awk '{k=0;for(i=0;i<=8;i++)k+=((substr($1,i+2,1)~/[rwx]/)*2^(8-i));if(k)printf(" %0o ",k);print}'; } +killport() { + lsof -i :$1 | grep LISTEN | awk '{print $2}' | xargs kill -9 +} alias ls='ls --color=auto' alias ll='ls --color=auto -lAF' From 30f60ee98e551f4015441b4a725fa3301669b61c Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 8 Nov 2022 13:34:42 +0800 Subject: [PATCH 160/165] feat: clean --- bashrc.sh | 2 +- ssh.sh | 2 +- toolbox.sh | 1 - tools.sh | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/bashrc.sh b/bashrc.sh index 46a3460..cdec700 100644 --- a/bashrc.sh +++ b/bashrc.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Usage: -# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/bashrc.sh) +# bash <(curl -Lso- https://sh.vps.dance/bashrc.sh) # allusers=$( cat /etc/passwd | grep -vE "(/bin/false|/sbin/nologin|/bin/sync|guest-)" | cut -d: -f1 ) diff --git a/ssh.sh b/ssh.sh index 26e149b..844792d 100644 --- a/ssh.sh +++ b/ssh.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # Usage: -# # bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/ssh.sh) [key|port] +# # bash <(curl -Lso- https://sh.vps.dance/ssh.sh) [key|port] # DISTRO=$( ([[ -e "/usr/bin/yum" ]] && echo 'CentOS') || ([[ -e "/usr/bin/apt" ]] && echo 'Debian') || echo 'unknown' ) # Colors diff --git a/toolbox.sh b/toolbox.sh index b504fe6..8c86721 100755 --- a/toolbox.sh +++ b/toolbox.sh @@ -2,7 +2,6 @@ # Usage: # bash <(curl -Lso- https://sh.vps.dance/toolbox.sh) -# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/toolbox.sh) # Colors RED='\033[0;31m' diff --git a/tools.sh b/tools.sh index 1b3ee20..fe53a19 100755 --- a/tools.sh +++ b/tools.sh @@ -2,7 +2,6 @@ # Usage: # bash <(curl -Lso- https://sh.vps.dance/tools.sh) [snell|snell4|realm|gost|ss|nali|wtrace|ddns-go|nexttrace] -# bash <(curl -Lso- https://raw.githubusercontent.com/VPSDance/scripts/main/tools.sh) # Colors RED='\033[0;31m' From 622cb9dbeef50eceb82438c63afc77b2660da7ca Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Fri, 2 Dec 2022 13:35:04 +0800 Subject: [PATCH 161/165] feat: for windows --- win/tool.cmd | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 win/tool.cmd diff --git a/win/tool.cmd b/win/tool.cmd new file mode 100644 index 0000000..1c1ecb8 --- /dev/null +++ b/win/tool.cmd @@ -0,0 +1,126 @@ +@ECHO OFF +:: https://sh.vps.dance/tool.cmd +:: References: nat.ee, https://t.me/nat_ee + +REM GBK/936 UTF-8/65001 +chcp 936>nul + +>nul 2>&1 "%SYSTEMROOT%\system32\caCLS.exe" "%SYSTEMROOT%\system32\config\system" +if '%errorlevel%' NEQ '0' ( +GOTO UACPrompt +) ELSE ( GOTO gotAdmin ) +:UACPrompt +ECHO Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs" +ECHO UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs" +"%temp%\getadmin.vbs" +exit /B +:gotAdmin +if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) +title tool.cmd +mode con: cols=36 lines=12 +color 17 +SET "wall=HKLM\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules" +SET "rdp=HKLM\SYSTEM\ControlSet001\Control\Terminal Server" +:Menu +CLS +ECHO. +ECHO 1.޸Զ˿ +ECHO. +ECHO 2.޸û +ECHO. +ECHO 3. +ECHO. +ECHO 4.ʾļչ +ECHO. +choice /C:1234 /N /M "ѡ [1,2,3,4]": +if errorlevel 4 GOTO:ShowHidden +if errorlevel 3 GOTO:Restart +if errorlevel 2 GOTO:Password +if errorlevel 1 GOTO:RemotePort +:ShowHidden +CLS +ECHO ʾļչ +:: Show hidden files +reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f +reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 1 /f +:: Show file extensions +reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v HideFileExt /t REG_DWORD /d 0 /f +taskkill /f /im explorer.exe >nul +start explorer >nul +TIMEOUT 3 >NUL +GOTO:Menu +:RemotePort +SET Port=3389 +CLS +ECHO ޸Զ˿ +ECHO. +ECHO ^" q ^"˵ +ECHO Ĭʹ 3389 ˿ +ECHO س (Enter) ȷ +ECHO. +SET /P "Port=Զ˿ڷΧ(1-65535):" +ECHO;%Port%|find " "&&goto:RemotePort +ECHO;%Port%|findstr "^0.*"&&goto:RemotePort +IF "%Port%" == "q" (GOTO:Menu) +IF "%Port%" == "0" (GOTO:RemotePort) +IF "%Port%" == "" (SET Port=3389) +IF %Port% LEQ 65535 ( +Reg add "%rdp%\Wds\rdpwd\Tds\tcp" /v "PortNumber" /t REG_DWORD /d "%Port%" /f > nul +Reg add "%rdp%\WinStations\RDP-Tcp" /v "PortNumber" /t REG_DWORD /d "%Port%" /f > NUL +Reg add "%wall%" /v "{338933891-3389-3389-3389-338933893389}" /t REG_SZ /d "v2.29|Action=Allow|Active=TRUE|Dir=In|Protocol=6|LPort=%Port%|Name=Remote Desktop(TCP-In)|" /f +Reg add "%wall%" /v "{338933892-3389-3389-3389-338933893389}" /t REG_SZ /d "v2.29|Action=Allow|Active=TRUE|Dir=In|Protocol=17|LPort=%Port%|Name=Remote Desktop(UDP-In)|" /f +CLS +ECHO. +ECHO ޸ijɹ +ECHO. +ECHO μǣԶ̶˿: %Port% +ECHO. +ECHO Ч +TIMEOUT 5 >NUL +GOTO:Menu +) ELSE ( +CLS +ECHO. +ECHO ˿: %Port% +ECHO õķΧ +ECHO ^"1 - 65535^"ڡ +TIMEOUT 3 >NUL +GOTO:RemotePort +) +:Password +SET pwd1= +SET pwd2= +CLS +ECHO ޸ĵǰû: %username% +ECHO. +ECHO ^" q ^"˵ +ECHO س (Enter) ȷ +ECHO. +SET /p pwd1=: +IF "%pwd1%" == "q" (GOTO:Menu) +CLS +ECHO. +ECHO ^" q ^"˵ +ECHO س (Enter) ȷ +ECHO. +SET /p pwd2=ٴ: +IF "%pwd2%" == "q" (GOTO:Menu) +IF "%pwd1%" == "%pwd2%" ( +CLS +net user "%username%" "%pwd2%"||PAUSE&&GOTO:Password +ECHO. +TIMEOUT 3 >NUL +GOTO:Menu +) ELSE ( +CLS +ECHO. +ECHO 롣 +TIMEOUT 3 >NUL +GOTO:Password +) +:Restart +CLS +ECHO ڵʱ +TIMEOUT /t 5 +shutdown.exe /r /f /t 0 +EXIT From c9eb3c72cc75f3e56bd33f4be6fb2d05054e43a0 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Fri, 2 Dec 2022 19:42:31 +0800 Subject: [PATCH 162/165] feat: utf8 --- win/tool.cmd | 53 ++++++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/win/tool.cmd b/win/tool.cmd index 1c1ecb8..a0f9050 100644 --- a/win/tool.cmd +++ b/win/tool.cmd @@ -2,8 +2,8 @@ :: https://sh.vps.dance/tool.cmd :: References: nat.ee, https://t.me/nat_ee -REM GBK/936 UTF-8/65001 -chcp 936>nul +:: utf-8 +chcp 65001>nul >nul 2>&1 "%SYSTEMROOT%\system32\caCLS.exe" "%SYSTEMROOT%\system32\config\system" if '%errorlevel%' NEQ '0' ( @@ -24,22 +24,22 @@ SET "rdp=HKLM\SYSTEM\ControlSet001\Control\Terminal Server" :Menu CLS ECHO. -ECHO 1.޸Զ˿ +ECHO 1. Change the RDP(Remote Desktop) Port ECHO. -ECHO 2.޸û +ECHO 2. Change Password of Administrator ECHO. -ECHO 3. +ECHO 3. Reboot ECHO. -ECHO 4.ʾļչ +ECHO 4. Show file extensions and hidden files ECHO. -choice /C:1234 /N /M "ѡ [1,2,3,4]": +choice /C:1234 /N /M "Type the number [1,2,3,4]": if errorlevel 4 GOTO:ShowHidden if errorlevel 3 GOTO:Restart if errorlevel 2 GOTO:Password if errorlevel 1 GOTO:RemotePort :ShowHidden CLS -ECHO ʾļչ +ECHO Show file extensions and hidden files :: Show hidden files reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v Hidden /t REG_DWORD /d 1 /f reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced" /v ShowSuperHidden /t REG_DWORD /d 1 /f @@ -52,13 +52,11 @@ GOTO:Menu :RemotePort SET Port=3389 CLS -ECHO ޸Զ˿ +ECHO Change the RDP Port (default: 3389) ECHO. -ECHO ^" q ^"˵ -ECHO Ĭʹ 3389 ˿ -ECHO س (Enter) ȷ +ECHO Press Enter to continue ECHO. -SET /P "Port=Զ˿ڷΧ(1-65535):" +SET /P "Port=Port range(1-65535):" ECHO;%Port%|find " "&&goto:RemotePort ECHO;%Port%|findstr "^0.*"&&goto:RemotePort IF "%Port%" == "q" (GOTO:Menu) @@ -71,19 +69,16 @@ Reg add "%wall%" /v "{338933891-3389-3389-3389-338933893389}" /t REG_SZ /d "v2.2 Reg add "%wall%" /v "{338933892-3389-3389-3389-338933893389}" /t REG_SZ /d "v2.29|Action=Allow|Active=TRUE|Dir=In|Protocol=17|LPort=%Port%|Name=Remote Desktop(UDP-In)|" /f CLS ECHO. -ECHO ޸ijɹ +ECHO Success, RDP Port: %Port% ECHO. -ECHO μǣԶ̶˿: %Port% -ECHO. -ECHO Ч +ECHO Please reboot to take effect TIMEOUT 5 >NUL GOTO:Menu ) ELSE ( CLS ECHO. -ECHO ˿: %Port% -ECHO õķΧ -ECHO ^"1 - 65535^"ڡ +ECHO Port: %Port% is invalid. +ECHO Port is out of range (1-65535) TIMEOUT 3 >NUL GOTO:RemotePort ) @@ -91,20 +86,16 @@ GOTO:RemotePort SET pwd1= SET pwd2= CLS -ECHO ޸ĵǰû: %username% +ECHO Change %username%'s password ECHO. -ECHO ^" q ^"˵ -ECHO س (Enter) ȷ +ECHO Press Enter to continue ECHO. -SET /p pwd1=: -IF "%pwd1%" == "q" (GOTO:Menu) +SET /p pwd1=New Password: CLS ECHO. -ECHO ^" q ^"˵ -ECHO س (Enter) ȷ +ECHO Press Enter to continue ECHO. -SET /p pwd2=ٴ: -IF "%pwd2%" == "q" (GOTO:Menu) +SET /p pwd2=Confirm password: IF "%pwd1%" == "%pwd2%" ( CLS net user "%username%" "%pwd2%"||PAUSE&&GOTO:Password @@ -114,13 +105,13 @@ GOTO:Menu ) ELSE ( CLS ECHO. -ECHO 롣 +ECHO Passwords do not match. TIMEOUT 3 >NUL GOTO:Password ) :Restart CLS -ECHO ڵʱ +ECHO The server will restart in 5 seconds TIMEOUT /t 5 shutdown.exe /r /f /t 0 EXIT From cfa677f5206cc15422651e00a915a1839155cbee Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Fri, 2 Dec 2022 19:45:11 +0800 Subject: [PATCH 163/165] feat: for en/zh win10 --- win/tool.cmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win/tool.cmd b/win/tool.cmd index a0f9050..8ebe53b 100644 --- a/win/tool.cmd +++ b/win/tool.cmd @@ -17,7 +17,7 @@ exit /B :gotAdmin if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" ) title tool.cmd -mode con: cols=36 lines=12 +mode con: cols=50 lines=16 color 17 SET "wall=HKLM\SYSTEM\ControlSet001\Services\SharedAccess\Parameters\FirewallPolicy\FirewallRules" SET "rdp=HKLM\SYSTEM\ControlSet001\Control\Terminal Server" From 9dbedb512af0af3643793fa0a5e999803b537cf4 Mon Sep 17 00:00:00 2001 From: cloudend Date: Mon, 19 Dec 2022 11:13:05 +0800 Subject: [PATCH 164/165] Update FUNDING.yml --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 347484f..50539ee 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -10,4 +10,5 @@ github: [cloudend] # issuehunt: # Replace with a single IssueHunt username # otechie: # Replace with a single Otechie username # lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry + custom:["https://www.paypal.me/bashscript"] From 9aa670a7c93c5976a0137b73a8da7af43509aa19 Mon Sep 17 00:00:00 2001 From: "vps.dance" Date: Tue, 17 Jan 2023 14:31:33 +0800 Subject: [PATCH 165/165] feat: usage --- tuning.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tuning.sh b/tuning.sh index 6ffaba2..8640e1e 100644 --- a/tuning.sh +++ b/tuning.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# tuning.sh +# curl https://sh.vps.dance/tuning.sh | bash # Reference: # https://www.cnblogs.com/tolimit/p/5065761.html