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 / imap_check.py
Created September 18, 2012 04:06
quick script to check unread count of imap inbox
#!/usr/bin/env python
"""
small script to check for unread count on imap inbox
"""
import imaplib
IMAPSERVER = ''
USER = ''
PASSWORD = ''
@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 / 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
> echo -n "foo.bar:1|c" | nc -w0 -u 127.0.0.1 8125
> echo -n "foo.lerl:3|g" | nc -w0 -u 127.0.0.1 8125
> echo -n "foo.lol:33|ms" | nc -w0 -u 127.0.0.1 8125
> echo -n "foo.lol:43|ms" | nc -w0 -u 127.0.0.1 8125
> echo -n "foo.lol:53|ms" | nc -w0 -u 127.0.0.1 8125
@mrtazz
mrtazz / test-config.js
Last active December 15, 2015 13:49
StatsD example config
{
graphitePort: 2003
, graphiteHost: "127.0.0.1"
, port: 8125
, debug: true
, backends: ['./backends/graphite']
, histogram: [{ metric: "foo", bins: [0, 10, 20, 30] }]
, keyFlush: {
interval: "10000"
, log: "top-keys.log"
@mrtazz
mrtazz / Rakefile
Created November 12, 2012 18:47
a rakefile for generating pdf from latex
# Rakefile for building tex file
require "rake/clean"
require 'yaml'
# variables
BASE = "thesis"
TYPE = ".tex"
OUT = ".pdf"
TEXFILE = FileList[BASE+TYPE]
@mrtazz
mrtazz / ham.vim
Created October 27, 2012 03:22
when you need to go ham
"
" File: ham.vim
"
" When you need to go HAM
"
if &cp || (exists('g:loaded_ham_vim') && g:loaded_ham_vim)
finish
endif
let g:loaded_ham_vim = 1
@mrtazz
mrtazz / offlineimaprc
Created September 18, 2012 01:31
basic offlineimaprc
[general]
accounts = mail
maxsyncaccounts = 5
ui = ttyui
socktimeout = 90
[Account mail]
localrepository = maillocal
remoterepository = mailremote
autorefresh = 2
@mrtazz
mrtazz / client.rb
Created September 4, 2012 04:05
send chef-client output to syslog
require 'rubygems'
require 'syslog-logger'
log_level :info
Logger::Syslog.class_eval do
attr_accessor :sync, :formatter
end
log_location Logger::Syslog.new("chef-client")