Skip to content

Instantly share code, notes, and snippets.

View owlwang's full-sized avatar
👨‍💻
emmmm

owlwang owlwang

👨‍💻
emmmm
View GitHub Profile
@owlwang
owlwang / tibrr-cookie-consent.html
Created April 21, 2021 11:54 — forked from zhanglianxin/tibrr-cookie-consent.html
简化自 https://www.cloudflare.com/apps/cookie-consent ,版权归原作者所有,此例仅供学习研究使用。
@owlwang
owlwang / Caddyfile
Created February 8, 2021 15:04 — forked from phlinhng/Caddyfile
caddy 簡單反代谷歌學術
scholar.example.com {
timeouts 5m
proxy / https://scholar.google.com.hk {
except /robots.txt /usercontent
header_upstream X-Real-IP {remote}
header_upstream X-Forwarded-For {remote}
header_upstream User-Agent {>User-Agent}
# header_upstream X-Real-IP {>CF-Connecting-IP}
# header_upstream X-Forwarded-For {>CF-Connecting-IP}
header_upstream Accept-Language zh-HK
from itertools import islice
def next_n_lines(file_opened, N):
return [x.strip() for x in islice(file_opened, N)]
with open("samplefile", 'r') as f:
x = ""
while x != []:
#!/usr/bin/env python
def split_into_groups(iterable, group_size):
"""Split an iterable collection into groups with fixed size.
Yield
-----
list[any]
Groups of elements.
"""
@owlwang
owlwang / ss-redir 透明代理.md
Last active September 19, 2015 16:12 — 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 可用,但端口一致,就设置这个