Skip to content

Instantly share code, notes, and snippets.

View mlicheng's full-sized avatar
🎯
Focusing

Esteban Arvin mlicheng

🎯
Focusing
View GitHub Profile
@mlicheng
mlicheng / examples.md
Created August 15, 2020 07:57 — forked from ErisDS/examples.md
Ghost Filter Query examples

Filter Queries - Example Use Cases

Here are a few example use cases, these use cases combine filter with other parameters to make useful API queries. The syntax for any of this may change between now, implementation, and release - they're meant as illustrative examples :)

Fetch 3 posts with tags which match 'photo' or 'video' and aren't the post with id 5.

api.posts.browse({filter: "tags:[photo, video] + id:-5", limit="3"});

GET /api/posts?filter=tags%3A%5Bphoto%2Cvideo%5D%2Bid%3A-5&limit=3

@mlicheng
mlicheng / dnsmasq.conf
Created February 6, 2021 07:37
dnsmasq config with ad statistic block
## /usr/local/etc/dnsmasq.conf
listen-address=127.0.0.1
# nameserver 119.29.29.29
# nameserver 223.5.5.5
# nameserver 1.1.1.1
# nameserver 114.114.114.114
# statistic
address=/bshare.cn/0.0.0.0
address=/bashare.cn/0.0.0.0
@mlicheng
mlicheng / mongodb
Created March 11, 2021 09:41
mongodb find by array element type
db.getCollection("collection_name").find({
"filed_name": {
$elemMatch: {
$ne: null,
$type: "string" // object, objectId ...
}
}
}, {
"filed_name": 1
})
@mlicheng
mlicheng / clash.yaml
Last active March 12, 2021 02:18
clash.yaml
#---------------------------------------------------#
## 配置文件需要放置在 $HOME/.config/clash/config.yml
##
## 如果您不知道如何操作,请参阅 SS-Rule-Snippet 的 Wiki:
## https://github.com/Hackl0us/SS-Rule-Snippet/wiki/clash(X)
## from: https://cdn.jsdelivr.net/gh/Hackl0us/SS-Rule-Snippet@master/LAZY_RULES/clash.yaml
#---------------------------------------------------#
# HTTP 代理端口
port: 7890
@mlicheng
mlicheng / gist:a5b0d532ffc334633b2239680e45be13
Created March 31, 2021 03:48 — forked from ipedrazas/gist:2c93f6e74737d1f8a791
List Docker Container Names and IPs
function drips(){
docker ps -q | xargs -n 1 docker inspect --format '{{ .NetworkSettings.IPAddress }} {{ .Name }}' | sed 's/ \// /'
}
@mlicheng
mlicheng / docker
Last active April 1, 2021 08:13
docker env for kibana
// delete images which tag is none
docker rmi $(docker images | grep "none" | awk '{print $3}')
// docker env for kibana config
"Env": [
"PATH=/usr/share/kibana/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
"ELASTIC_CONTAINER=false",
"ELASTICSEARCH_HOSTS=http://127.0.0.1:8812"
]
@mlicheng
mlicheng / Activate Office 2019 for macOS VoL.md
Created March 31, 2021 04:02 — forked from zthxxx/Activate Office 2019 for macOS VoL.md
crack activate office on mac with license file

Activate MS Office 2019/2016 for macOS - Microsoft_Office_2019_VL_Serializer

Office 2019 above

2019-06-03

Note that Office2019 DO NOT support activate via simple copy/paste plist license file which is the simplest way to activate Office 2016. Fortunately, you can also use the VL Serializer tool, just install Office 2019 and Serializer, then run Serializer to activate.

Ref

@mlicheng
mlicheng / int2ip.js
Created April 20, 2021 04:52 — forked from jppommet/int2ip.js
javascript conversion from ip address to long integer and vice versa
function int2ip (ipInt) {
return ( (ipInt>>>24) +'.' + (ipInt>>16 & 255) +'.' + (ipInt>>8 & 255) +'.' + (ipInt & 255) );
}
1. 请求处理
const dingTalkCrypt = new DingTalkMsgCrypt(
"MLBVpjG4VLaUrZda2A",
"lPEjaswljAlrcjwTyU752yXxxOdkMYpK8VmlfuixdG4",
"ding4ee83cd86390472dbc961a6cb783455b"
);
const result = await dingTalkCrypt.getDecryptMsg(query.signature, query.timestamp, query.nonce, body.encrypt);
console.log("DEBUG plainText: ", JSON.stringify(result));
const data = await dingTalkCrypt.getEncryptedMap("success", getNowTimestamp(), _.randomString(8));