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
#!/bin/bash | |
set -e | |
world=<world-name> | |
main=<main server install> | |
new=<new server install> | |
mkdir -p "${main}/bak" |
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
# Ignore project files in the root | |
.git/* | |
*.sln | |
!*/*.sln | |
.vs | |
*.suo | |
*.opensdf | |
*.sdf | |
*.pdb | |
*.xcodeproj |
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
#!/bin/sh | |
info() { echo "INFO: $1"; } | |
die() { echo "ERROR: $1. Aborting!"; exit 1; } | |
SRC_ROOT=/usr/local/src | |
SRC_DIR=$SRC_ROOT/{{ proj_name }} | |
STATIC_DIR=/usr/share/nginx/html | |
# stop node apps if they're running |
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
user nginx; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
# max_clients = worker_processes * worker_connections / 4 | |
worker_connections 1024; | |
} |
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
app.post('/', function (req, res) { | |
if (!req.body.user || !req.body.pass) { | |
res.send('Username and password both required'); | |
return; | |
} | |
crypto.randomBytes(128, function (err, salt) { | |
if (err) { throw err; } | |
salt = new Buffer(salt).toString('hex'); | |
crypto.pbkdf2(req.body.pass, salt, 7000, 256, |