This file contains hidden or 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 python | |
| from __future__ import with_statement | |
| import contextlib | |
| import os | |
| import sys | |
| print "Filesystem\tMounted on\tUse%\tIUse%" | |
| with contextlib.closing(open('/etc/mtab')) as fp: | |
| for m in fp: |
This file contains hidden or 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 python | |
| # | |
| # baaed on Ruby S3 client implementation in RESTful Web Services of O'Reilly. | |
| # | |
| import base64 | |
| import hashlib | |
| import hmac | |
| import os | |
| import re |
This file contains hidden or 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 python | |
| import tornado.ioloop | |
| class Coroutine(object): | |
| """ | |
| a coroutine implementation that can work with tornado.ioloop | |
| def generator(): | |
| print('A') |
This file contains hidden or 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 ruby | |
| require 'rubygems' | |
| require 'msgpack/rpc' | |
| require 'optparse' | |
| require 'yaml' | |
| PROGRAM_NAME = File.basename($0) | |
| EXIT_SUCCESS = 0 | |
| EXIT_FAILURE = 1 |
This file contains hidden or 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/sh -e | |
| rds_db_instance_identifier() { | |
| echo "$@" | sed -e 's/[^-0-9A-Za-z]/-/g' | |
| } | |
| rds_describe_db_instance() { | |
| if test $# -lt 1; then | |
| return 1 | |
| fi |
This file contains hidden or 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/sh | |
| case $1 in | |
| config) | |
| cat <<EOF | |
| graph_title Connections through firewall | |
| graph_vlabel Connections | |
| graph_category network | |
| graph_args -l 0 | |
| established.label ESTABLISHED |
This file contains hidden or 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
| function int2(str, card, rec) { | |
| if(!card) card=10; | |
| i = index("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ", toupper(substr(str, 1, 1)))-1; | |
| if(length(str) < 2) { | |
| return rec*card+i; | |
| } else { | |
| return int2(substr(str, 2), card, rec*card+i); | |
| } | |
| } |
This file contains hidden or 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 ruby | |
| require 'logger' | |
| require 'net/irc' | |
| require 'optparse' | |
| require 'thread' | |
| class IRCNotifier < Net::IRC::Client | |
| def initialize(host, port, opts={}) | |
| super |
This file contains hidden or 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
| # upstart script for resolvconf | |
| start on ( virtual-filesystems and starting udev ) | |
| stop on runlevel [06] | |
| pre-start script | |
| invoke-rc.d resolvconf start | |
| end script |
This file contains hidden or 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
| SRCDIR = /var/lib/cassandra/data | |
| DSTDIR = . | |
| SOURCES = $(wildcard $(SRCDIR)/*/*-Data.db) | |
| ALL = $(foreach S,$(SOURCES),$(basename $(subst $(SRCDIR)/,,$(S))).json.lzo) | |
| .SUFFIXES: .json.lzo | |
| all: $(ALL) |