This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Shows how to restrict access using the HTTP Basic schema. | |
* @see https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication | |
* @see https://tools.ietf.org/html/rfc7617 | |
* | |
* A user-id containing a colon (":") character is invalid, as the | |
* first colon in a user-pass string separates user and password. | |
*/ | |
const BASIC_USER = 'admin'; | |
const BASIC_PASS = 'passwd'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export NVM_DIR="$XDG_DATA_HOME/nvm" | |
install_nvm() { | |
[[ -d $NVM_DIR ]] || command mkdir -p $NVM_DIR | |
if [[ ! -f $NVM_DIR/nvm.sh ]]; then | |
echo "$NVM_DIR/nvm.sh doesn't exists." | |
echo "Downloading nvm.sh from github to $NVM_DIR/nvm.sh ..." | |
echo `curl --connect-timeout 5 --compressed --create-dirs --progress-bar -fLo \ | |
$NVM_DIR/nvm.sh https://raw.githubusercontent.com/nvm-sh/nvm/master/nvm.sh` | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://openresty.org/download/ngx_openresty-1.9.3.1.tar.gz | |
tar zxvf ngx_openresty-1.9.3.1.tar.gz | |
cd ngx_openresty-1.9.3.1 | |
yum install postgresql-devel # If you use '--with-http_postgres_module' option. | |
./configure --prefix=/opt/openresty \ | |
--with-luajit \ | |
--with-pcre-jit \ | |
--with-ipv6 \ | |
--without-http_redis2_module \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://www.memcached.org/files/memcached-1.4.24.tar.gz | |
tar zxvf memcached-1.4.24.tar.gz | |
cd memcached-1.4.24 | |
yum install libevent-devel | |
./configure --prefix=/usr/share/memcached | |
make | |
#make test | |
make install | |
cd .. && rm -rf memcached-1.4.24 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://download.redis.io/releases/redis-3.0.3.tar.gz | |
tar zxvf redis-3.0.3.tar.gz | |
cd redis-3.0.3 | |
make PREFIX=/usr/share/redis | |
# If you want to run 'make test', you should install tcl before. | |
#yum install tcl -y | |
#make test | |
make install PREFIX=/usr/share/redis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://luajit.org/download/LuaJIT-2.0.4.tar.gz | |
tar zxvf LuaJIT-2.0.4.tar.gz | |
cd LuaJIT-2.0.4 | |
make PREFIX=/usr/share/luajit2 | |
make install PREFIX=/usr/share/luajit2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# centos 7 | |
# nginx-1.9.3 | |
yum update -y | |
yum install -y epel-release | |
yum update -y | |
yum group install -y "Development Tools" | |
yum install -y pcre pcre-devel \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generate a good secret key with python | |
# http://flask.pocoo.org/docs/0.10/quickstart | |
import os | |
os.urandom(24).encode('hex') |