Skip to content

Instantly share code, notes, and snippets.

View felixhummel's full-sized avatar

Felix Hummel felixhummel

View GitHub Profile
Host foo
User felix
HostName foo.example.org
ProxyCommand /usr/sbin/proxytunnel --proxy=ssh-proxy.example.org:2222 --proxyauth=username:password --dest=%h:%p
@felixhummel
felixhummel / gist:589dc3ebdac5e4efb160
Created November 6, 2014 23:18
ipython[notebook] via pip on ubuntu 12.04
# probably missing some headers here ;)
sudo apt-get install build-essential python-dev libpng12-dev
# update pip (matplotlib wants latest)
sudo easy_install -U distribute
sudo pip install -U pyzmq "ipython[notebook]" matplotlib
# make stuff readable by all (got errors otherwise)
sudo chmod -R a+r /usr/local/lib/python2.7/dist-packages/{IPython,ipython-*,pyzmq-*,zmq*}
@felixhummel
felixhummel / .bashrc
Last active August 29, 2015 14:06
~/.pythonrc
export PYTHONSTARTUP=~/.pythonrc
diff --git a/auto/lib/openssl/conf b/auto/lib/openssl/conf
index a65815f..6a772ed 100644
--- a/auto/lib/openssl/conf
+++ b/auto/lib/openssl/conf
@@ -28,10 +28,10 @@ if [ $OPENSSL != NONE ]; then
have=NGX_OPENSSL . auto/have
have=NGX_SSL . auto/have
- CORE_INCS="$CORE_INCS $OPENSSL/.openssl/include"
- CORE_DEPS="$CORE_DEPS $OPENSSL/.openssl/include/openssl/ssl.h"
@felixhummel
felixhummel / insert_statement_to_alchemy_model.py
Created July 3, 2014 14:18
using sqlparse to convert sql insert statements to sqlalchemy model calls
import sqlparse
from sqlparse.sql import * # noqa
stmts = sqlparse.parse(open('data.sql').read())
TABLE_MODEL_MAP = dict(
sec_rolegroup='models.RoleGroup',
sec_role='models.Role',
sec_permissiongroup='models.PermissionGroup',
@felixhummel
felixhummel / useless.py
Last active October 27, 2018 22:18
You go figure it out. :P
import string
import sys
print (lambda c: (string.letters + string.digits) * (c/len((string.letters + string.digits))) + (string.letters + string.digits)[:c-len((string.letters + string.digits) * (c/len((string.letters + string.digits))))])(int(sys.argv[1]))
#!/usr/bin/env python
# vim: set fileencoding=utf-8 filetype=python :
"""
Prints the expiration time of a domain as seen from the host this is run on.
Example Output:
felixhummel.de (37.200.98.98): 3055 sec (about 50 min)
"""
from __future__ import print_function
#!/bin/bash
[[ $1 == 'skip' ]] || wget -c http://dir.xiph.org/yp.xml
python<<'EOF'
from lxml import etree
t = etree.parse(open('yp.xml'))
def urls_by_genre(genre):
think master /srv/salt # salt-call --version
salt-call 0.15.1
think master /srv/salt # ls -la /tmp/y
-rw-r--r-- 1 root root 0 Aug 2 15:18 /tmp/y
think master /srv/salt #
think master /srv/salt # echo 'changed' > x
think master /srv/salt # salt-call --local state.sls filewatch
[INFO ] Configuration file path: /etc/salt/minion
[INFO ] Executing command 'ps -efH' in directory '/home/felix'
[INFO ] Loading fresh modules for state activity
think master /srv/salt # salt-call --version
salt-call 0.15.1
think master /srv/salt # ls -la /tmp/y
-rw-r--r-- 1 root root 0 Aug 2 15:18 /tmp/y
think master /srv/salt #
think master /srv/salt # echo 'changed' > x
think master /srv/salt # salt-call --local state.sls filewatch
[INFO ] Configuration file path: /etc/salt/minion
[INFO ] Executing command 'ps -efH' in directory '/home/felix'
[INFO ] Loading fresh modules for state activity