Skip to content

Instantly share code, notes, and snippets.

View zhihuiyuze's full-sized avatar
😼

慧择 - Brandon zhihuiyuze

😼
View GitHub Profile
### Keybase proof
I hereby claim:
* I am zhihuiyuze on github.
* I am zhihuiyuze (https://keybase.io/zhihuiyuze) on keybase.
* I have a public key ASC4My_Uxie04I2RHmqx8aqFNIQg4yqBQOacV1om_jyybAo
To claim this, I am signing this object:
@zhihuiyuze
zhihuiyuze / openwrt-autoipset
Last active June 26, 2021 16:47
openwrt china ipset | openwrt mwan3分流 ipset
#!/bin/sh /etc/rc.common
# OpenWrt /etc/init.d/ script to automatically add ipsets across reboots
# For more info about how to write init scripts https://openwrt.org/docs/techref/initscripts
#
# howto:
# - #mkdir -p /etc/ipset/
# - upload this file as /etc/init.d/autoipset
# - # chmod 755 /etc/init.d/autoipset
# - # /etc/init.d/autoipset enable
@zhihuiyuze
zhihuiyuze / udp2raw
Created June 26, 2021 16:48
openwrt udp2raw service
#!/bin/sh /etc/rc.common
# Copyright (C) 2008-2012 OpenWrt.org
USE_PROCD=1
START=95
STOP=01
start_service()
{
procd_open_instance
procd_set_param command /usr/bin/udp2raw --conf-file /etc/udp2raw/.conf
@zhihuiyuze
zhihuiyuze / bgpq4_prefix.sh
Last active April 29, 2022 11:13
bgpq4 get IP and save to bird configuration file Automatically read prefix from AS-SET using bgpq4
as_set=("AS-HUIZE" "AS141011")
prefix=$(bgpq4 -b -A -6 ${as_set[*]} -R 48 -l allowed_prefix)
if [[ "$prefix" =~ ^ERROR.* ]]; then
exit
else
echo "$prefix" > /etc/bird/filters/allowed_prefix.conf