Skip to content

Instantly share code, notes, and snippets.

View raphaelm's full-sized avatar

Raphael Michel raphaelm

View GitHub Profile

Keybase proof

I hereby claim:

  • I am raphaelm on github.
  • I am raphaelm (https://keybase.io/raphaelm) on keybase.
  • I have a public key whose fingerprint is 6654 0831 7895 7043 9A44 C80D 4F70 B444 E1C6 8BA1

To claim this, I am signing this object:

@raphaelm
raphaelm / GPN14-CTF.md
Last active August 29, 2015 14:02
GPN14 CTF WriteUp
@raphaelm
raphaelm / benchmark-echo.php
Created April 18, 2010 13:06
PHP echo "",""; VS echo ""."";
<?php
ob_start();
$start = microtime(1);
for($i = 0; $i < 1000000; $i++){
echo "abc", "def", "ghi", "jkl", "mno", "pqr";
}
$end = microtime(1);
ob_end_clean();
echo "Kommas: ".(($end-$start)/1000000)."\n";
@raphaelm
raphaelm / ext.gif
Created April 19, 2010 17:14
Strahlensätze: JavaScript zur Berechnung fehlender Werte in bestimmten Figuren unter Anwendung der Strahlensätze
ext.gif
@raphaelm
raphaelm / unbenannt.pas
Created July 1, 2010 19:16
Fibonacci for lutoma's performance comparisons - in object free pascal
program unbenannt;
{$mode objfpc}{$H+}
uses sysutils;
var i, nums: integer;
var a, b, now: real;
BEGIN
@raphaelm
raphaelm / skype-ch.py
Created January 4, 2012 21:13
Skype+MPD currently hearing as message
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from mpd import (MPDClient, CommandError)
import sys
import datetime
import Skype4Py
from time import sleep
if len(sys.argv) < 2:
@raphaelm
raphaelm / tunnel.sh
Created June 7, 2012 17:43
SSH Tunnel + Chrome
#!/bin/sh
urxvt -bg black -fg green -e ssh -D 2323 HOST &
pkill google-chrome
killall google-chrome
google-chrome --proxy-server=socks4://localhost:2323&
@raphaelm
raphaelm / my_i3status.bash
Created December 28, 2012 21:30
Thinkpad X230 mic mute button status displayed in i3status, because even though you can make the button function via an ACPI event, it is impossible to use the button's LED with kernel 3.5 Requires: jshon
#!/bin/bash
i3status | while :
do
read line
if [[ "$line" == *"full_text"* ]] ; then
if ! amixer sget 'Capture',0 | grep '\[on\]' > /dev/null 2>&1 ; then
if [[ "$line" == ","* ]]; then
echo -n ","
fi
echo $line | sed s/^,//g | jshon -n object -i 0 -e 0 -s "name" -i "micmute" -s "mic muted" -i "full_text" -p | tr '\n' ' '
@raphaelm
raphaelm / elements.py
Last active December 12, 2015 03:58
Checks whether it is possible to compose a given name out of chemical element symbols, like Caroline out of Carbon (C), Argon (Ar), Oxygen (O), Lithium (Li) and Neon (Ne).
#!/usr/bin/env python
#
# elements.py
#
# Checks whether it is possible to compose a given name out of chemical
# element symbols, like Caroline out of Carbon (C), Argon (Ar), Oxygen (O)
# Lithium (Li) and Neon (Ne).
#
# The implementation consists of a simple backtracking algorithm.
#
#!/usr/bin/env python
"""
From https://github.com/docker/docker/issues/6354#issuecomment-60817733
All credit goes to https://github.com/adamhadani
Check all existing Docker containers for their mapped paths, and then purge any
zombie directories in docker's volumes directory which don't correspond to an
existing container.
"""