Skip to content

Instantly share code, notes, and snippets.

View leozhang2018's full-sized avatar
:electron:
Focusing

leozhang leozhang2018

:electron:
Focusing
View GitHub Profile
async getRepoInfo (originRepos) {
if (!originRepos || originRepos.length === 0) return
const reposQuery = originRepos.filter(re => re.source_from !== 'param').map(re => {
return {
source: re.source,
repo_owner: re.repo_owner,
repo: re.repo_name,
default_branch: re.branch,
codehost_id: re.codehost_id,
repo_namespace: re.repo_namespace,
@leozhang2018
leozhang2018 / yarn.lock
Created November 15, 2022 10:38
yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/q@^1.5.1":
version "1.5.4"
resolved "https://registry.npmmirror.com/@types/q/-/q-1.5.4.tgz#15925414e0ad2cd765bfef58842f7e26a7accb24"
accepts@~1.3.4, accepts@~1.3.5, accepts@~1.3.7:
version "1.3.7"
@leozhang2018
leozhang2018 / nginx-tuning.md
Last active January 7, 2020 09:46 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

set -g tmate-server-host "tmate.homelab.ci"
set -g tmate-server-port 2200
set -g tmate-server-rsa-fingerprint "SHA256:vf+Jjirofnvw1ankFLpjB7pXzgnzqWtHjc4uAKpKEIU"
set -g tmate-server-ed25519-fingerprint "SHA256:TKojUyvsfk7wpn4iLvzW6Jb4uYbJQT36tMA/0xGsvmc"
### Keybase proof
I hereby claim:
* I am leozhang2018 on github.
* I am leozhang2018 (https://keybase.io/leozhang2018) on keybase.
* I have a public key whose fingerprint is 5B73 D429 14F1 E892 806A 6434 876B E101 C3AB B98E
To claim this, I am signing this object:
{
"id": "5bbdd7046bf097c0ea6445a2",
"name": "admin-v2-pili-pipeline",
"type": "",
"enabled": true,
"team": "VDN",
"target": "",
"build_module_ver": "",
"sub_tasks": [{
"build_os": "trusty",
function Queue(){
var items = [];
function Stack() {
var item = [];
this.push = function (elem) {
item.push(elem);
return item;
};
this.pop = function () {
return item.pop();
initOS() {
OS=$(uname | tr '[:upper:]' '[:lower:]')
if [ -n "$DEP_OS" ]; then
echo "Using DEP_OS"
OS="$DEP_OS"
fi
case "$OS" in
darwin) OS='darwin';;
linux) OS='linux';;
freebsd) OS='freebsd';;
@leozhang2018
leozhang2018 / gist:3d348528f8f9c54be9d901f444b622a0
Created May 14, 2018 11:03
Auto update aria2 tracker from github
#!/bin/bash
killall aria2c &>/dev/null
list=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt|awk NF|sed ":a;N;s/\n/,/g;ta"`
if [ -z "`grep "bt-tracker" /aria/aria2.conf`" ]; then
sed -i '$a bt-tracker='${list} /aria/aria2.conf
echo add......starting
sleep 3
sudo -u www-data aria2c --conf-path=/aria/aria2.conf -D
ps -aux|grep aria
else
## 当前可用环境变量如下,你可在编译脚本里进行引用使用
## WORKSPACE 工作目录,即流水线名称
## IMAGE 输出镜像名称
## PKG_FILE 编译出的 tar 包名称
## DIST_DIR 编译出 tar 包的目的目录
## SERVICE 编译的服务名称
#!/bin/bash
set -e