Skip to content

Instantly share code, notes, and snippets.

@dunghuynh
dunghuynh / rbenv-install-system-wide.sh
Last active June 14, 2017 06:18 — forked from jnx/rbenv-install-system-wide.sh
[install rbenv system wide] #rbenv
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential libssl-dev
apt-get -y install git-core
apt-get -y install autoconf bison build-essential libssl-dev\
libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
# Install rbenv
git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv
@dunghuynh
dunghuynh / node nginx configuration
Last active June 14, 2017 06:19
[nodejs nginx configuration] Configuration for nodejs on nginx #nginx #nodejs
# Load balancer configuration
upstream exampleApp {
# Directs to the process with least number of connections.
least_conn;
# One failed response will take a server out of circulation for 20 seconds.
server 127.0.0.1:10080 fail_timeout=20s;
#server 127.0.0.1:10081 fail_timeout=20s;
#server 127.0.0.1:10082 fail_timeout=20s;
#server 127.0.0.1:10083 fail_timeout=20s;
@dunghuynh
dunghuynh / rails_ssl_localhost.sh
Last active June 14, 2017 06:21 — forked from trcarden/gist:3295935
[Rails SSL Localhost] #ssl #rails #localhost #openssl
# SSL self signed localhost for rails start to finish, no red warnings.
# 1) Create your private key (any password will do, we remove it below)
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key