Skip to content

Instantly share code, notes, and snippets.

View vishal2232's full-sized avatar
πŸ„β€β™‚οΈ
Focusing

Vishal Yadav vishal2232

πŸ„β€β™‚οΈ
Focusing
View GitHub Profile
# First, install all of the things
apt-get update
apt-get install nginx
/etc/init.d/nginx start
apt-get install python-dev
apt-get install python-pip
apt-get install libjpeg-dev libpng-dev libtiff-dev libjasper-dev libgtk2.0-dev python-numpy python-pycurl libwebp-dev python-opencv libjpeg-progs
ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib
pip install pillow
@vishal2232
vishal2232 / nginx.conf
Created March 13, 2019 08:38 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@vishal2232
vishal2232 / nginx_grok.conf
Created March 7, 2019 07:30 — forked from Shellbye/nginx_grok.conf
uwsgi & nginx grok pattern
# https://logz.io/blog/nginx-access-log-monitoring-dashboard/
input {
file {
type => nginx_web
path => "/var/log/nginx/*"
exclude => "*.gz"
}
}
@vishal2232
vishal2232 / nginx-tuning.md
Created February 23, 2019 13:31 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

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.

@vishal2232
vishal2232 / cluster_block_exception.md
Created February 22, 2019 12:19 — forked from panchicore/cluster_block_exception.md
Elasticsearch problem: cluster_block_exception
[2018-02-01T08:00:23,133][INFO ][logstash.outputs.elasticsearch] retrying failed action with response code: 403 ({"type"=>"cluster_block_exception", "reason"=>"blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"})
[2018-02-01T08:00:23,134][INFO ][logstash.outputs.elasticsearch] Retrying individual bulk actions that failed or were rejected by the previous bulk request. {:count=>1}
PUT _all/_settings
{
"index": {
 "blocks.read_only": false,
@vishal2232
vishal2232 / ec2_start_instances.js
Created November 5, 2017 18:35 — forked from juno/ec2_start_instances.js
AWS Lambda Function to call EC2 StartInstances/StopInstances API
/* Event Parameters
{
"accessKeyId": "...",
"secretAccessKey": "...",
"region": "ap-northeast-1",
"instanceId": "i-XXXXXXXX"
}
*/
exports.handler = function(event, context) {
console.log('instanceId =', event.instanceId);