This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string stringWithFormat(const char *fmt, ...) { | |
int desiredLength= 1024; | |
string str; | |
str.resize(desiredLength); | |
va_list ap; | |
while (true) { | |
va_start(ap, fmt); | |
int printedLength= vsnprintf((char *)str.c_str(), str.size()+1, fmt, ap); | |
va_end(ap); | |
// '-1' means the buffer was too small. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
token='<dnspod_id>,<dnspod_token>' | |
domain='<your_domain>' | |
sub_domain='<your_subdomain>' | |
new_ip=${3:-$(curl -s 'https://api.ip.sb/geoip/' | sed 's/.*"ip":"\([0-9.]*\)".*/\1/')} | |
api_call() { | |
local param="login_token=${token}&format=json&domain=${domain}&${2}" | |
curl -s -k -XPOST -o- -A'shdns/0.1(php@html.js.cn)' -d $param https://dnsapi.cn/${1} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* quantumultx remove xueqiu launch ad, using Charles to analyze network activities | |
[rewrite_local] | |
^https?://(101\.201\.175\.228|182\.92\.251\.113)\/brand\/search\/v1.json* url script-response-body https://gist.githubusercontent.com/smilingpoplar/ab74f2e176b91a0ca597b4222971f5a2/raw/xxxxx/xq_launch.js | |
[mitm] | |
hostname = 101.201.175.228, 182.92.251.113 | |
*/ | |
$done(JSON.stringify({"data":{},"result_code":0,"message":""})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# from: https://gist.github.com/jonhoo/f686cacb4b9fe716d5aa | |
# `brew install findutils` first, for `gfind` | |
# | |
#!/bin/bash | |
# | |
# Script for running `go test` a bunch of times, in parallel, storing the test | |
# output as you go, and showing a nice status output telling you how you're | |
# doing. | |
# | |
# Normally, you should be able to execute this script with |