Skip to content

Instantly share code, notes, and snippets.

@thinhnd8752
thinhnd8752 / docker_host_vsphere.sh
Created April 18, 2017 16:13 — forked from kpettijohn/docker_host_vsphere.sh
Example docker-machine vSphere create
#!/bin/bash
# Example docker-machine vSphere create
export VSPHERE_CPU_COUNT=4
export VSPHERE_MEMORY_SIZE=8192
export VSPHERE_DISK_SIZE=100000
export VSPHERE_VCENTER="vcenter.doamin.com"
export VSPHERE_USERNAME="DOAMIN\user"
export VSPHERE_PASSWORD=""
export VSPHERE_NETWORK="VM Traffic"
@thinhnd8752
thinhnd8752 / changepassword.php
Created June 17, 2016 03:46 — forked from mattrude/changepassword.php
LDAP PHP Change Password Page
<?php
/**
* LDAP PHP Change Password Webpage
* @author: Matt Rude <http://mattrude.com>
* @website: http://technology.mattrude.com/2010/11/ldap-php-change-password-webpage/
*
*
* GNU GENERAL PUBLIC LICENSE
* Version 2, June 1991

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 400,000 to 500,000 requests per second (clustered), most what i saw is 50,000 to 80,000 (non-clustered) requests per second and 30% CPU load, course, this was 2xIntel Xeon with HT 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.

First, you will need to install nginx, my way to install nginx is compiling it from source, but for now we will use apt-get

@thinhnd8752
thinhnd8752 / nginx.conf
Created March 18, 2016 08:51 — 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
@thinhnd8752
thinhnd8752 / json.php
Last active August 29, 2015 14:26 — forked from itspriddle/json.php
Pure PHP json library
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Converts to and from JSON format.
*
* JSON (JavaScript Object Notation) is a lightweight data-interchange
* format. It is easy for humans to read and write. It is easy for machines
* to parse and generate. It is based on a subset of the JavaScript
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.