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
@mrtazz
mrtazz / irssi_osx_dock.markdown
Created July 4, 2012 22:08
Shortcut for OSX dock to run irssi in tmux with iTerm2

Shortcut for OSX dock to run irssi in tmux with iTerm2

Synopsis

I run irssi inside a tmux session on OSX. I often close the terminal as I usually get notified by growl about important stuff. I don't want to open a terminal and write a command every time I want to check IRC.

The solution

1. Create a shell script with the following content

#!/bin/zsh
/usr/local/bin/tmux attach -d -t irssi || /usr/local/bin/tmux new -s irssi irssi
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 / couchdb.rb
Created December 12, 2010 15:58
simple couchdb API wrapper in ruby from the CouchDB wiki, with some adaptions for basic auth
require 'net/http'
module CouchDB
class Server
def initialize(host, port, options = nil)
@host = host
@port = port
@options = options
end
@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