Skip to content

Instantly share code, notes, and snippets.

View LeiHao0's full-sized avatar
😃
I may be slow to respond.

Lei Hao LeiHao0

😃
I may be slow to respond.
View GitHub Profile
[General]
ipv6 = false
bypass-system = true
dns-server = https://223.5.5.5/dns-query
bypass-tun = 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.0.0.0/24, 192.0.2.0/24, 192.88.99.0/24, 192.168.0.0/16, 198.18.0.0/15, 198.51.100.0/24, 203.0.113.0/24, 224.0.0.0/4, 255.255.255.255/32
skip-proxy = 127.0.0.1, 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, 100.64.0.0/10, localhost, *.local, *.crashlytics.com, *.edu.cn, captive.apple.com
[Proxy Group]
Proxies = select,🇭🇰HK,🇨🇳TW,🇯🇵JP,🇰🇷KR,🇸🇬SG,🇺🇸US, interval=600,timeout=5,select=0,url=http://www.gstatic.com/generate_204
@LeiHao0
LeiHao0 / 2webp
Last active March 14, 2021 02:43
#!/bin/zsh
echo "{% gp - %}"
n=01
for i in img/*.jpeg
do
# convert -resize x1080 $i $1-a.jpg
# convert -resize x1080 -quality 80 -strip $i img/$1-$n.jpg &
magick $i -resize x1080 -quality 50 -strip img/$1-$n.webp &
DOMAIN-SUFFIX,ocsp-lb.apple.com.akadns.net,REJECT
DOMAIN-SUFFIX,ocsp-cn-lb.apple.com.akadns.net,REJECT
DOMAIN-SUFFIX,ocsp.apple.com.download.ks-cdn.com,REJECT
DOMAIN-SUFFIX,k128-mzstatic.gslb.ksyuncdn.com,REJECT
DOMAIN-SUFFIX,ocsp.apple.com.cdn20.com,REJECT
DOMAIN-SUFFIX,ocsp.g.aaplimg.com,REJECT
DOMAIN-SUFFIX,ocsp.apple.com,REJECT
DOMAIN-SUFFIX,ocsp.digicert.com,REJECT
@LeiHao0
LeiHao0 / renameExt.py
Last active August 7, 2020 03:17
renameExt.py
# usage
# py renameExt.py folder oldExt newExt
import os
import sys
folder = sys.argv[1]
oldExt = f".{sys.argv[2]}"
newExt = f".{sys.argv[3]}"
print(folder, oldExt, newExt)
@LeiHao0
LeiHao0 / Adguard.js
Last active May 19, 2023 19:09
Batch add block list in Adguard Home
// https://github.com/AdguardTeam/AdGuardHome/blob/master/openapi/openapi.yaml
old_blist = [];
blist = [
"https://raw.githubusercontent.com/FadeMind/hosts.extras/master/add.Spam/hosts",
"https://v.firebog.net/hosts/static/w3kbl.txt",
"https://raw.githubusercontent.com/matomo-org/referrer-spam-blacklist/master/spammers.txt",
"https://someonewhocares.org/hosts/zero/hosts",
"https://raw.githubusercontent.com/VeleSila/yhosts/master/hosts",
{"protocol-version":"1.0","general-settings":{"app-language":"en-US","allow-acceptable-ads":false,"show-blocked-ads-count":true,"autodetect-filters":true,"safebrowsing-enabled":true,"filters-update-period":86400000},"extension-specific-settings":{"use-optimized-filters":false,"collect-hits-count":false,"show-context-menu":true,"show-info-about-adguard":true,"show-app-updated-info":false},"filters":{"enabled-groups":[1,2,3,4,5,6,7,0],"enabled-filters":[208,14,2,3,4,7,104,118,123,210,227,228,11,12,101,207,215,242,15,204,225,229,5,240,241,219],"custom-filters":[{"customUrl":"https://pics.rebatesme.com/newrm/public/ad-blocker-wishlist.txt","enabled":true,"title":"https://pics.rebatesme.com/newrm/public/ad-blocker-wishlist.txt","trusted":false}],"user-filter":{"rules":"","disabled-rules":""},"whitelist":{"inverted":false,"domains":["127.0.0.1"],"inverted-domains":[]}}}
name="xxx"
i=0
for f in *.jpeg
do convert -resize 1440x -strip "$f" "$name$(printf "%02d\n" $i).jpg"
i=$(($i+1))
done
@LeiHao0
LeiHao0 / DeleteZhihu.js
Created June 13, 2019 21:52
DeleteZhihu
function findBtn(text) {
var buttons = document.querySelectorAll("button");
btns = [];
for (var i = 0, l = buttons.length; i < l; i++) {
if (buttons[i].lastChild.nodeValue == text) btns.push(buttons[i]);
}
return btns;
}
a = findBtn("设置");
function a() {
var g = function(c) {
$.post_withck("/j/status/delete", { sid: c });
};
var h = function(c) {
$.post_withck("/j/status/unreshare", { sid: c });
};
$("a[data-unreshare]").each(function() {
h($(this).attr("data-unreshare"));
$(this).hide();
@LeiHao0
LeiHao0 / camelize.html
Last active May 17, 2019 06:14
Javascript camelize string
<!DOCTYPE html>
<html>
<body>
<textarea id="from" rows="5" cols="50">
What's your name?
Let's go!!!
Sorry, I can’t hear you...
</textarea>