Skip to content

Instantly share code, notes, and snippets.

View monstermunchkin's full-sized avatar

Thomas Hipp monstermunchkin

View GitHub Profile
@monstermunchkin
monstermunchkin / messaged.c
Created May 18, 2011 18:00
Avoiding zombie processes
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <unistd.h>
#include <signal.h>
#define PIPENAME "foopipe"
#define MAXLEN 100
@monstermunchkin
monstermunchkin / workspace.sh
Created April 27, 2011 15:20
Open and place 4 terminals
#!/bin/bash
pos=(0,31 705,31 0,492 705,492)
iter=0
for (( i = 0; i < 3; i++ )); do
Terminal --geometry 85x24
done
sleep 1
@monstermunchkin
monstermunchkin / rechenTrainer.py
Created February 2, 2011 13:47
WS10/11 Aufgabe 3
#!/usr/bin/python2
import random
# Anzahl falscher Antworten
Fehler = 0
# Alle Moeglichkeiten ermitteln
Aufgaben_total = []
for typ in ['+', '-', '*']:
for n1 in range(10):
@monstermunchkin
monstermunchkin / gist:805902
Created February 1, 2011 14:09
WS08/09 Aufgabe 3
#!/usr/bin/python2
class Datum09(object):
def __init__(self, Tag=4, Monat=2):
self.__hv = (31, 28, 30, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31)
self.__wt = ('Donnerstag', 'Freitag', 'Samstag', 'Sonntag',
'Montag', 'Dienstag', 'Mittwoch')
if Monat not in range(1,13) or Tag not in range(1,self.__hv[Monat-1]+1):
print 'Fehlerhafte Eingabe. Werte werden auf 4 und 2 gesetzt'
self.__tag = 4
#!/bin/bash
ls *.m4a | sed -rn 's/(.*)\.m4a/\1/p' | \
xargs -d '\n' -P 2 -n 1 -I{} ffmpeg -i "{}.m4a" \
-acodec libmp3lame -ab 320k "{}.mp3"