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 | |
# 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 | |
####################################################### |
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
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) |
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 | |
# 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" |
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
--- | |
# ^^^ 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. |
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/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 |
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/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 |
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 | |
# 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() { |
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 | |
set -e | |
git rev-parse --show-toplevel |