Skip to content

Instantly share code, notes, and snippets.

View hpcorona's full-sized avatar

Hilario Pérez Corona hpcorona

  • Google
  • Washington
View GitHub Profile
@willrstern
willrstern / node-ubuntu-upstart-service.md
Last active August 17, 2023 10:15
Run Node.js App as Ubuntu Upstart Service

###The Issue With Forever Forever is great for running node services, with a minor setback: the word "forever" doesn't apply to system reboots.

###The solution, run node apps as a system service logged in as root

vim /etc/init/node-app.conf

Contents for node-app.conf

@jsgarvin
jsgarvin / autossh-tunnel.conf
Created November 28, 2013 05:50
Automatically establish ssh tunnel to remote postgresql db server on boot, and auto re-establish if connection is lost (eg reboot of remote machine or network failure). Requires autossh.
# Modified version of technique borrowed from
# http://theantway.com/2012/08/how-to-create-ssh-tunnel-at-boot-time-under-ubuntu/
# Place in /etc/init/
# autossh
description "autossh daemon"
start on net-device-up IFACE=eth1
stop on runlevel [01S6]
@ozkatz
ozkatz / ec2_ssh_config.py
Created June 21, 2013 00:50
generate an ~/.ssh/config file from your EC2 instances, so that you'd never have to lookup those fugly ec2-xx-xx-xx-xxx.compute-1.amazonaws.com hostnames again. Use your instance name instead!
#!/usr/bin/env python
import os
import sys
import argparse
try:
from boto.ec2.connection import EC2Connection
except ImportError:
sys.stderr.write('Please install boto ( http://docs.pythonboto.org/en/latest/getting_started.html )\n')
sys.exit(1)