Skip to content

Instantly share code, notes, and snippets.

@hellp
hellp / redislogginghandler.py
Last active October 3, 2015 08:47
RedisHandler for Python stdlib logging
import logging
import redis # http://pypi.python.org/pypi/redis
class RedisHandler(logging.Handler):
def __init__(self, lname, conn, *args, **kwargs):
logging.Handler.__init__(self, *args, **kwargs)
self.lname = lname
self.channel = lname + ":chan"
self.redis_conn = conn
find . -iname "*.py" -exec git --no-pager blame -f -e {} \; | sort --key=4
@hellp
hellp / gnome-terminal-tmux
Created July 28, 2014 19:15
gnome-terminal-shell
#!/bin/bash
set -e
TMUX="/usr/bin/tmux"
SESSIONNAME="gnometerminal"
if $TMUX has-session -t $SESSIONNAME
then
$TMUX new-session -t $SESSIONNAME \; new-window
else
$TMUX new-session -s $SESSIONNAME
fi
@hellp
hellp / self-signed-cert-howto.rst
Last active August 29, 2015 14:05
How to create a self-signed root CA certificate

To access and sync my Owncloud's calendar and contacts with my Android phone in a (more-or-less) secure manner through HTTPS, I needed to get a SSL/TLS certificate. Or precisely: a self-signed root CA (Certification Authority) certificate.

After searching for Howtos and creating a bunch of CA certificates, normal certificates, signing them, signing them vice-versa etc. -- yes, I don't really have a clue -- I mostly run into one of these errors:

  • when signing normal cert with CA cert: "not self-signed"
@hellp
hellp / fabfile.py
Created March 18, 2015 11:53
fabric: check for local availability of a command/program
with fab.settings(warn_only=True), fab.hide('warnings', 'running', 'stdout'):
has_local_redis = fab.local('which redis-cli').return_code == 0