V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  guzzhao  ›  全部回复第 2 页 / 共 12 页
回复总数  221
1  2  3  4  5  6  7  8  9  10 ... 12  
116 天前
回复了 aaxaax 创建的主题 Apple 为什么国行要限制充电频率啊?
销量这么高为什么要改, 参考内存硬盘
分子
分母
我自己在写的拓展有个功能和你的类似,就是不知道图标怎么获取
195 天前
回复了 wxyoung 创建的主题 程序员 求大神指导下 wsl2 的网络配置
我现在用的 mirrored,下面的配置是之前的,也可以固定 ip,可以试试




## ~~使用桥接网络 固定 ip 以及其他配置~~

1. Hyper-V 虚拟机创建外部虚拟交换机
2. 修改.wslconfig
```
[wsl2]
networkingMode=bridged
vmSwitch=替换成你创建的虚拟交换机名称
dhcp=false
```

> 当 dhcp=false 时会读取 `/lib/systemd/network/wsl_external.network` 的网络配置

`vim /lib/systemd/network/wsl_external.network`
```ini
[Match]
Name=eth0
[Network]
Description=bridge
DHCP=false
Address=192.168.1.10/24 # 自行修改
Gateway=192.168.0.1 # 自行修改

```

**修改 DNS 禁止自动生成**

添加 `/etc/wsl.conf` 加入以下内容

```ini
[boot]
systemd=true
[network]
generateResolvConf = false
```

```bash
rm -f /etc/resolv.conf
echo "nameserver 223.5.5.5" > /etc/resolv.conf
```

