Skip to content

Instantly share code, notes, and snippets.

View phouse512's full-sized avatar

Philip House phouse512

View GitHub Profile
@komuw
komuw / install NVM and nodeJS.yml
Created November 20, 2014 17:40
Ansible task to install nvm and nodeJS
#first seen here: http://www.snip2code.com/Snippet/63701/Ansible-task-to-install-nvm-and-node
# Here is how to install nvm and node in an Ansible task.
# I tried a bunch of different things, and as usual it's simple, but you have to get it right.
# The important part is that you have to shell with /bin/bash -c and source nvm.sh
---
- name: Install nvm
shell: >
curl https://raw.githubusercontent.com/creationix/nvm/v0.7.0/install.sh | sh
creates=/home/{{ ansible_user_id }}/.nvm/nvm.sh
@mmcdaris
mmcdaris / watchfiles.go
Created February 25, 2014 10:15
restart an upstart script when there is an inotify event
// this is almost complete :)
// name: watchfiles.go
// purpose: emit a restart
package main
import (
"log" // printing
"code.google.com/p/go.exp/inotify" // inotify events
"os" // argument handling
"os/exec" // used to call initctl restart process name
@sontek
sontek / gist:1362947
Created November 14, 2011 00:06
Run gunicorn webserver and kill its workers when finished.
#!/bin/bash
# run if user hits control-c
control_c()
{
echo "Oh no, exiting!"
for pid in $(cat gunicorn.pid)
do
echo "killing $pid"
kill -SIGKILL $pid
done