Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🔧
computer plumbing

Daniel Schauenberg mrtazz

👨‍🔧
computer plumbing
View GitHub Profile
@mrtazz
mrtazz / imap_check.py
Created Sep 18, 2012
quick script to check unread count of imap inbox
View imap_check.py
#!/usr/bin/env python
"""
small script to check for unread count on imap inbox
"""
import imaplib
IMAPSERVER = ''
USER = ''
PASSWORD = ''
@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 / 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 fresh-install.mkd
View gist:5270999
> 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 Dec 15, 2015
StatsD example config
View test-config.js
{
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 Nov 12, 2012
a rakefile for generating pdf from latex
View Rakefile
# 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 Oct 27, 2012
when you need to go ham
View ham.vim
"
" 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 Sep 18, 2012
basic offlineimaprc
View offlineimaprc
[general]
accounts = mail
maxsyncaccounts = 5
ui = ttyui
socktimeout = 90
[Account mail]
localrepository = maillocal
remoterepository = mailremote
autorefresh = 2
@mrtazz
mrtazz / client.rb
Created Sep 4, 2012
send chef-client output to syslog
View client.rb
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")