Skip to content

Instantly share code, notes, and snippets.

View supernova106's full-sized avatar

Binh Nguyen supernova106

View GitHub Profile
@supernova106
supernova106 / nginx-tuning.md
Created December 4, 2022 19:58 — 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.

@supernova106
supernova106 / Jenkinsfile.groovy
Created April 15, 2019 20:40 — forked from Faheetah/Jenkinsfile.groovy
Jenkinsfile idiosynchrasies with escaping and quotes
node {
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1'
echo 'No quotes, pipeline command in single quotes'
sh 'echo $BUILD_NUMBER' // 1
echo 'Double quotes are silently dropped'
sh 'echo "$BUILD_NUMBER"' // 1
echo 'Even escaped with a single backslash they are dropped'
sh 'echo \"$BUILD_NUMBER\"' // 1
echo 'Using two backslashes, the quotes are preserved'
sh 'echo \\"$BUILD_NUMBER\\"' // "1"
@supernova106
supernova106 / helm-cheatsheet.md
Created April 6, 2018 07:25 — forked from tuannvm/argo.md
#Helm #Kubernetes #cheatsheet, happy helming!
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<annotationProcessing>
<profile name="Maven default annotation processors profile" enabled="true">
<sourceOutputDir name="target/generated-sources/annotations" />
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
<outputRelativeToContentRoot value="true" />
<module name="ezbot" />
</profile>
@supernova106
supernova106 / gist:d704a0eab7df623947bf6a02892581e7
Created March 31, 2017 07:53 — forked from qzaidi/gist:5835999
dashing job for fetching CPU usage and Instance count from AWS. Create an aws-config.json, and update your AutoScalingGroupName here. It assumes a List widget named servers and a Meter widget named cpu in your dashboard. { "accessKeyId": "XXXXXX", "secretAccessKey": "XXXXX", "region": "ap-southeast-1" }
"use strict";
var AWS = require('aws-sdk');
AWS.config.loadFromPath(__dirname + '/../aws-config.json');
var autoscaling = new AWS.AutoScaling();
var cloudwatch = new AWS.CloudWatch();
function goFigure() {
var e = new Date();