josexy's recent timeline updates
josexy

josexy

V2EX member #559327, joined on 2021-10-22 13:46:23 +08:00
josexy's recent replies
Oct 15, 2024
Replied to a topic by tangshuier 软件 大家一般用什么笔记软件
Typora+GitHub
Jun 28, 2024
Replied to a topic by jeesk macOS macos 普通用户如何不使用密码修改代理设置?
参考 sing-box: https://github.com/SagerNet/sing-box/blob/dev-next/common/settings/proxy_darwin.go

networksetup -setwebproxy
networksetup -setsecurewebproxy
networksetup -setsocksfirewallproxy
Nov 26, 2023
Replied to a topic by Jony4Fun macOS 墙裂推荐大家用 orbstack 代替 docker desktop
好像 k8s 不能直接 containerd 容器?
Jul 6, 2023
Replied to a topic by rrubick 游戏 求推荐手机上的游戏
这里我要点名一款二字游戏(🐶)
Apr 8, 2023
Replied to a topic by zeep macOS macOS 有沒有快捷修改 socks 代理的小工具
把下面的 shell 脚本保存到一个文件:set_proxy.sh

```shell

#!/bin/bash

function scutil_query {
key=$1
scutil <<EOT
open
get $key
d.show
close
EOT
}

SERVICE_GUID=$(scutil_query State:/Network/Global/IPv4 | grep "PrimaryService" | awk '{print $3}')
currentservice=$(scutil_query Setup:/Network/Service/$SERVICE_GUID | grep "UserDefinedName" | awk -F': ' '{print $2}')

set_proxy() {
http=$1
socks=$2
if [[ -z $http ]] && [[ -z $socks ]]; then
return 0
fi

# http 代理
if [[ ! -z $http ]]; then
networksetup -setwebproxystate "$currentservice" on
networksetup -setsecurewebproxystate "$currentservice" on
hostname=$(echo "$http" | awk -F ':' '{print $1}')
port=$(echo "$http" | awk -F ':' '{print $2}')
networksetup -setwebproxy "$currentservice" $hostname $port
networksetup -setsecurewebproxy "$currentservice" $hostname $port
fi

# socks 代理
if [[ ! -z $socks ]]; then
networksetup -setsocksfirewallproxystate "$currentservice" on
hostname=$(echo "$socks" | awk -F ':' '{print $1}')
port=$(echo "$socks" | awk -F ':' '{print $2}')
networksetup -setsocksfirewallproxy "$currentservice" $hostname $port
networksetup -setsocksfirewallproxy "$currentservice" $hostname $port
fi

# 设置代理绕过的域名
networksetup -setproxybypassdomains "$currentservice" 192.168.0.0/16 10.0.0.0/8 172.16.0.0/12 127.0.0.1 localhost "*.local" timestamp.apple.com
}

# 取消代理设置
unset_proxy() {
networksetup -setwebproxy "$currentservice" "" "" off "" ""
networksetup -setsecurewebproxy "$currentservice" "" "" off "" ""
networksetup -setsocksfirewallproxy "$currentservice" "" "" off "" ""

networksetup -setwebproxystate "$currentservice" off
networksetup -setsecurewebproxystate "$currentservice" off
networksetup -setsocksfirewallproxystate "$currentservice" off

networksetup -setproxybypassdomains "$currentservice" Empty
}

if [[ $1 == "http" ]]; then
set_proxy $2 ""
elif [[ $1 == "socks" ]]; then
set_proxy "" $2
else
unset_proxy
fi

```

使用:
```shell
bash set_proxy.sh http 127.0.0.1:10086 # 设置 http 和 https 代理
bash set_proxy.sh socks 127.0.0.1:10086 # 设置 socks5 代理
bash set_proxy.sh # 恢复
```
Mar 29, 2023
Replied to a topic by voidmnwzp 程序员 前端现在这么恶心的吗
给个 github 链接,我去看看写的如何👀
Mar 29, 2023
Replied to a topic by wwxxx MacBook Pro 大家的 mac 一般用什么键盘
keychron k3
Mar 29, 2023
Replied to a topic by dunhanson 程序员 Typora 怎么像 VS Code 那样多标签显示?
macos 可以通过⌘+T 打开多个标签页,其他不知道。typora 版本:1.3.6
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3444 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 31ms · UTC 00:38 · PVG 08:38 · LAX 17:38 · JFK 20:38
♥ Do have faith in what you're doing.