Even more pdf fun on linux

Who says pdf support on linux is weak? 😉 Using free tools only, I can actually do more on linux than on windows.

A friend asked me to adapt a brochure which is in pdf format so that his contact data are filled in at the designated area on the last page. I didn’t have high hopes, as I know pdf editing is clumsy, even on windows using Adobe Acrobat. But I thought I’d give it a google search, and guess what, I stumbled upon pdfedit which seems to be able to do the job quite adequately! The only downside is the speed. I hope they port it to Qt 4 and fix the speed issues while they’re at it. 😉 (and apparently there are some plans!)

pdfedit ftw

Converting multiple images into a pdf on linux

Update 2012-03-13
I don’t know if it was possible back in 2008, but nowadays you can simply use the convert command provided by imagemagick!

convert image1.jpg image2.jpg output.pdf

Normally, when I need to create a PDF, I can print to the PDF printer included with KDE. However, on my suse box, this only seems to work out of the box with KDE apps. Also, since I need to combine multiple images into a pdf, it is a bit cumbersome to use a PDF printer here.

I didn’t find a one-step solution, so here is how I did it:

  1. convert each image to a pdf
  2. merge all pdfs into one pdf file

For the first step I used bmeps, a tool which I recently discovered by accident 🙂 It is strange, when searching for the tool, I didn’t find it. So that’s why I give it some extra promo on my blog. 😉 Bmeps is a cross platform tool (yes, I already once used it succesfully on windows!). It used to be a (E)PS tool, but since version 2.0 it also supports PDF output (up to PDF version 1.4). As input, it accepts JPEG, netpbm and PNG (and TIFF partially).

As Bmeps doesn’t seem too popular, I wasn’t too surprised to learn my distro doesn’t have any package for it, so I had to build it from source. Bmeps has a dependency on dklibs, a collection from the same author which also needs to be compiled. But it turned out to be a pleasant experience: all prerequisites were already satisfied on my computer (except netpbm, but I don’t need that) and I just had to run the familiar “configure make install” (once for dklibs and once for bmeps of course).

After that, converting an image to a pdf is as simple as:

bmeps image.jpg image.pdf

Now we have a bunch of pdf files, we still need to merge them. For that I chose the quite popular pdftk. It wasn’t installed by default, but there does exist a package in the suse main repositories, so that was easy. Now, to combine all pdfs into one:

pdftk input*.pdf cat output output.pdf

And that’s it!

PS: there used to be a tool png2pdf from the same author for people wanting to convert PNG files, but this has been superseded by bmeps.

Extract audio from AV container

A while back, I posted a link to a program for splitting off the audio of an FLV file.

The linux equivalent would be to use mplayer, your video swiss army tool 😉

I’ve put it into a convenient KDE (3) service menu entry (copy paste in a file in $HOME/.kde/share/apps/konqueror/servicemenus):

