Skip to content

Instantly share code, notes, and snippets.

View stefreak's full-sized avatar

Steffen Neubauer stefreak

View GitHub Profile
@stefreak
stefreak / keybase.md
Created February 16, 2022 08:50
keybase proof

Keybase proof

I hereby claim:

  • I am stefreak on github.
  • I am stefreak (https://keybase.io/stefreak) on keybase.
  • I have a public key ASCyBWYn67yROQ-uDymTUyCeK5wos1t6zMLEwA3J0W3S8Ao

To claim this, I am signing this object:

import signal
import logging
import time
import sys
from contextlib import contextmanager
from typing import Callable
LOG = logging.getLogger(__name__)
@stefreak
stefreak / snake.ino
Created December 16, 2013 22:48
arduino fritzing led matrix snake
#define X 1
#define Y 0
#define GAMESTATE_NORMAL 0
#define GAMESTATE_GAMEOVER 1
int soundPin = 4;
int rowPins[8] = {
9,22,18,12,15,11,7,6}; // matrix rows connected to the Arduino
@stefreak
stefreak / gray.ino
Last active December 31, 2015 13:49
arduino fritzing led matrix shades of gray
int rowPins[8] = {
9,22,18,12,15,11,7,8}; // matrix rows connected to the Arduino
int colPins[8] = {
13,8,17,10,5,16,19,14}; // matrix columns connected to the Arduino
int image[8][8]={ // the image displayed on the matrix : 1 = LED on, 0 = LED off
{1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 },
{2 , 2 , 2 , 2 , 2 , 2 , 2 , 2 },
@stefreak
stefreak / normalize-default-route.sh
Created August 4, 2011 10:53
OpenVPN fails to replace the default route on some UMTS/PPP connections. This script fixes the default route by adding the gateway information to the default route.
#!/bin/bash
if [ $(ip route list exact default |\
awk '/^default/ {print $2}') = dev ];
then
IF=$(ip route | awk '/^default/ {print $3}')
GW=$(ip address show $IF |\
awk '/peer/ {print $4}' | cut -d"/" -f1)
ip route replace default via $GW dev $IF
fi