Skip to content

Instantly share code, notes, and snippets.

@jrnewell
jrnewell / init.d-template.sh
Created July 9, 2014 19:16
Template for init.d startup script that runs as a local user.
#! /bin/sh
### BEGIN INIT INFO
# Provides: SERVER-NAME
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the SERVER-NAME server
# Description: starts SERVER-NAME as a daemon
@jrnewell
jrnewell / node-upgrade.sh
Last active August 29, 2015 14:03
BASH script to upgrade a local (user-level) node.js installation automatically
#!/usr/bin/env bash
# check arguments
if [ $# -ne 1 ]; then
echo "Usage: `basename $0` version" >&2
exit 1
fi
VERSION=$1