Raspberry Pi als Kiosk mit resourcenschonendem Browser und VESA Mount
Auf der Arbeit sollte ich einen Raspberry Pi zu einem reinen Service-PC im Kiosk-Modus umwandeln. Dafür habe ich ein VESA kompatibles Gehäuse auf ebay gekauft, das man hinten an den Monitor schrauben kann. Über einen DVI-HDMI Adapter wird das Bild ausgeliefert, dazu noch eine Maus und Tastatur über USB und ein Netzwerkkabel. Anleitungen wie man Raspbian installiert gibt es schon genügend, also überspringe ich mal den ganzen Installations- und Konfigurationspart. An Browsern habe ich Chromium aufgrund des eingebauten Kiosk Modus ausprobiert und dann noch Midori, weil der vorinstalliert ist. Chromium hat schlicht zu viele Resourcen gefressen und Midori hat nicht das geboten, was ich wollte. Ich wollte einen Browser, der absolut idiotensicher nur diese eine Seite anzeigt, kein Adressfeld, kein Quelltext ansehen o.ä.Ich stieß dann irgendwann auf den kiosk-browser von Peter Schultz auf github. Im Grunde sind es nur
ein paar Zeilen C-Code, die ein Fenster mit GTK+ öffnet und darin ein WebKit-Widget lädt. Das ist übrigens dasselbe Framwork, das auch Chromium benutzt. Zusätzlich hat er noch 2 Signale auf Tasten auf dem Keyboard gemappt, eins für Aktualisieren(F5) und eins um den Vollbildmodus zu verlassenn(F11). Das Aktualisieren habe ich drin behalten, aber da ich keine Notwendigkeit sehe, den Vollbildmodus zu verlassen, diese Zeile Code einfach auskommentiert.
Dann habe ich natürlich noch die Standardwebsite geändert. Mit nodm(s.u.) machte er trotzdem Proleme also habe ich noch folgende Zeilen hinzugefügt um das Bild immer mittig zu halten und in der Größe meines Bildschirms darzustellen:
gtk_window_set_default_size(GTK_WINDOW(window), 1280, 1024); gtk_window_set_position(GTK_WINDOW(window),GTK_WIN_POS_CENTER_ALWAYS);
Den vollen Quelltext findet ihr hier: browser-repat.c
Auch die Makedatei hat bei mir nicht funktioniert, ich habe ein Haufen Fehler nach diesem Schema bekommen:
undefined reference to `gtk_XXX
Stattdessen funktionierte bei mir dieser Befehl:
gcc -o browser browser.c $(pkg-config --libs --cflags gtk+-2.0 webkit-1.0)
Schlussendlich habe ich noch xorg und nodm installiert um lightdm bzw. lxde (wegen den ganzen Tastenkombinationen) los zu werden. Dabei habe ich diese Anleitung von nexxylove befolgt.
Die browser-Datei wandert in /usr/local/bin und in ~/.xsession steht nur:
#!/bin/bash /usr/local/bin/browser
Dann wird noch in /etc/X11/default-display-manager statt /usr/sbin/lightdm einfach /usr/sbin/nodm eingetragen und in /etc/default/nodm der Wert NODM_ENABLED auf true gesetzt.
Dining Philosophers with monitor using pthread mutex and condition variables in C
I had to do this for uni a while ago so I thought I might as well publish it. The task was to implement the Dining philosophers problem in C. We had to use the monitor concept which is implemented with mutual exclusion (mutex) from the pthread-library because C lacks a built-in monitor function in contrary to e.g. Java, Python or Delphi. Bascially this just means, the critical things have to go between pthread_mutex_lock(&mutex) and pthread_mutex_unlock(&mutex) The communication from one philosopher to another was realized with condition variables(cond-vars). The realisation of thinking and eating should be done by to empty loops that go to a huge number(so it takes a while even on todays computers). A debug printout should be implemented as well to control everything is working as expected. Nearer details can be found in the doxygen documentation or directly in the sourcecode.
Download
27c3 Android App
Update: see below
Github: https://github.com/repat/27c3-Android-App
So this is my version of the 27c3 Android Fahrplan App. At the moment it only links to the fahrplan website, depending on which day/event you click. The advantage is, it's always uptodate;)
Please note the following:
- I'm not a Java programmer, I just had a look at Android again after quite a while
- This is a very alpha version
- If I find some time, I'm gonna extend it to a real app
- But I don't think so, so feel free to download the sourcecode and extend it yourself
- I really don't know why it's able to access the SD card and telephone status...don't worry about it;)(see comment)
- It's quite late at night right now...:P
Screenshots (click to enlarge)

update:
- added TabView for events and speakers
- can't fix the Requirements(SD/Telephone status) because you need API Level 4 for targetSdkVersion. Otherwise all the people with Android <1.5 would not be able to use my app
mapstraceroute – graphical traceroute with google maps
German/Deutsch
Wird mal wieder Zeit für ein neues Projekt von mir. Ich hatte ja schonmal irgendwann über Gtrace/Geotrace/xtraceroute etc geschrieben, aber diese Programme sind alle schon knapp 10 Jahre alt. Teilweise funktionieren sie noch aber in Zeiten von google maps und APIs kam mir die Idee ein neues Programm zu schreiben, in Python. Ich hab wirklich einfach mal drauf losgeschrieben, ohne einen Plan. Der Code sieht nicht besonders schön aus(grade nicht für python), das weiss ich.
Das Programm bekommt also vom Programm traceroute die IP-Adressen, holt sich dann von hostip.info die entsprechenden Koordinaten und mithilfe des python wrappers für die google maps API pymaps wird dann eine HTML-Seite erstellt. Diese wird direkt im Anschluss über das python modul python-gtkmozembed angezeigt. Sie enthält allerdings bis jetzt nur Punkte. Demnächst werd ich mich nochmal damit beschäftigen, dass zwischen den Punkten dann in der richtigen Reihenfolge auch Linien gezogen werden. So sieht das Ganze bis jetzt aus:
English
Time for another one of my projects. I blogged about GTrace/Geotrace/xtraceroute a while ago, but these applications are nearly 10 years old. They partly work but in times of google maps and APIs my idea was to write a new app, this time in python. I really didn't have any plans how to do it, I just started writing. It's not very code(especially for python), I know.
My application gets the IP adresses from the (system) traceroute command, then receives the coordinates from hostip.info and with the python wrapper for the google maps API - pymaps - a HTML page is genereated. This HTML page if opened by the python module python-gtkmozembed. Until now there are only points, but if I've got some free time in the next couple of months, I'm trying to draw lines too. This is what it looks like until now:
Requirements:
- python
- traceroute
- python-gtkmozembed
How-To:
- Download
- unpack and cd in the folder
- run install.sh as root or with sudo
- try it out: mapstraceroute <host>
There's heaps of things to do though(Thats why it's only o.1a;)):
- rewrite the whole code more modular/write it a bit more elegant;)
- draw lines between the points
- include own traceroute in python(?)
tar.gz entpacken
Ich vergess jedes mal wieder die Reihenfolge, wenn ichs nich alle paar Tage benutz, warum auch immer...-.-
tar -xzvf foobar.tar.gz
So.
//edit: Ich hab mir mal ein kleines Programm dafür geschrieben: Download tarhelp
repat@laptop:~$ gcc -o tarhelp tarhelp.c repat@laptop:~$ sudo mv tarhelp /usr/bin [sudo] password for repat: repat@laptop:~$ tarhelp You lamer, you will never learn it. Its tar -xzvf repat@laptop:~$
xplanetbatch
Vorweg: Das Script für Linux befindet sich etwas weiter unten...
Ich hab ein Programm für xplanet geschrieben, das regelmässig die batch-Datei aufruft, die das Bild aktualisiert. In der restlichen Zeit versteckt es sich im Tray. Das Intervall ist natürlich einstel- und speicherbar. Die Dateien müssen im selben Ordner wie xplanet.exe und xplanet.bat sein. Sicherheitshalber hab ich nochmal eine default xplanet.bat hinzugefügt.

Vll gibt es schon solche Programme, aber hat Spass gemacht, es zu programmieren:)
Download






