LZWDecode a PDF File

Today I wanted to dissect a PDF file. Running pdf2ps quickly showed some big lumps of binary data. Looking a bit closer I found out that it is run through the filters ASCII85Decode and LZWDecode. After failing to decode this myself I searched again on the net and found the following blog entry:

Converting a PDF to PS without the LZWDecode filter

So just run the following commands:

qpdf --stream-data=uncompress original.pdf decoded.pdf
pdftops decoded.pdf decoded.ps

Reset Resolution of X Server after Program Crash

Today I played Warzone 2100. In the second mission in the beta camp I gave orders to build defenses, factories and other things. Then I loaded the transporter and started it to get to the missions map. But then the program crashed and left the X server in a pretty low resolution.

Now how do I reset the resolution?

Easy, the following line does the trick:

xrandr -s 1920x1080

You may have to choose the proper resolution for your monitor. Just entering xrandr without any options shows the available resolutions.

Beep Off!

Linux’ beep is much too loud. This is very annoying. I haven’t found a way to turn down the sound. But here is a way to completely switch the beep off (at least on debian):

cat > /etc/modprobe.d/pcspkr-blacklist.conf << EOF
# beep off you beep beep beep!!!
blacklist pcspkr
EOF

Also just remove the kernel module to get the same effect without reboot:

rmmod pcspkr

Aaah, much better now :)