博文

目前显示的是标签为“perl”的博文

sed不支持非贪婪匹配 改用perl

问题 之前   Free.vps.vc 访问GitHub资源出错 用GithubProxy代理 用sed修改脚本内容 实践: bash <(curl -L  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/v2ray_wss/raw/main/install.sh   | sed -E "$(curl -L  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/gh-proxy/raw/master/sed-E-para )" ) 发现这个处理方法并不完美。 用grep github把涉及修改的地方输出一下。 curl -L  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/v2ray_wss/raw/main/install.sh   | sed -E "$(curl -L  https://github.crazypeace.workers.dev/ https://github.com/crazypeace/gh-proxy/raw/master/sed-E-para )" | grep github 发现,.sh 的部分, bash <(curl -L https://github.crazypeace.workers.dev/ https://raw.githubusercontent.com/v2fly/fhs-install-v2ray/master/install-release.sh | sed -E "$(curl -L https://github.com/crazypeace/gh-proxy/raw/master/sed-E-para)" ) --version 4.45.2 只在前面加了 github proxy,后面调用 GitHub 资源的部分并没有处理。 分析 查了一下资料发现,sed只有贪婪匹配,所以改用 perl 实操 perl用来做正则替换的参数为 -pe,里面同样支持sed语法的s命令 如 p

开了warp之后不能SSH登录

图片
问题: Abhi, [2023/1/17 11:08] Hello, how can I use wg-quick up in my gcp server and then ssh back to it??? Abhi, [2023/1/17 11:08] I want to add warp ip in my gcp server. But when I do wg-quick up, then I am unable to ssh into server Abhi, [2023/1/17 11:09] And my open vpn stop working 这看上去和woiden当时的情况很像 (开了warp以后就不能通过IPv4 SSH登录了) 所以解决方案也一样: 解决方案 https://github.com/crazypeace/warp.sh/blob/main/wgcf_postup_postdown.sh 原理 脚本 内容很简单: sed -i '/PostUp/d' /etc/wireguard/wgcf.conf sed -i '/PostDown/d' /etc/wireguard/wgcf.conf sed -i "7 s/^/PostUp = ip -4 rule add from $(ip route get 1.1.1.1 | grep -oP 'src \K\S+') lookup main\n/" /etc/wireguard/wgcf.conf sed -i "8 s/^/PostDown = ip -4 rule delete from $(ip route get 1.1.1.1 | grep -oP 'src \K\S+') lookup main\n/" /etc/wireguard/wgcf.conf 效果就是在 wgcf.conf 文件里添加两行: PostUp = ip -4 rule add from 192.168.0.6 lookup main PostDown = ip -4 rule delete from 192.168.0.6 lookup main (上面这个例子是woiden里面跑起来的效

The Hot3 in Last 30 Days

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

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