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
license: mit |
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
Ref: http://graphite.readthedocs.io/en/latest/config-carbon.html#storage-schemas-conf | |
storage-schemas.conf: | |
[year_max] | |
pattern = yearMax$ | |
retentions = 1m:1d,1d:1y | |
storage-aggregation.conf: |
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
# update packages | |
sudo apt-get update | |
# install python and graphite dependencies | |
sudo apt-get install -y python python-dev python-virtualenv libevent-dev python-pip python-cairo python-django-tagging python-twisted python-memcache python-pysqlite2 | |
# install web server | |
sudo apt-get install -y nginx uwsgi uwsgi-plugin-python | |
# install postgresql and dependencies |
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
#!/usr/bin/env node | |
var spawn = require('child_process').spawn | |
var outdated = spawn('npm', ['outdated']); | |
outdated.stdout.on('data', function (data) { | |
var out = data.toString(); | |
var lines = out.split('\n'); | |
if (lines.length > 1) { | |
lines = lines.slice(1); | |
var packages = []; |
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
--- | |
- hosts: all | |
tasks: | |
- name: Gather EC2 facts | |
action: ec2_facts | |
- name: Turning on termination protection | |
local_action: command aws ec2 modify-instance-attribute --region {{ ansible_ec2_placement_region }} --instance-id {{ ansible_ec2_instance_id }} --attribute disableApiTermination --value true |
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 | |
PORT=$1 | |
if [[ -z "$PORT" ]]; then | |
echo "Usage: killp <port>" | |
exit 1 | |
fi | |
PID=`lsof -i :$PORT -t` |
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
<html> | |
<head> | |
<script src="http://localhost:3000/socket.io/socket.io.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
tick = io.connect('http://localhost:3000/'); | |
tick.on('data', function (data) { | |
console.log(data); | |
}); | |
tick.on('error', function (reason){ |