WatchDog for Raspberry Pi

Debian / Raspberry Pi

Bild: jarmoluk / pixabay.com

for a Raspberry Pi used in remote, automated systems watchdog timers are essential.

„A watchdog timer (sometimes called a computer operating properly or COP timer, or simply a watchdog) is an electronic timer that is used to detect and recover from computer malfunctions. During normal operation, the computer regularly resets the watchdog timer to prevent it from elapsing, or „timing out“. If, due to a hardware fault or program error, the computer fails to reset the watchdog, the timer will elapse and generate a timeout signal. The timeout signal is used to initiate corrective action or actions. The corrective actions typically include placing the computer system in a safe state and restoring normal system operation.“ (Wikipedia)
Read More

einfaches Debian Jessie mit hüpschem XFCE

Debian

einfaches Debian Jessie mit hüpschem XFCEin den letzten tagen hab ich ein paar alte laptops und schwachbrüstige nettops mit Debian Jessie und einem hüpschen XFCE bestückt. hüpsch hier meint mit Greybird Theme und Faenza Icons.

nachdem ich wahrscheinlich in die verlegenheit komme das noch öfters zu tun oder wahrscheinlich sogar danach gefragt werde, wie ich denn das bewerkstelligt habe, darf ich das in diesem blog-eintrag für die nachwelt festhalten.

Read More

kostverächter

Debian

kostveraechterwas mich schon seit längerem stört, daß mein USB-kartenleser keine karten mehr erkennt (eigentlich alle auf allen rechnern), außer, man steckt ihn mit geladener karte frisch an oder die karte steckt schon während des bootens drinnen.

dieses problem ist auch ausführlich hier beschreiben. ich selbst kann mich nicht mehr erinnern, seit wann dieses fehlerbild aufgetreten ist.

die lösung dazu ist jedenfalls ganz einfach: kernel polling aufdrehen.

echo 'ACTION=="add", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="2000"' > /etc/udev/rules.d/61-removable-storage-polling.rules

bleibt der nachwelt herauszufinden, warum denn das plötzlich nicht mehr so ohne weiteres zutun funktioniert hat.

Apache 2.2 on Debian Wheezy w/ PHP-FPM, FastCGI, APC and a kind of suEXEC

Apache / Debian / PHP

won’t talk about pros and cons of PHP-FPM, FastCGI, APC and all that stuff, there are tons of articels around, see also the links below.

main urge was to speed up PHP with APC, get rid of preforked Apaches, run PHP scripts as their native user and many more.

just giving an overview how I’ve easily set it up here, having different „customers“ programming their own PHP scripts and also Debian packages ready to run.

Read More

force iptables to log into own logfile

Debian

as Andrea described there is an easy way to force iptables to log into its own logfile. I’d like to sum it up in this post.

you need to change all your log-prefixes to have a unique keyword, e.g. netfilter as I do in the following example.

iptables -A INPUT -j LOG --log-prefix "netfilter in: "

afterwards just add some filter conditions for rsyslogd. place a file called 10-iptables.conf into /etc/rsyslog.d/ with the following content.

:msg, contains, "netfilter"	/var/log/iptables.log
:msg, contains, "netfilter"	~

both lines match on every log message containing netfilter, but first line writes it to /var/log/iptables.log and second line drops it to avoid further processing.

a good idea will be to enable logrotating that you’ll not got fucked up by a full /var-filesystem. just copy paste rsyslogs logrotating config. place a file called iptables into /etc/logrotate.d/ with the following content.

/var/log/iptables.log
{
	rotate 4
	weekly
	missingok
	notifempty
	compress
	delaycompress
	sharedscripts
	postrotate
		invoke-rc.d rsyslog rotate > /dev/null
	endscript
}