3. 重新启动 WSL 子系统
220 天前
回复了 Ashe007 创建的主题 程序员 chocolatey 安装 Git 软件(Windows 系统)
用 scoop
scoop update *
妙界吗,我也有点心动,就是怕质量不好
分子
244 天前
回复了 Livid 创建的主题 V2EX 站点状态 20240505 - 邀请码系统
我邮箱和 google 是两个账号,有没有办法合并 https://i.imgur.com/huX6coX.png
分母
254 天前
回复了 b1t 创建的主题 问与答 突然好奇, Obsidian 是用什么框架开发的?
electron+codemirror
264 天前
回复了 fyxtc 创建的主题 问与答 你们梯子的‘漏网之鱼’都是怎么处理的
我用的是 clash verge 的脚本
```

const mainSelect = "🚀 节点选择"
const autoSelect = "🎃 自动选择"
const otherSelect = "🐟 漏网之鱼"
const githubProxyUrl = "https://ghproxy.net/https://raw.githubusercontent.com/"
const myProxyUrlList = [
'npmmirror.com'
]
const myDirectUrlList = [
]



function main(params) {

initDns(params)
initGroups(params)
initRules(params)
delParams(params)
// 自定义
microsoftRules(params)
myRules(params)
return params;
}

function initGroups(params) {

const proxies = params["proxies"].map(e => e.name)

const groupFilter = {
"🇭🇰 香港 自动选择": "港|HK|Hong",
"🇯🇵 日本 自动选择": "日|东京|JP|Japan",
"🇸🇬 新加坡 自动选择": "新|坡|獅|SG|Singapore"
}

let auto = Object.keys(groupFilter).map(gf => {
return {
name: gf,
type: 'url-test',
url: 'https://cp.cloudflare.com/generate_204',
tolerance: 20,
proxies: proxies.filter(p => new RegExp(groupFilter[gf]).test(p))
}
}).filter(e => e.proxies.length > 0)

const proxyGroups = [
{
name: mainSelect,
type: 'select',
proxies: [autoSelect, ...auto.map(e => e.name), ...proxies]
},
{
name: otherSelect,
type: 'select',
proxies: [mainSelect, 'DIRECT']
},
{
name: autoSelect,
type: 'url-test',
url: 'https://cp.cloudflare.com/generate_204',
tolerance: 20,
proxies: proxies
}, ...auto
]

params["proxy-groups"] = proxyGroups
}

function initRules(params) {

let baseUrl = githubProxyUrl + "Loyalsoldier/clash-rules/release/";
let ruleProvidersKeys = [
'reject',
'icloud',
'apple',
// 'google',
'proxy',
'direct',
'private',
// 'gfw', proxy 包含 gfw
'tld-not-cn',
// 'telegramcidr',
'cncidr',
'lancidr',
'applications']

let ruleProviders = {}
ruleProvidersKeys.forEach(e => {
ruleProviders[e] = {
type: "http",
behavior: "domain",
url: baseUrl + `${e}.txt`,
path: `./ruleset/${e}.yaml`,
interval: 86400
}
})

let rules = [
"RULE-SET,applications,DIRECT",
"DOMAIN,clash.razord.top,DIRECT",
"DOMAIN,yacd.haishan.me,DIRECT",
"RULE-SET,private,DIRECT",
"RULE-SET,reject,REJECT", // 广告域名列表
"RULE-SET,icloud,DIRECT",
"RULE-SET,apple,DIRECT",
// "RULE-SET,google," + mainSelect, Google 在中国大陆可直连的域名列表
"RULE-SET,direct,DIRECT",
"RULE-SET,lancidr,DIRECT",
"RULE-SET,cncidr,DIRECT",
// "RULE-SET,telegramcidr," + mainSelect,
"RULE-SET,proxy," + mainSelect,
"GEOIP,CN,DIRECT,no-resolve",
"MATCH," + otherSelect
]

params["rule-providers"] = ruleProviders
params["rules"] = rules

}

function initDns(params) {
params["dns"] = {
"enable": true,
"ipv6": false,
"listen": "0.0.0.0:1053",
"default-nameserver": [
"223.5.5.5",
"119.29.29.29",
"114.114.114.114"
],
"enhanced-mode": "fake-ip",
"fake-ip-range": "28.0.0.1/8",
"use-hosts": true,
"nameserver": [
"tls://223.5.5.5:853",
"tls://223.6.6.6:853",
"https://doh.pub/dns-query",
"https://dns.alidns.com/dns-query"
],
"fallback": [
"https://doh.dns.sb/dns-query",
"https://dns.cloudflare.com/dns-query",
"https://dns.twnic.tw/dns-query",
"tls://8.8.4.4:853"
],
"fallback-filter": {
"geoip": true,
"ipcidr": [
"240.0.0.0/4",
"0.0.0.0/32"
]
}
}
}

function delParams(params) {
delete params["cfw-conn-break-strategy"]
delete params["experimental"]
delete params["hosts"]
delete params["cfw-latency-timeout"]
delete params["cfw-latency-url"]
delete params["clash-for-android"]
delete params["udp"]


}

function microsoftRules(params) {

let baseUrl = githubProxyUrl + "blackmatrix7/ios_rule_script/master/rule/Clash/";
let microsoftProviders = {
'microsoft': {
type: "http",
behavior: "classical",
url: baseUrl + "Microsoft/Microsoft.yaml",
path: `./ruleset/microsoft.yaml`,
interval: 86400
},
"bing": {
type: "http",
behavior: "classical",
url: baseUrl + "Bing/Bing.yaml",
path: `./ruleset/bing.yaml`,
interval: 86400
},
"oneDrive": {
type: "http",
behavior: "classical",
url: baseUrl + "OneDrive/OneDrive.yaml",
path: `./ruleset/oneDrive.yaml`,
interval: 86400
},
}

let microsoftRules = [
"RULE-SET,microsoft,Microsoft",
"RULE-SET,bing,Microsoft",
"RULE-SET,oneDrive,Microsoft"
]
let microsoftGroup = {
name: 'Microsoft',
type: 'select',
proxies: [mainSelect, "DIRECT"]
}

params["rule-providers"] = { ...microsoftProviders, ...params["rule-providers"] }
params["rules"] = [...microsoftRules, ...params["rules"]]
params["proxy-groups"] = [...params["proxy-groups"], microsoftGroup]

}


function myRules(params) {
let rules = [
...myDirectUrlList.map(e => 'DOMAIN-SUFFIX,' + e + ',DIRECT'),
...myProxyUrlList.map(e => 'DOMAIN-SUFFIX,' + e + ',' + mainSelect),
]

console.log(rules)
params["rules"] = [...rules, ...params["rules"]]
}




```
这种🐥能运行啥东西
1  2  3  4  5  6  7  8  9  10 ... 12  
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2710 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 37ms · UTC 03:42 · PVG 11:42 · LAX 19:42 · JFK 22:42
Developed with CodeLauncher
♥ Do have faith in what you're doing.