Skip to content

Instantly share code, notes, and snippets.

View appscluster's full-sized avatar

Dr. Abdul Hamid appscluster

View GitHub Profile
@slattery
slattery / pm2_actionhero_startup.md
Last active September 16, 2015 16:07
pm2 actionhero startup

I like using pm2 to manage node starts and restarts, including actionhero.

Node falls right on its face if anyone's code goes through an uncaught exception. We're not at all used to that in Apacheland. pm2 does whatever forever does for node, plus some more. pm2 will output a nice report for web boards, etc. And pm2 is smart about restarting, as well as bailing out if the app is faulty and restarts 15 times in a row due to a launch error. Plus it will combine log output for us if we are running a few servers on the machine.

# NOTE: you may need g++ if it is not installed
# apt-get install g++
npm install -g pm2
pm2 startup ubuntu
@the42
the42 / gist:1956518
Created March 2, 2012 07:34
GZip encoding for GO V1 using custom responsewriter
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
type gzipResponseWriter struct {