Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
@mrtazz
mrtazz / irssi_osx_dock.markdown
Created Jul 4, 2012
Shortcut for OSX dock to run irssi in tmux with iTerm2
View irssi_osx_dock.markdown

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
View gist:2018934
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 Feb 27, 2012
redistogo version
View version.txt
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 Sep 15, 2011 — forked from kennethreitz/history.txt
Most used commands, in order by usage, since last install
View history.txt
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 Jun 8, 2011
UTF-8 sample content
View codepoints.txt
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 Apr 5, 2011
Template for actions taken after a party polls badly (German edition)
View german_politics.mustache
{{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.
View tsplit.py
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 Dec 12, 2010
simple couchdb API wrapper in ruby from the CouchDB wiki, with some adaptions for basic auth
View couchdb.rb
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 Dec 3, 2010
dump the redmine DB from psql and commit it to a git repository
View redmine_psql_backup.sh
#!/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 Nov 30, 2010
zsh script to update 'git clone --mirror' repos for redmine
View redmine_git_update.sh
#!/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