Skip to content

Instantly share code, notes, and snippets.

View thraxil's full-sized avatar

Anders Pearson thraxil

View GitHub Profile
#!/bin/bash
for app in `echo */`; do
echo $app
cd $app
git pull
perl -pi -e 's/Django==1.6.4/Django==1.6.5/' requirements.txt
make && git commit -a -m "Django -> 1.6.5" && git push
cd ..
done
import requests
from socket import socket
import time
URLS = [("wiki.", "http://wiki.ccnmtl.columbia.edu/"),
("jtsa.", "http://learn.jtsa.edu/"),
("polarhub.", "http://thepolarhub.org/"),
("edblogs.", "http://edblogs.columbia.edu/"),
]
CARBON_HOST = "nanny.cul.columbia.edu"
#!/usr/bin/env python
import os
import sys
class TrieNode(object):
def __init__(self):
self.children = dict()
self.count = 0
@thraxil
thraxil / d173.sh
Created January 14, 2015 12:29
update all the apps
#!/bin/bash
declare -a apps=("capsim" "carr" "ccdb" "countryx" "diabeaters" "dmt" "forest" "mediamachine" "mvsim" "nynjaetc" "plexus" "pump" "rolf" "smart_sa" "smilekit" "ssnm" "tala" "uelc" "wacep" "wardenclyffe" "worth2")
for app in "${apps[@]}"
do
echo "============== $app ==============="
cd $app
git checkout master
git pull
var requirejs = require('requirejs');
var jsdom = require('mocha-jsdom');
var assert = require('assert');
requirejs.config(require('../../config/test_config').options);
describe('models/user', function() {
jsdom();
// local operations on a model should be fast
{% set app='example' %}
upstream {{app}} {
{% if pillar.role == 'staging' %}
server {{app}}.stage.ccnmtl.columbia.edu.s3-website-us-east-1.amazonaws.com;
{% else %}
server {{app}}.ccnmtl.columbia.edu.s3-website-us-east-1.amazonaws.com;
{% endif %}
}
server {

The CTL Surveillance State

(for servers and applications)

Metrics and Monitoring at CTL

Once upon a time, we had a couple Dell servers living in the Mezzanine. All of our applications just ran on them.

We had a wiki page to keep track of which applications were running on which server, etc. the "Master Server Grid":

#!/usr/bin/env python
import json
import os
import subprocess
import tempfile
import yaml
VAULT_BIN = "/usr/local/bin/vault"
VAULT_PATH = "secret/salt/pillar_data"
{
browser -> mediathread [label = "GET /explore/redirect?..."];
browser <-- mediathread [label = "302 Location: http://wardenclyffe/mediathread/?..."];
browser -> wardenclyffe [label = "GET /mediathread/?nonce=..uni=.."];
wardenclyffe => wardenclyffe [label = "check credentials"];
wardenclyffe -> postgresql [label = "get/create user/session"];
wardenclyffe <-- postgresql [label = "user/session"];
browser <-- wardenclyffe [label = "upload form"];
browser -> wardenclyffe [label = "POST /mediathread w/ video file"] {
void ofApp::draw(){
ofSetColor(ofColor::white);
ofNoFill();
const int size = 20;
const int qs[7] = {0, 1, -1, 0, 1, -1, 0};
const int rs[7] = {-1, -1, 0, 0, 0, 1, 1};
for (int i = 0; i < 7; i++) {
int q = qs[i];