yaydl 1.2

This version fixes and improves the support for dailymotion.com. The default file format for videos from dm is no longer flv, but mp4 instead. 56k users, don't panic...--forceflv still works. ;-)

Download the tar.gz

yaydl 1.1.5

As you already might have noticed, yaydl --sound fails from time to time when processing youtube videos, i.e. the resulting file isn't a valid mp3-file, but just raw data. The reason for this error lies within the file format. Earlier versions of yaydl always picked the flv version of a video, whereas newer versions always try to get the higher resolution mp4 files. Unfortunately, mplayer -dumpaudio doesn't work properly with these files. Therefore, yaydl from now on uses ffmpeg -vn -acodec libmp3lame -ab 192k*for non-flv videofiles from youtube. Nevertheless, I still would prefer the usage of mplayer for this purpose, but I didn't get it work... So, if you know how to extract the audio track from a mp4-file with mplayer, just drop me a note.*

Download the tar.gz

mfactorial

Recently, I was playing around with the GNU Multiple Precision Arithmetic Library. While most of the resulting code snippets are pretty much useless, the attached C program might be worth a blog entry. It calculates the factorial of a given number. At first glance, nothing special at all, but it does this task rather fast:

/* Naive algorithm*/
time ./fak  500000 > /dev/null

real    2m4.756s
user    2m4.637s
sys 0m0.094s


/*mfactorial*/
time ./mfactorial 500000 > /dev/null

real    0m7.855s
user    0m13.226s
sys 0m0.050s

Maybe I'll re-implement the whole thing using a real clever algorithm (e.g. split-recursive) some day, but for now, I'm content with the current speed. :-)

Download

BTW: The compiling instructions are included in the *.c file

Geballte Kompetenz

Heute Nachmittag, gegen ca. 16.00 Uhr kam die schreckliche Wahrheit ans Licht: Jede von Google indexierte Seite kann ihren Computer beschädigen!!!1elf Wer das Ganze verpasst hat, kann glücklicherweise immer noch auf die nun folgenden Screenshots zurückgreifen. *g*

http://pdes-net.org/x-haui/images/google_small.png http://pdes-net.org/x-haui/images/foobar_small.png
http://pdes-net.org/x-haui/images/web_small.png http://pdes-net.org/x-haui/images/x-haui_small.png

Graphical notifications for centerim

Using centerim's external configuration file makes it pretty easy to get notified about incoming messages. However, if you would add something like the following to your ~/.centerim/external, you'd be informed about *every* single incoming message, which doesn't make much sense, at least not in my eyes....

%action  notification
event msg
proto all
status all
options nowait

%exec
#!/bin/bash
#msg=`cat`
nick=$(head -n 1 $CONTACT_INFODIR/info)
echo "new message from $nick"  | dzen2 -bg red -fg white -p

To deal with this problem, I wrote two small perl scripts: centerim_notify.pl & offline.pl. The first one caters for the notifications and stores the screen name of your IM-buddy in a hidden file (~/.centerim/.seen) so you won't get notified again. The latter removes a chat partner from the list, when he logs off. So, here's how to use it:

  • Save both scripts to ~/.centerim/scripts/ and make them executable (chmod +x ...)
  • Put the following into your ~/.centerim/external:
%action  notification
event msg
proto all
status all
options nowait

%exec
#!/bin/bash
nick=$(head -n 1 $CONTACT_INFODIR/info)
~/.centericq/scripts/centerim_notify.pl "$nick"

%action offline
event offline
proto all
status all
options nowait

%exec
#!/bin/bash
nick=$(head -n 1 $CONTACT_INFODIR/info)
~/.centericq/scripts/offline.pl "$nick"
  • Create a bash alias that deletes the "seen-file" everytime you launch centerim:
echo "alias centerim='rm -f ~/.centericq/.seen && centerim -o'" >> ~/.bashrc
  • Run centerim!

Requirements: dzen2, perl and centerim ;-)