[Desktop Entry]
Encoding=UTF-8
ServiceTypes=video/*
Actions=extractaudio

[Desktop Action extractaudio]
Name=ExtractAudio
Name[en]=Extract audio
Exec=mplayer -dumpaudio %u -dumpfile %u.dump
Icon=sound

Now you should have an action “Extract audio” when you right click on a video file. It should work on all mplayer supported video files.

Boot process explained

It’s always nice to be reminded of the more important things in life, like how computers boot, *ahem* 🙂
Seriously, as a computer enthousiast, it’s like I _have_ to know about it, yet I don’t seem to be able to remember all the details 🙂
So guys like duarte chop it into nicely digestable pieces, ideally suited as bed time story material, so it can enter your subconscience when you go to sleep =)

Portal on linux

Portal: Prelude triggered me to finally try out Portal under linux / wine. Actually the only games I played since I’m on linux are Urban Terror and … Peggle Extreme. 🙂 Don’t laugh, it was a Steam test. 😉 And I didn’t have any space to install anything bigger. Until I bought that 0.5TB drive a while ago, still didn’t fill that one up, so today I decided to try it out under opensuse 11.0 with KDE 4.1 and wine 1.1.6. I somehow messed up my steam install under 10.3 and since I got 15GB free on my suse 11 partition and up to date video drivers (since it is also a kde 4 tryout install), this seemed like an ideal environment. Indeed, it actually went very smoothly.

  • install latest wine from build service
  • install iexplore gecko replacement by surfing to an url: wine iexplore http://winehq.org
  • download steam msi (exe no longer needed!) and run: wine start steaminstall.msi
  • see the update fail and resume it manually: nice -n 19 wine Steam.exe or wine steamTmp.exe SelfUpdate “Steam.exe” 14
  • create a desktopshortcut from steam. you have to use kde 4.1 folderview if you actually want to see it 😉
  • run!

Some screenshots to prove 😉


Portal on linux / wine Portal on linux / wine

While framerate seems okay and my savegames and profile seem intact, I did experience some graphical glitch: when looking through portals, sometimes white flicker occurs. I didn’t investigate any further as it’s late enough.

Optimizing the linux boot process

How fast your linux boots, really depends on your distro and of course it’s their job to have it boot as fast as possible. They try as much as possible scenarios and make sane decisions on where to optimize. But they can’t test every possible configuration, so what if you just end up with a suboptimal situation (possibly without realizing? :)). Even if you know your boot takes too much time, how would you locate the culprit(s)?

This is where Bootchart jumps in. Bootchart is a tool which makes it possible assess resource consumption throughout boot time. It is really simple to set up, just add a kernel param! Data is collected in memory using tmpfs and dumped to disk at the end of the boot process. This data then gets processed by a java app which outputs an SVG/PNG.

It seems the opensuse guys, actually coolo, used this tool to optimize boot performance for opensuse 10.3. I must say I am quite satisfied with my opensuse boot times although I do have the impression that 11.0 seems to be a tad slower than 10.3. So I’m definitely going to try out this tool and compare the results 🙂

Thanks to my brother for the tip.

Part 2

Accidentally, a few hours after writing this post, I ran into this very interesting article about boot speedups presented at the Linux Plumbers Conference last month. (Watch a modified fedora boot in 5 secs on an eeePC)

openSUSE fan

I have these linux habits which are hard to control and recently I discovered a new one while working on my windows box at work.

You know you’re a

  • linux fan when you type ‘ls’ every time you mean ‘dir’
  • KDE/KWin fan when you try moving/resizing windows with the alt+mouse buttons
  • and now, here it comes.. 😉

  • openSUSE fan when you type ‘net suse’ instead of ‘net use’

I needed 3 tries before I got it right! 🙂

openSUSE forum

first thing one does, when getting stuck on a problem with openSUSE is google it up. If nothing turns up, check the bugtracker. No luck? Check the fora. Yes, this is where the pain starts. Until recently, there were, like, 3 fora or something where you had to look up and create an account if you wanted to add a remark, ask a question. They finally combined forces and merged them all and made them even official! That’s great news I believe. Having a single point of access for support questions is really important, even more for early adopters. With openSUSE 11 right around the corner, the timing couldn’t have been any better!

of course, you can always join the #suse IRC channel on freenode if you’re a more chattive type of person 😉

why openSUSE 11

As you might have guessed by the countdown on the right, I’m anxiously awaiting the opensuse 11 release. IMO, the revamped package management system will be THE killer feature. Not only will it have the fastest dependency solver on the planet, by using lzma compression (cfr. 7zip) it will have smaller file sizes yielding even faster installs!

Even though this release will be a .0 release, I will be eagerly upgrading as every time I install new software / patches, I am reminded how fed up I am with 10.3’s package system. This is my only complaint about openSUSE 10.3! They claim it should not be a problem for average users with not much repositories. So now I know: even on linux I’m not a ‘normal’ user. 😉 (which was confirmed by a suse guy @ fosdem looking at my repository list ;))

9 days to go, mmmmm 🙂