tom's blog

Howto: Log firewall from OpenWrt to a remote rsyslog

This is how I got remote logging from my OpenWrt router to the syslog daemon on the server box.

On the server side, I enabled remote logging over UDP (refer to the rsyslog or syslog-ng documentation).

On the OpenWRT box following steps are needed

Enable remote syslog logging

Edit /etc/config/system and enable remote logging by adding:

option 'log_ip' ''

Now reboot the router and see if it logs correctly.

Solaris and DNS

Just that I'll never have to google this one up again....

To get Solaris to make use of your ususal DNS

cp /etc/nsswitch.conf /etc/nsswitch.conf.orig
cp /etc/nsswitch.dns /etc/nsswitch.conf
echo "nameserver xxx.yyy.zzz.bla" >> /etc/resolv.conf
svcadm restart nscd

There we go.

Search for a good audio player

For a long time i've been a fan of simple WinAMP-style music players, and went the XMMS -> BMP -> Audacious way. Then, with my collection growing over the years, I got to like library driven players, with Amarok 1.4* being the best regarding music management capabilities.

Running KDE4 I decided to get rid of kdelibs-3 and everything depending on it, inkluding Amarok 1. So I need a new music manager/player.

This is what I tried out so far:

Howto: Convert avi/mov/any video to Flash/flv on Linux

Recently I wanted to convert a Quicktime .mov video to Flash .flv in order to post it on this page, for the fun of it.
First thought: uuuh how do I do this on Linux? But it's pretty simple, thanks to ffmpeg. Works fine with anything that ffmpeg can play, so avi, mpeg, wmv or whatever.

It's as simple as:

ffmpeg -i input.avi -s 320x240 -ar 44100 -o movie.flv

There is also a nice tool to add metadata info like duration etc to flv files, called flvtool2.

Bash pattern matching

BASH offers a nice way to replace patterns. Until now I always used basename and a variable.
For example moving all .jpeg files in a folder to .jpg (hey, it's just an example..)

for moo in *.jpeg; do
    newname="`basename $moo .jpeg`.jpg"
    mv $moo $newname

But isn't that just plain ugly? That one is lot nicer:

for i in *.jpeg; do
    mv "$i" "${i%.*}.jpg"


Howto: receive mail and save attachment with fetchmail, procmail and metamail

At work I recently had to set up a solution that periodically checks a POP3 account on our M$ Exchange wannabe mailserver, and saves the attachments to some folder for further processing. As I didn't find a ready-to-go-solution for this on the web, just snippets here and there, and of course hundrets of other people asking the same, here it is.

You will need