Skip to content

Instantly share code, notes, and snippets.

[custom]
custom_proxy_group=!!import:snippets/groups.txt
custom_proxy_group=AI`select`(美国)
ruleset=AI,https://raw.githubusercontent.com/limbopro/Profiles4limbo/main/AI_Platforms.list
enable_rule_generator=true
overwrite_original_rules=true
clash_rule_base=base/forcerule.yml
@blackhuman
blackhuman / test_head.py
Last active April 8, 2021 01:49
beancount cache head method test for ISSUES#645
import unittest
import chardet
class TestHead(unittest.TestCase):
def head_reader(filename, num_bytes=8192, encoding=None):
with open(filename, 'rb') as file:
rawdata = file.read(num_bytes)
file_encoding = encoding or chardet.detect(rawdata)['encoding']
print(file_encoding)
@blackhuman
blackhuman / aria2
Last active February 29, 2016 04:58 — forked from andrzejressel/aria2
init.d file for aria2c daemon (debian)
#!/bin/sh
### BEGIN INIT INFO
# Provides: aria2
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: aria2c init script.
@blackhuman
blackhuman / proxy2.pac
Created January 6, 2014 09:59
pac detail
/*
* Proxy Auto-Config file generated by autoproxy2pac
* Rule source: http://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt
* Last update: Wed, 21 Mar 2012 02:54:51 GMT
* var PROXY = "SOCKS5 192.168.0.1:1080; SOCKS 192.168.0.1:1080";
*/
function FindProxyForURL(url, host) {
var PROXY = "SOCKS5 192.168.0.1:1080; SOCKS 192.168.0.1:1080; PROXY 127.0.0.1:8087";
var DEFAULT = "DIRECT";
if(/soumo\.info/i.test(url)) return DEFAULT;