Skip to content

Instantly share code, notes, and snippets.

View prabhuvikas's full-sized avatar

Vikas Prabhu prabhuvikas

View GitHub Profile
@prabhuvikas
prabhuvikas / nginx-tuning.md
Last active February 20, 2025 05:22 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Reference - 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.

Oracle RDS Data Dump with S3

Prerequisite for S3 Integration with RDS

  • Create a bucket in S3 your_oracle_dump_bucket of your choice. Make a note of this as this will be used for further policy creation.
  • Create policies and roles as mentioned using url
    • Create policy
    • Create role
  • Go to RDS>Database>{yourdatabase}>Connectivity and under Manage IAM roles select the role created above and select feature as S3_INTEGRATION and click Add role action
  • Create a option group RDS>Option Groups>Create Group or select existing option group and click Add Option. Select Option Name as S3_INTEGRATION parameter, Version as 1.0 , select Apply Immediately and click Add Option.
  • If a new option group is created then Modify the database and attach this option group and Apply immediately, wait for some time till the database becomes available.

virtualenv is a tool to create isolated Python environment

  • Install it via apt-get:
$ sudo apt-get install python3-venv
  • traverse to the project folder
  • create a virtual environment in current directory
$ virtualenv venv
@prabhuvikas
prabhuvikas / dhparams.md
Last active March 22, 2021 05:34
Generate & Check dhparams
  • generate 2048 bit size

openssl dhparam -out dhparam2048.pem 2048

  • use the following command to check an existing dhparams.pem file

openssl dhparam -inform PEM -in dhparam.pem -check -text

(Sample output)
@prabhuvikas
prabhuvikas / githublocalrepopush.md
Last active January 17, 2021 11:58
Steps new git repo + push to github

Prerequisite

  • GIT is already installed
  • Already have a github account

SSH Key Generation

  • Create a ssh key using following command
  • If using windows then run commands in git bash
ssh-keygen -t rsa -C "[email protected]"
@prabhuvikas
prabhuvikas / erlang-cookie.md
Created June 25, 2020 10:31
For those out there googling, this same erlang cookie error can happen when you are missing the HOME parameter from your environment configuration. For example, on the default ArchLinux installation of rabbitmq. In this case, the service is started with systemctl start rabbitmq and it generates a cookie but the cli tools like rabbitmqctl status …
@prabhuvikas
prabhuvikas / archiver-node.js
Created May 15, 2020 14:18
Promised based create zip file from directory
const archiver = require('archiver');
/**
* @param {String} source
* @param {String} out
* @returns {Promise}
*/
function zipDirectory(source, out) {
const archive = archiver('zip', { zlib: { level: 9 }});
const stream = fs.createWriteStream(out);
@prabhuvikas
prabhuvikas / archiver-node.js
Created May 15, 2020 14:18
Promised based create zip file from directory
const archiver = require('archiver');
/**
* @param {String} source
* @param {String} out
* @returns {Promise}
*/
function zipDirectory(source, out) {
const archive = archiver('zip', { zlib: { level: 9 }});
const stream = fs.createWriteStream(out);