Skip to content

Instantly share code, notes, and snippets.

View luisgcastillos's full-sized avatar

Luis Castillo luisgcastillos

View GitHub Profile
@luisgcastillos
luisgcastillos / install.sh
Created June 22, 2022 19:04 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@luisgcastillos
luisgcastillos / woocommerce-modal-variation.php
Created October 21, 2020 19:42
WooCommerce ajax modal add to cart for variable products NOTE: working with PrettyPhoto js plugin, folder name for plugin woocommerce-modal-variation
<?php
/*
Plugin Name: woocommerce modal variationn
Plugin URI: #
Description: show modal window with product variations after clicking -add to cart-.
Version: 0.1
Author: Maks Buriy
Author URI: mailto:[email protected]
License: GPL2
*/
@luisgcastillos
luisgcastillos / nginx-tuning.md
Created July 1, 2020 22:34 — 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.

#!/bin/bash
# ----------------------------------------------------
# v. 20180308
TARGET=/var/www/html
TMPTARGET=/var/www/codedeploy
BACKUP=/var/www/html-backup
USER=nginx
GROUP=nginx
# ----------------------------------------------------