Magnus Ljadas ashpool

View EC2 user data - Graphite install
1 2 3 4 5 6 7 8 9 10
#!/bin/bash -v
GRAPHITE_INSTALL=/root/graphite-install
 
function installPackage() {
echo "Installing $1";
cd $GRAPHITE_INSTALL/$1
python setup.py install
}
 
yum -y --enablerepo=epel install python-zope-interface python-memcached python-ldap gcc python26-devel mod_python mod_wsgi Django django-tagging pycairo
View mobilemonitor.html
1 2 3 4 5 6 7 8 9 10
<html>
<head>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" />
<style>
iframe {
width: 356px;
height: 100%;
border: none;
View Graphite install
1 2 3 4 5 6 7 8 9 10
mkdir $GRAPHITE_INSTALL
cd $GRAPHITE_INSTALL
 
wget https://launchpad.net/graphite/0.9/0.9.10/+download/graphite-web-0.9.10.tar.gz
wget https://launchpad.net/graphite/0.9/0.9.10/+download/carbon-0.9.10.tar.gz
wget https://launchpad.net/graphite/0.9/0.9.10/+download/whisper-0.9.10.tar.gz
wget https://launchpad.net/graphite/0.9/0.9.10/+download/check-dependencies.py
wget http://pypi.python.org/packages/source/T/Twisted/Twisted-12.1.0.tar.bz2
 
tar xfj Twisted-12.1.0.tar.bz2
View git-scan-rev-list
1 2 3 4 5 6
#!/bin/bash
git rev-list --all | (
while read revision; do
git grep -F $1 $revision
done
)
View swedishgrid.rb
1 2 3 4 5 6 7 8 9 10
require 'rubygems'
require 'iconv'
require 'roo'
require 'swedishgrid'
 
separator = "\t"
 
grid = SwedishGrid.new(:sweref99tm)
 
oo = Excel.new("Sverige - riskklass 1 o 2.xls")
View inspect.js
1 2 3 4 5 6 7 8 9
var Inspect = {
TYPE_FUNCTION: 'function',
// Returns an array of (the names of) all methods
methods: function(obj) {
var testObj = obj || self;
var methods = [];
for (var prop in testObj) {
if (typeof testObj[prop] == Inspect.TYPE_FUNCTION && typeof Inspect[prop] != Inspect.TYPE_FUNCTION) {
methods.push
View gevent_queue_example.py
1 2 3 4 5 6 7 8 9
from gevent.queue import Queue
 
message_queue = Queue()
 
def receiver(n):
while not message_queue.empty():
message = message_queue.get()
print('Received %s message %s' % (n, message))
gevent.sleep(0)
View sleepsort.sh
1 2 3 4 5 6 7 8 9 10
#!/bin/bash
function f() {
sleep "$1"
echo "$1"
}
while [ -n "$1" ]
do
f "$1" &
shift
done
View knight.rb
1 2 3 4 5 6 7 8 9 10
class Game
attr_accessor :board
 
def initialize(size)
@size = size
@board = Array.new(size)
end
 
def start(start_row, start_column)
first_move = Move.new(start_row, start_column, 0, @board)
View stripper.rb
1 2 3 4 5 6 7 8 9 10
class Stripper
def initialize(acronyms)
@stripCache = {}
@acronyms = acronyms
end
def strip(source)
return @stripCache[source] if @stripCache.has_key?(source)
result = source
@acronyms.each do |acronym|
Something went wrong with that request. Please try again.