Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabian Neumann hellp

View GitHub Profile
@hellp
hellp / fabfile.py
Created Mar 18, 2015
fabric: check for local availability of a command/program
View fabfile.py
with fab.settings(warn_only=True), fab.hide('warnings', 'running', 'stdout'):
has_local_redis = fab.local('which redis-cli').return_code == 0
@hellp
hellp / self-signed-cert-howto.rst
Last active Aug 29, 2015
How to create a self-signed root CA certificate
View self-signed-cert-howto.rst

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 / gnome-terminal-tmux
Created Jul 28, 2014
gnome-terminal-shell
View gnome-terminal-tmux
#!/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
View oldest-alive-code.sh
find . -iname "*.py" -exec git --no-pager blame -f -e {} \; | sort --key=4
@hellp
hellp / redislogginghandler.py
Last active Oct 3, 2015
RedisHandler for Python stdlib logging
View redislogginghandler.py
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
You can’t perform that action at this time.