Skip to content

Instantly share code, notes, and snippets.

View huhongbo's full-sized avatar

huhongbo huhongbo

  • Hangzhou,Zhejiang,China
View GitHub Profile
@huhongbo
huhongbo / countries.json
Created January 13, 2023 02:03 — forked from jacobbubu/countries.json
Chinese country names and their ISO code
[
{
"ISO2": "AD",
"ISO3": "AND",
"DIGITS": "20",
"ISO-3166-2": "ISO 3166-2:AD",
"English": " Andorra",
"China": "安道尔",
"Taiwan": "安道爾",
"Hongkong": "安道爾",
# /etc/udev/rules.d/70-persistent-net.rules
SUBSYSTEM=="ieee80211", ACTION=="add|change", ATTR{macaddress}=="b8:27:eb:ff:ff:ff", KERNEL=="phy0", \
RUN+="/sbin/iw phy phy0 interface add ap0 type __ap", \
RUN+="/bin/ip link set ap0 address b8:27:eb:ff:ff:ff"
@huhongbo
huhongbo / ga.js
Created May 15, 2020 06:27 — forked from Asikur22/ga.js
GA Scripts #GA
ga('send', 'event', [eventCategory], [eventAction], [eventLabel], [eventValue], [fieldsObject]);
// For analytics.js
<script>
jQuery( document ).ready(function($) {
jQuery('a[href^="tel:"]').on('click', function() {
var n = jQuery(this).attr('href').replace('tel:', '');
ga('send', 'event', 'Phone Click Tracking', n, 'Click to Call', n);
});
jQuery('a[href^="mailto:"]').on('click', function() {
This file has been truncated, but you can view the full file.
V2Ray 3.25 (die Commanderin) Custom
A unified platform for anti-censorship.
gc 1 @1.636s 0%: 0.26+2.1+0.22 ms clock, 1.0+0.25/1.5/3.4+0.89 ms cpu, 4->4->1 MB, 5 MB goal, 4 P
gc 2 @1.679s 0%: 0.017+2.9+0.46 ms clock, 0.070+0.43/2.4/2.3+1.8 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
gc 3 @1.711s 0%: 0.020+2.6+0.52 ms clock, 0.081+0.39/2.2/3.9+2.1 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
gc 4 @1.738s 0%: 0.011+3.5+0.60 ms clock, 0.047+0.41/3.1/2.5+2.4 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
gc 5 @1.772s 0%: 0.011+4.5+0.45 ms clock, 0.046+0.40/3.9/2.2+1.8 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
gc 6 @1.805s 0%: 0.011+2.3+0.61 ms clock, 0.046+0.40/1.3/3.7+2.4 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
gc 7 @1.830s 0%: 0.013+2.3+0.60 ms clock, 0.052+0.28/2.1/3.6+2.4 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
gc 8 @1.860s 0%: 0.012+2.3+0.47 ms clock, 0.050+0.40/1.3/4.0+1.8 ms cpu, 4->4->2 MB, 5 MB goal, 4 P
goroutine profile: total 273
42 @ 0x42c3ca 0x42c47e 0x404212 0x403ecb 0x5fe561 0x5ff22e 0x5a8ec8 0x5a91fa 0x5a9448 0x94a4b2 0x566b57 0x457151
# 0x5fe560 v2ray.com/core/transport/pipe.(*pipe).ReadMultiBuffer+0x40 /root/work/src/v2ray.com/core/transport/pipe/impl.go:75
# 0x5ff22d v2ray.com/core/transport/pipe.(*Reader).ReadMultiBuffer+0x2d /root/work/src/v2ray.com/core/transport/pipe/reader.go:16
# 0x5a8ec7 v2ray.com/core/common/buf.(*copyHandler).readFrom+0x37 /root/work/src/v2ray.com/core/common/buf/copy.go:20
# 0x5a91f9 v2ray.com/core/common/buf.copyInternal+0x69 /root/work/src/v2ray.com/core/common/buf/copy.go:85
# 0x5a9447 v2ray.com/core/common/buf.Copy+0xa7 /root/work/src/v2ray.com/core/common/buf/copy.go:109
# 0x94a4b1 v2ray.com/core/proxy/vmess/outbound.(*Handler).Process.func2+0x381 /root/work/src/v2ray.com/core/proxy/vmess/outbound/outbound.go:136
# 0x566b56 v2ray.com/core/common/task.executeParallel.func1+0x26 /root/work/src/v2ray.com/core/common/task/task.go:110
@huhongbo
huhongbo / letsencrypt_2017.md
Created March 13, 2018 12:13 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two main modes to run the Let's Encrypt client (called Certbot):

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80).

In the following, we're setting up mydomain.com. HTML is served from /var/www/mydomain, and challenges are served from /var/www/letsencrypt.

@huhongbo
huhongbo / setup_radsrv_mysql.sh
Created December 25, 2017 02:49 — forked from xjdrew/setup_radsrv_mysql.sh
setup radius server using mysql
#!/bin/bash
#
MYSQL_HOST=127.0.0.1
MYSQL_PORT=3306
MYSQL_ROOT_PWD=mysql123
# 数据库名字默认为radius,建议不改
MYSQL_RADIUS_USER=freeradius
MYSQL_RADIUS_PWD=freeradius123
### Keybase proof
I hereby claim:
* I am huhongbo on github.
* I am huhongbo (https://keybase.io/huhongbo) on keybase.
* I have a public key whose fingerprint is B283 CEE8 157C 09B9 AE68 3E5E 5EB7 6B35 F1F6 FED0
To claim this, I am signing this object:
@huhongbo
huhongbo / ss-redir 透明代理.md
Created November 20, 2015 09:21 — forked from wen-long/ss-redir 透明代理.md
ss-redir 透明代理.md

##ss-redir 的 iptables 配置(透明代理)

透明代理指对客户端透明,客户端不需要进行任何设置就使用了网管设置的代理规则

创建 /etc/ss-redir.json 本地监听 7777 运行ss-redir -v -c /etc/ss-redir.json

iptables -t nat -N SHADOWSOCKS
# 在 nat 表中创建新链
iptables -t nat -A SHADOWSOCKS -p tcp --dport 23596 -j RETURN
# 23596 是 ss 代理服务器的端口,即远程 shadowsocks 服务器提供服务的端口,如果你有多个 ip 可用,但端口一致,就设置这个
[sample data]
system.cpu.wait,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=0.0 1435294798
system.cpu.system,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=2.14 1435294798
system.cpu.user,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=1.11 1435294798
system.cpu.idle,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=96.75 1435294798
system.cpu.stolen,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=0.0 1435294798
system.mem.phys_used,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=59186.0 1435294798
system.mem.phys_pct_usable,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=0.5347154282164764 1435294798
system.mem.phys_free,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=5209.0 1435294798
system.mem.phys_total,api_key=554321df9d6adb0d05be83f90c0f1f38,region=default,hostname=test value=64395