Linux: PhD thesis & pdftk command

February 3rd, 2014

thesisRecently I have finished my PhD thesis and sent it to the printer. During the process I have encountered various problems relating to Arabic texts and font issues, page numbering, automatic creation of the list of references, and even more page numbering. As a consequence, creating the thesis, technologically wise, was a joint effort between Windows, Linux, and many different programs:

MS Word 2010
Adobe Acrobat

In order to make the final pdf-file I created a rather impressive command that automatically put most pages together in the right order. Most pages, because 20 pages are not taken into account by the command.

pdftk A="part-2/2-thesis-1.pdf" B="part-2/2-thesis-2.pdf" C="overig/leeg.pdf" D="overig/3-1.pdf" E="overig/3-2.pdf" F="overig/3-3.pdf" G="overig/4-1.pdf" H="overig/4-2.pdf" I="overig/4-3-double.pdf" J="overig/5-1.pdf" K="overig/6-1-double.pdf" L="overig/6-2.pdf" M="overig/8-1.pdf" N="overig/app-quotes.pdf" cat B1-17 C A19 B20-38 A39 B40-71 C A73 B74-92 D2 B94-116 E2 B118 F2 B120-123 C A125 B126-128 G2 B130-132 H2 B134-135 I B138-160 A161 B162-163 J1 B165-193 C A195 B196-197 K B200-218 L2 B220-229 C B231-241 C N C B253-258 M2 B260-261 C B263-276 output part-2.pdf

See for the result:

Comments Off | Category: Uncategorized

Linux: Animated gifs from youtube videos

February 21st, 2013

The following animated gifs are short scenes from youtube videos. They are looped, which occasionally gives a mesmerizing effect.



The original videos can be found here, here, and here. Programs that I use are youtube-dl, avidemux, and mplayer. I have taken the following steps to create these gifs.

  • Download the entire video:
  • Use avidemux to select the desired part and save it as bestand-1.avi
  • Remove the sound:
    mencoder -ovc lavc -nosound bestand-1.avi -o bestand-2.avi
  • Crop the video:
    mencoder -ovc lavc -vf crop=140:140:105:45 bestand-2.avi -o bestand-3.avi
  • Resize to 100×100:
    mencoder -ovc lavc -vf scale=100:100 bestand-3.avi -o bestand-4.avi
  • Convert to animated gif in black/white:
    mplayer bestand-4.avi -saturation -100 -vo gif89a:output=bestand-5.gif:fps=30
  • Or convert to animated gif, colors:
    mplayer bestand-4.avi -vo gif89a:output=bestand-5.gif:fps=30

Note that gif images are limited to 256 colors; it is for this reason that black/white gifs almost always yield better results.

Comments Off | Category: linux

Linux: Youtube videos integrated in desktop

May 29th, 2012

Shantz xwinwrap (see previous post) can integrate pretty much any video on the desktop, simply by calling mplayer. In combination with the tool youtube-dl you can also view any youtube videos, directly on the desktop. Without any advertisements. As an example, the following command plays Lady Gaga’s Poker Face. Interesting mplayer options are to play the video in black and white, and to mute the sound. Simply change the URL to view any other video.

color, sound:
xwinwrap -g 640x480+100+100 -ov -ni -s -st -sp -b -nf -- mplayer -wid WID -hue 0 -saturation 0 -volume 100 $(youtube-dl -g "")

black and white, muted:
xwinwrap -g 640x480+100+100 -ov -ni -s -st -sp -b -nf -- mplayer -wid WID -hue -100 -saturation -100 -volume 0 $(youtube-dl -g "")

Comments Off | Category: linux

Linux: Live stream tv integrated in desktop

April 30th, 2012

One of the cool things of Linux is that you can pipe the output of any program into another program, and in this way combine various programs. With the combination rtmpdump and mplayer you can view live streaming tv, outside the flash applet of the web browser. Streams that can be viewed include Al Jazeera, Russia Today, and France 24 (see the topics on Crunchbanglinux and Reddit for more information). As an example, Al Jazeera English can be viewed with the following command:
rtmpdump -v -r "rtmp://" | mplayer -

From this starting point, I wanted to integrate the stream on the desktop. I couldn’t figure out how to do this initially, but with the help of the people on the Archlinux forums and after some tweaking with a program called shantz xwinwrap, I now have integrated live streams on the desktop. This can be done by issuing the following command:
rtmpdump -v -r "rtmp://" | xwinwrap -g 640x360+100+100 -ov -ni -s -st -sp -b -nf -- mplayer -wid WID -

For a screenshot, click here. You can see that the video is completely integrated, and that the fluxbox menu remains accessible too. Of course any other live stream can be viewed and integrated too. For this you need to sniff the rtmp stream with a program called wireshark. There’s a tutorial on Youtube how to do this.

Comments Off | Category: linux online

April 30th, 2012

Ostia, hef het! Hef eraan, Ostia! Van der zooi! Weg van der zooi! Hemhem. Hemhem.

Comments Off | Category: Uncategorized