Skip to content

Instantly share code, notes, and snippets.

View EkkoG's full-sized avatar

Ekko EkkoG

View GitHub Profile
#!/bin/sh
NAME=shadowsocks
SERVERS=servers
dns="119.29.29.29"
uci_set_by_type() {
uci set $NAME.$1.$2=$3 2>/dev/null
}
@EkkoG
EkkoG / keybase.md
Last active November 25, 2021 14:09

Keybase proof

I hereby claim:

  • I am EkkoG on github.
  • I am cielpy (https://keybase.io/cielpy) on keybase.
  • I have a public key whose fingerprint is 9297 A80C AFDD 5466 5A0F 6349 E471 9567 F093 EC19

To claim this, I am signing this object:

@EkkoG
EkkoG / js_match.js
Last active October 12, 2016 15:53
var str = '血红蛋白(123,g/L) 血红蛋白(1209803,g/L) 血红蛋白(19821,g/L)';
var regexp = /\((\d+)/g;
while (true) {
var r = regexp.exec(str);
if (r != null) {
console.log(r[1]);
}
else {
break;
}
@EkkoG
EkkoG / turbo-qiniu.sh
Created February 21, 2017 07:03 — forked from trawor/turbo-qiniu.sh
本脚本解决部分地区七牛上传速度慢的问题
#!/bin/bash
#
# 通过对比 ping 响应时间,找到本机最快的上传ip
# [email protected]
#
# 使用方法:
# sh -c "$(curl -sSL https://gist.githubusercontent.com/trawor/5dda140dee86836b8e60/raw/turbo-qiniu.sh)"
echo "# 这个脚本理论上可以帮你获取任意域名的最快速的IP"
echo "# 获取IP列表的服务由 17ce.com 提供, 非常感谢有这么好的免费服务!"
@EkkoG
EkkoG / af_custom_http_body
Created May 3, 2017 06:17
Custom http body use af 3.x
NSMutableURLRequest *req = [[AFHTTPRequestSerializer serializer] requestWithMethod:@"POST" URLString:@"https://example.com" parameters:@{} error:nil];
NSString *body = @"...";
req.HTTPBody = [body dataUsingEncoding:NSUTF8StringEncoding];
AFHTTPSessionManager *manager = [[AFHTTPSessionManager alloc] initWithSessionConfiguration:configuration];
NSURLSessionDataTask *task = [manager dataTaskWithRequest:req completionHandler:^(NSURLResponse * _Nonnull response, id _Nullable responseObject, NSError * _Nullable error) {
}];
[task resume];
@EkkoG
EkkoG / build.yaml
Last active September 20, 2017 08:20
project_path: ahh
worspace_name: ahh
log_path: builds/log/
builds_path: builds
last_build_commit_file: ahh
last_try_build_commit_file: ahh
git_pull_before_build: true
send_ding_msg_after_build:

Rust Iron local server, thread 12

$ wrk --latency -t12 -c100 -d10s http://localhost:3000/
Running 10s test @ http://localhost:3000/
  12 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     9.03ms    3.30ms 100.96ms   91.08%
    Req/Sec   509.25    356.39     2.62k    44.51%
  Latency Distribution

Run Flask app with aiohttp and uvloop

hello_world.py

"""Simple demo of using Flask with aiohttp via aiohttp-wsgi's
WSGIHandler.

"""
{"sig":"4b77b3be66779ab3216b58f246dd745373244c42afe69590f04254862f069c4579cad538507750dc774eac866c3efde0373add71a2845192f794f18f9b2fddbd1","msghash":"fe9bb6be19b7252b1e802b514a254362b8466ae28caa9181f224db0d21c70a04"}
FROM ubuntu:latest
# Install dependencies
RUN apt-get update && \
apt-get -y install curl && \
apt-get -y install zip unzip
# RUN apt-get -y install vim