Skip to content

Instantly share code, notes, and snippets.

@BarronKane
BarronKane / mc-server-start.sh
Last active December 30, 2022 02:25
A minecraft server start script that syncs worlds between server installs. Works between windows/linux/mac/etc, but if on windows, the windows server must be the main as it can't read linux/osx partitions.
#!/bin/bash
set -e
world=<world-name>
main=<main server install>
new=<new server install>
mkdir -p "${main}/bak"
@BarronKane
BarronKane / .p4ignore
Created November 4, 2019 02:47
UE4 Depot Settings
# Ignore project files in the root
.git/*
*.sln
!*/*.sln
.vs
*.suo
*.opensdf
*.sdf
*.pdb
*.xcodeproj
@BarronKane
BarronKane / bootstrap.sh
Created February 18, 2016 15:54 — forked from d5/bootstrap.sh
#!/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
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;
}
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,