Skip to content

Instantly share code, notes, and snippets.

View jinmiaoluo's full-sized avatar
🎯
Focusing

Jinmiao Luo jinmiaoluo

🎯
Focusing
View GitHub Profile
@jinmiaoluo
jinmiaoluo / nrpt.ps1
Last active November 29, 2023 10:19
Windows NRPT PowerShell 管理脚本,用于实现 Windows 平台的 DNS 分流
# 作用:
#
# 将特定的域名及其所有子域名的 DNS 解析请求,通过指定的 DNS 服务器进行解析,即 DNS 分流
#
# 请在 PowerShell 管理员权限下运行,用法如下:
#
# 将脚本保存为 nrpt.ps1 文件
#
# 在脚本所在目录内创建 domains.txt 文件,将需要分流的域名,每个域名一行添加到文件内,比如
#
0x520F729825d84BbF2b23627e0C8218953366DDeD
#!/bin/bash
set -xe
export DISPLAY=':0'
export XAUTHORITY='/home/jinmiaoluo/.Xauthority'
intern=$(xrandr | grep 'Screen\ 0' -A1 | awk 'NR==2{print $1}' | grep -v '^$')
extern=$(xrandr | grep ' connected' | grep -v ${intern} | awk '{print $1}')
user=jinmiaoluo
@jinmiaoluo
jinmiaoluo / wgsh
Last active September 26, 2018 12:17
gist of script for managing wireguard. wgsh means WireGuard SHell script which will be used in client for wireguard. wgssh means WireGuard Server SHell script which will be used in server for wireguard
#!/bin/bash
#################################################
# note: wireguard-go is required
# please install it before use this script
# you can install wireguard-go with below command
# brew install wireguard-go
#################################################
IF='utun3'