博文

目前显示的是 二月, 2023的博文

在IPv6 only FreeVPSvc VPS访问GitHub一键脚本失败的时候,用GitHub Proxy解决问题

图片
原理: Free.vps.vc 访问GitHub资源出错 用GithubProxy代理 用sed修改脚本内容 sed不支持非贪婪匹配 改用perl 网页工具 https://crazypeace.github.io/gh-proxy/ https://ghproxy.crazypeace.workers.dev/ 使用演示 实例: 极简一键脚本 搭V2Ray 修改前 bash <(curl -L  https://github.com/crazypeace/v2ray_wss/raw/main/install.sh ) 修改后 bash <(curl -L  https://ghproxy.crazypeace.workers.dev/ https://github.com/crazypeace/v2ray_wss/raw/main/install.sh   | perl -pe "$(curl -L  https://ghproxy.crazypeace.workers.dev/ https://github.com/crazypeace/gh-proxy/raw/master/perl-pe-para )" ) 一键WARP开IPv4入站 修改前 bash <(curl -L  https://raw.githubusercontent.com/P3TERX/warp.sh/main/warp.sh ) 4 修改后 bash <(curl -L  https://ghproxy.crazypeace.workers.dev/ https://raw.githubusercontent.com/P3TERX/warp.sh/main/warp.sh   | perl -pe "$(curl -L  https://ghproxy.crazypeace.workers.dev/ https://github.com/crazypeace/gh-proxy/raw/master/perl-pe-para )" ) 4

Free.vps.vc 访问GitHub资源出错 用GithubProxy代理 用sed修改脚本内容

图片
问题 Free.vps.vc 访问GitHub资源出错 --update sed不支持非贪婪匹配 改用perl 修改后 bash <(curl -L  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/v2ray_wss/raw/main/install.sh   | perl -pe "$(curl -L  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/gh-proxy/raw/master/perl-pe-para )" ) 解决思路 用 GitHub Proxy 代理 source:  https://github.com/hunshcn/gh-proxy 要么fork一份脚本,自己修改添加gh-proxy,如下文教程 如何设置自定义gh-proxy参数使用我的warp脚本 要么就把脚本下载到本地,然后修改脚本。有手搓和sed命令替换两条路。 手搓方法 1. 自己搭 或者 使用现成的 GitHub Proxy . 以  https://github.crazypeace.workers.dev/  为例 2. 在你的 GitHub 资源 url 的前面加上 GitHub Proxy 的 url  如: bash <(curl -L https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) 修改为 bash <(curl -L  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/v2ray_wss/raw/main/install.sh) 3. 如果你的资源是一个脚本,而这个脚本里面访问了GitHub资源 3.1 那么你可以先 wget 下来 wget  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/v2ray_wss/raw/main/install.sh 这里下载下来的是文件名是 install.sh

sed 命令中的 / 可以用任意字符替换 特别地当处理网址相关问题时

官方说明: The  /  characters may be uniformly replaced by any other single character within any given  s  command. The  /  character (or whatever other character is used in its stead) can appear in the  regexp  or  replacement  only if it is preceded by a  \  character. 来源: https://www.gnu.org/software/sed/manual/sed.html#The-_0022s_0022-Command 如: sed -E 's#(http.*github[^/]*/)#https://github.crazypeace.workers.dev/\1#g' 和 sed -E 's/(http.*github[^/]*\/)/https:\/\/github.crazypeace.workers.dev\/\1/g' 等同。

sed -e 和 sed -E 的区别 如果讨厌在(前面加\,那么就使用 -E参数吧

图片
官方说明:   -E, -r, --regexp-extended                  use extended regular expressions in the script                  (for portability use POSIX -E). 详细解释 5.2 Basic (BRE) and extended (ERE) regular expression Basic and extended regular expressions are two variations on the syntax of the specified pattern. Basic Regular Expression (BRE) syntax is the default in  sed  (and similarly in  grep ). Use the POSIX-specified  -E  option ( -r ,  --regexp-extended ) to enable Extended Regular Expression (ERE) syntax. In GNU  sed , the only difference between basic and extended regular expressions is in the behavior of a few special characters: ‘ ? ’, ‘ + ’, parentheses, braces (‘ {} ’), and ‘ | ’. With basic (BRE) syntax, these characters do not have special meaning unless prefixed with a backslash (‘ \ ’); While with extended (ERE) syntax it is reversed: these characters are special unless they are prefixed with backslash (‘ \ ’). source:  https://www.gnu.org/software/sed/manual/sed.html#BRE-vs-ERE

Hax Woiden IPv6 only VPS 开启 TUN 为了安装 WARP

图片
需求 Hax 的 US3 最近放机了,申请成功以后,发现网页控制板上没有开启TUN模式的按钮. 所以需要通过命令行开启TUN模式. Linux开启TUN的shell命令 (适合复制粘贴到 Xshell 的 撰写窗格 , 或者 Termius 的 Snippets ) cd /dev  mkdir net  mknod net/tun c 10 200  chmod 0666 net/tun 一行命令的形式  (适合放到 Xshell 的快速命令栏) cd /dev && mkdir net && mknod net/tun c 10 200 && chmod 0666 net/tun  测试 通过下面的命令检测是否打开 TUN cat /dev/net/tun 如果返回如下,则说明TUN已经打开 cat: /dev/net/tun: File descriptor in bad state 参考 https://blog.csdn.net/Aria_Miazzy/article/details/93637632 操作日志 实测 Hax US3 OpenVZ 可以命令行打开 TUN 模式,安装 Warp root@5128783602hax:/dev# mkdir net root@5128783602hax:/dev# mknod net/tun c 10 200 root@5128783602hax:/dev# chmod 0666 net/tun root@5128783602hax:/dev# cat /dev/net/tun cat: /dev/net/tun: File descriptor in bad state root@5128783602hax:~# bash <(curl -fsSL git.io/warp.sh) 4 __         __ _     _ __ _   _ __ _     _ __            _         _ _            \ \       / / \   |   _ \ |   _ \   |_ _ |_ _ _   _ __ | |_ _ _ _| | | _ __ _ _ _  

caddy自行编译, 同时打包 naive 和 trojan 插件共存, 同时可以作为V2ray/Xray的前置web服务器

图片
搭建 Go 环境 wget https://go.dev/dl/go1.19.5.linux-amd64.tar.gz rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.5.linux-amd64.tar.gz export PATH=$PATH:/usr/local/go/bin 检查环境是否搭好了 go version 应该输出 go 的版本 编译 安装 xcaddy go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest 编译 caddy 带上插件 naive 和 trojan ~/go/bin/xcaddy build --with github.com/caddyserver/forwardproxy@caddy2=github.com/klzgrad/forwardproxy@naive --with github.com/imgk/caddy-trojan 使用 配置Caddyfile {   order forward_proxy before file_server   order trojan before file_server   servers :443 {     listener_wrappers {       trojan     }   }   trojan {     caddy     no_proxy     users e16d9cb045d7  #密码   } } :443, npp.tzzhu.gq:443 {   tls e16d9cb045d7@gmail.com   forward_proxy {     basic_auth e16d9cb045d7 e16d9cb045d7   #密码     hide_ip     hide_via     probe_resistance   }   file_server {     root /var/www/html   } } trj.tzzhu.gq:443 {   tls e16d9cb045d7@gmail.com   trojan {     connect_method     websocket   }   file_

The Hot3 in Last 30 Days

无服务器 自建短链服务 Url-Shorten-Worker 完整的部署教程

ClouDNS .asia免费域名 托管到CloudFlare开CDN白嫖Websocket WS通道翻墙 / desec.io