Programmierung

Debian Paket erstellen

http://wiki.ubuntuusers.de/Grundlagen_der_Paketerstellung

Python GTK+ 3 Tutorial

http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html#

Lightpd & Python

https://wiki.archlinux.de/title/Lighttpd#Python

Raspberry PI

Überwachung:
To watch the current CPU speed:
watch cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq
To watch the current CPU temp:
watch /opt/vc/bin/vcgencmd measure_temp
To watch the current CPU voltage:
watch /opt/vc/bin/vcgencmd measure_volts

Python Daemon

http://www.python.org/dev/peps/pep-3143/#id5
http://code.activestate.com/recipes/577911-context-manager-for-a-daemon-pid-file/

import fcntl
import os

class PidFile(object):
    """Context manager that locks a pid file.  Implemented as class
    not generator because daemon.py is calling .__exit__() with no parameters
    instead of the None, None, None specified by PEP-343."""
    # pylint: disable=R0903

    def __init__(self, path):
        self.path = path
        self.pidfile = None

    def __enter__(self):
        self.pidfile = open(self.path, "a+")
        try:
            fcntl.flock(self.pidfile.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
        except IOError:
            raise SystemExit("Already running according to " + self.path)
        self.pidfile.seek(0)
        self.pidfile.truncate()
        self.pidfile.write(str(os.getpid()))
        self.pidfile.flush()
        self.pidfile.seek(0)
        return self.pidfile

    def __exit__(self, exc_type=None, exc_value=None, exc_tb=None):
        try:
            self.pidfile.close()
        except IOError as err:
            # ok if file was just closed elsewhere
            if err.errno != 9:
                raise
        os.remove(self.path)

# example usage
import daemon
context = daemon.DaemonContext()
context.pidfile = PidFile("/var/run/mydaemon")

Pyro Timeouts

http://permalink.gmane.org/gmane.comp.python.pyro/2387

Python Treeview

http://python-gtk-3-tutorial.readthedocs.org/en/latest/treeview.html