Skip to content

Instantly share code, notes, and snippets.

View mrtazz's full-sized avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
module Bundler
class Dsl
def gem(name, *args)
['Vendetta', 'Fight for NY', 'Icon'].sample
end
end
end
@mrtazz
mrtazz / graphline.sh
Created July 20, 2012 12:42
shell function to quickly check a graphite graph
#
# shell function to print graphite graphs as sparklines in the terminal
# needs https://github.com/holman/spark
#
function graphline() {
GRAPHITEHOST="graphite.example.com"
if [ ! -n "$1" ]; then print "Usage: $0 metric [minutes]"; return 1; fi
if [ ! -n "$2" ]; then MINUTES=10 ; else MINUTES=$2; fi
curl -s "${GRAPHITEHOST}/render?from=-${MINUTES}minutes&target=${1}&format=raw" | cut -d"|" -f 2 | spark ;
}
cassie:sensu:% curl -X GET unwiredcouch-sensu-api.herokuapp.com/info <deploy-heroku ✗>
{"sensu":{"version":"0.9.5.beta.2"},"health":{"redis":"ok","rabbitmq":"ok"}}
@mrtazz
mrtazz / version.txt
Created February 27, 2012 13:04
redistogo version
redis_version:2.4.6
redis_git_sha1:e1849b64
redis_git_dirty:0
arch_bits:64
multiplexing_api:epoll
gcc_version:4.4.3
process_id:31827
uptime_in_seconds:2887182
uptime_in_days:33
lru_clock:914202
@mrtazz
mrtazz / history.txt
Created September 15, 2011 13:47 — forked from kennethreitz/history.txt
Most used commands, in order by usage, since last install
588 git
328 ls
249 cd
146 make
112 vim
100 cat
73 echo
64 chef-client
61 knife
57 gcc
@mrtazz
mrtazz / codepoints.txt
Created June 8, 2011 10:06
UTF-8 sample content
0020 SPACE
0021 ! EXCLAMATION MARK
0022 " QUOTATION MARK
0023 # NUMBER SIGN
0024 $ DOLLAR SIGN
0025 % PERCENT SIGN
0026 & AMPERSAND
0027 ' APOSTROPHE
0028 ( LEFT PARENTHESIS
0029 ) RIGHT PARENTHESIS
@mrtazz
mrtazz / german_politics.mustache
Created April 5, 2011 19:43
Template for actions taken after a party polls badly (German edition)
{{party}} gets bad results in election.
{{leader}}, leader of {{party}}, steps down.
{{party}} elects {{new_leader}} as new leader.
{{new_leader}} promises that he will reinvent the party and earns back
the trust of the voters.
{{coalition_partner}} hopes they succeed fast with their endeavor.
{{member_of_opposition}} is sure that this will never work and that {{party}}
has chosen the wrong direction.
Nothing changes.
def tsplit(string, delimiters):
"""Behaves str.split but supports multiple delimiters."""
delimiters = tuple(delimiters)
stack = [""] # stack to return
for i in xrange(len(string)):
if string[i] in delimiters:
stack.append("")
else:
@mrtazz
mrtazz / redmine_psql_backup.sh
Created December 3, 2010 10:08
dump the redmine DB from psql and commit it to a git repository
#!/bin/sh
#
# shell script to dump a database from PostgreSQL and
# store it in git
#
AUTHOR="User <user@host>"
GITCMD="/usr/local/bin/git"
DUMPCMD="/usr/local/bin/pg_dump"
BACKUP_REPO="/path/to/repo"
@mrtazz
mrtazz / redmine_git_update.sh
Created November 30, 2010 22:01
zsh script to update 'git clone --mirror' repos for redmine
#!/usr/local/bin/zsh
# variables
gitcmd="/usr/local/bin/git"
REPOS="/home/redmine/repos/"
repos=(`ls -1 ${REPOS}`)
for r in ${repos[@]}
do
cd ${REPOS}${r} && $gitcmd fetch