This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |