Asterisk cirpack problem with Free and

If you configured your Asterisk/FreeSWITCH server to talk to your (french Free ISP provider), you’ll see in the logs the following warning message:
[Feb 12 09:29:06] WARNING[9228]: chan_sip.c:6624 determine_firstline_parts: Bad request protocol Packet

This is not really a problem, but an annoyance, as it fills up your logs. This is a known problem for more than years, but has never been corrected (neither by Asterisk nor by Cirpack devs). The usual correction was to add the following line to your startup scripts (/etc/rc.local on Debian for example):
iptables -A INPUT -p udp -m udp --dport 5060 -m string --string "Cirpack KeepAlive Packet" -j DROP

But the syntax has changed in iptables, and you’ll get the error:
iptables v1.3.6: STRING match: You must specify `--algo'

so, just add one of the 2 available algorithms (bm and kmp):
iptables -A INPUT -p udp -m udp --dport 5060 -m string --string "Cirpack KeepAlive Packet" --algo bm -j DROP

Easy chess games for kids (mate in one)

UPDATE: You can get a much better revised version of the PDF now, with coordinates, in this newer post.

In my journey to teach chess to Ido, an easy (I thought) job was to generate diagrams where he has to find mate in a fixed number of turns. Starting with mate in one.
It appeared that making diagrams is an easy task, as there are many programs (Linux and Windows) that permit this.
On Linux, the best I could find is scid. That’s cool as I use it to maintain my databases of games. Even cooler, is that scid development has just restarted (stopped around 2004!), with the help of Pascal Georges. Using scid (I’m using the 3.7devel2009 version) I can export games to HTML or even to LaTeX files.

At first I thought I’d create the endings myself, for example, using online diagrams generators or using Wikipedia/MediaWiki’s templates, but it was not so easy, so I thought about making a program to generate them.
Generating one from scratch would take me time I really don’t have, and there are just two python modules that give high-level functions to chess.
So I started looking for projects similar to mine, that include games with mate in one. I found a small database of mate in one on my favorite chess website, in the download section: a Chessbase datafile with 1171 mate in one studies! So cool.

Well, It was really a pain to convert that Chessbase (.cbv) file, as the only program able to convert to PGN is running on Windows (at least it’s free). You just have to follow the instructions from this thread.
After getting a nice PGN file, just open it with scid, go to “Tools”, then select “Write the filter”, and choose LaTeX. You’ll get a TeX file. Use you favorite TeX generator (Live TeX seems to be the one today), like this for example, to generate directly a PDF file:

(Yes I had to cleanup a bit the file before generating the .pdf)

The result is here, 196 pages of tests (6 one each page) if you don’t want to fight with the missing TeX modules (you’ll need chess12.sty) and get a nice result.

I’m sure many people search for this kind of file, so I’m pretty happy to help other parents/coaches.

White mate in one

White mate in one

Edit: I added a PDF version without the solution included.