View git-root.sh
#!/bin/bash
set -e
git rev-parse --show-toplevel
View pedantically_commented_playbook.yml
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
View webtail.py
#!/usr/bin/python
# Equivalent of "tail -f" as a webpage using websocket
# Usage: webtail.py PORT FILENAME
# Tested with tornado 2.1
# Thanks to Thomas Pelletier for it's great introduction to tornado+websocket
# http://thomas.pelletier.im/2010/08/websocket-tornado-redis/
import tornado.httpserver
View headtail.py
import os
def head(filename, count=1):
"""
This one is fairly trivial to implement but it is here for completeness.
"""
with open(filename, 'r') as f:
lines = [f.readline() for line in xrange(1, count+1)]
return filter(len, lines)
View gist:2661851
#!/usr/bin/python
# Filename notify
# Description Show a notification in Gnome3
# Author Drew Fradette <http://www.github.com/drewfradette>
# Last Updated 2012-04-18
# Usage notify -t "Eat cheese" -m "It tastes delicious"
#######################################################
import pynotify
import sys
View gist:2645538
#!/bin/bash
# Filename benchmark
# Description execute a program periodically,showing fullscreen, colored output
# Author Drew Fradette <http://www.github.com/drewfradette>
# Last Updated 2012-05-08
# Usage benchmark example.com
# bash_version 4.2.10(1)-release
#######################################################
help() {
printf "Usage: ${0} example.com"
View gist:2618197
#!/bin/bash
# Filename watchc
# Description execute a program periodically,showing fullscreen, colored output
# Author Drew Fradette <http://www.github.com/drewfradette>
# Version 0.5
# Last Updated 2012-01-31
# Usage watchc -n 5 ls -lah /tmp
# bash_version 4.2.10(1)-release
#######################################################
usage() {
View gist:2617991
#!/bin/bash
# Filename catc
# Description print files to stdout with syntax highlighting (using python-pygments)
# Author Drew Fradette <http://www.github.com/drewfradette>
# Version 0.6
# Last Updated 2012-09-26
# Usage catc file.sh
# bash_version 4.2.10(1)-release
#######################################################