Beware of the Paypal

I recently had a cancelled transaction with paypal. I payed, an hour later the shop told me they don't have the product available. The payment was cancelled.

And then paypal froze the money in my account: "money withheld". 13 days after the transaction the money is finally back on my bank account and I think to myself: Avoid paypal, especially for large sums of money.

Of course Paypal loves to get an involuntary free two week credit from me and work my money without giving me anything back. And that they just freeze my money just shows you what kind of company paypal is.

If you, too, live in Europe and get into trouble with Paypal, don't hesitate but contact FIN-NET, the european bank complaint network:
http://ec.europa.eu/internal_market/finservices-retail/finnet/index_en.htm
The more people complain, the more paypal will have to behave itself.

Recordable CDs and DVDs Tested

The German "Stiftung Warentest" tested various kinds of recordable CDs and DVDs. The results show that TDK is a recommendable brand for recordable CDs and Verbatim is good at making recordable DVDs.

The test can results can be read for free online. If you don't speak German, check out the google translation.

Fast PAL HD Video encoding in Sync with ffmpeg-svn from AVHCD to Mpeg4 under Linux

I have actually found a very very nice solution to the high definition video(AVCHD) transcoding problem. I got the ffmpeg svn checkout from yesterday (21.08.2008) and it works great with this script, all in one. No need for extra tools. And it's quite speedy.


#/bin/sh

FFM=$HOME/src/ffmpeg/ffmpeg
BR=3000 # kbit
OUT="${1}.mkv"

[ -f "$OUT" ] && exit 1;

echo $1
# old ffmpeg versions (2008):
nice $FFM -r 50 -i "$1" -s 1280x540 -ilme mpeg4 -acodec copy -aspect 16:9 -b ${BR}k "$OUT"
# new ffmpeg versions (January 2009): -r 50 might still be necessary.
nice $FFM -i "$1" -s 1280x540 -flags ilme -flags ildct -vcodec mpeg4 -acodec copy -aspect 16:9 -b ${BR}k "$OUT"


The only problem is that the current ffmpeg checkout does not listen to the -r parameter. So you have to manually override the frames per second when playing the file, e.g. mplayer -fps 50. I use mplayer -fps 50 -fs -af volnorm -vf pp=fd.

You need might need to adjust the path to ffmpeg in the script obviously, e.g. to $HOME/ffmpeg/ffmpeg.

Of course if you have a camera that records 29.97 frames per second you have to change the numbers accordingly. (-r 59.94)

If you've got several cores you may want to experiment with the -threads option and make sure you have compiled with --enable-pthreads, see below.

The great thing is that the video is encoded quickly - I get 23 fps on my celeron m530 notebook - and the video is perfectly in sync, and you only need ffmpeg, nothing else.

You should install a fresh ffmpeg from SVN:

svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-nonfree --enable-gpl --enable-pthreads && make && sudo make install.


Be careful where you put every ffmpeg parameter, as ffmpeg interprets them differently depending on the order you give them. E.g. ffmpeg -r 50 -i ... differs from ffmpeg -i ... -r 50.

Enjoy fast and sync video transformation!

If it doesn't work for you, try out this script, which is the result of the long discussions below.

Comfortable Direct HD Video Encoding from AVCHD to Mpeg4

This nice little script encodes avchd m2ts files from e.g. an HD camcorder directly to mpeg4 avis. It uses a temporary file in the /tmp dir for the audio stream, but the rest is done using fifo pipes. You need to install the csh shell interpreter to run it. And you need to setup the environment from this package: (by invoking ./install, then ./installasroot, you need to modify the download script and change the JM version).

The script works badly on multi-core systems, but you can invoke it several times at once. It's originally a modified version of the script from this package, but I changed it so you can run it several times concurrently (with the same file names in different folders). I also added a check to prevent it from encoding files where the output files already exist. I recommend to run it on an entire directory for i in *.m2ts; do echo encoding $i; hdencode $i; done


#!/bin/csh

set BR=5000
set lavcopts="-lavcopts vcodec=mpeg4:vbitrate="$BR":turbo:threads=1:autoaspect:ilme:ildct"
set lavf="-of lavf -lavfopts format=mp4"
set menco="-vf scale=1280:540:1 $lavf"
set fps="25" # "29.97"
set ending="mp4"
set delay="-delay +0.7"

nice
#The scripts and instructions in this package are free to use and
#redistribute AT YOUR OWN RISK!! Standard disclaimers apply.
#NO WARRANTY!

if ( $#argv == "0" ) then
echo usage: $0 filename.m2ts ...
exit
else
set files=($*)
endif

set path = ( . $path )

echo using:
which xporthdmv || exit
which ldecod || exit
which ffmpeg || exit

echo $0 Starting.
echo " "
foreach file ($files)
if ( ! -f $file ) then
echo file $file not found
exit
endif

rm -f ./bits0001.mpv ./bits0001.mpa

set filebase=`basename $file | sed s/\.m2ts// | sed s/\.MTS//`
set audiofile=/tmp/$filebase-$$".ac3"
set videofifo=/tmp/$filebase-$$".yuv"
set outputfile=$filebase"."$ending

if ( -f $outputfile ) then
echo file $outputfile already exists
exit
endif

if ( ! -f $audiofile ) then
echo xporthdmv -h $file 1 1 1
xporthdmv -h $file 1 1 1 && mv bits0001.mpa $audiofile
else
echo $audiofile already exists, not creating it.
endif

mkfifo $videofifo

if ( ! -f $videofifo ) then
echo ldecod -i bits0001.mpv -o $videofifo
ldecod -i bits0001.mpv -o $videofifo &
#ldecod -i bits0001.mpv -o $videofifo
else
echo $videofifo already exists, not creating it.
endif

if ( ! -f $outputfile ) then
echo mencoder $videofifo -demuxer rawvideo -rawvideo w=1440:h=1080 -aspect 16:9 -ofps $fps \
-ovc lavc -o $outputfile"-tmp" $lavcopts $menco

mencoder $videofifo -demuxer rawvideo -rawvideo w=1440:h=1080 -aspect 16:9 -ofps $fps \
-ovc lavc -o $outputfile"-tmp" $lavcopts $menco

echo mencoder $outputfile"-tmp" -aspect 16:9 -ofps $fps \
-audiofile $audiofile \
-oac copy -ovc copy \
-o $outputfile

mencoder $outputfile"-tmp" -aspect 16:9 -ofps $fps \
-audiofile $audiofile $delay \
-oac copy -ovc copy \
-o $outputfile
else
echo $outputfile exists, not creating it.
endif
end

#echo To remove temporary files: rm -f /tmp/*.ac3 /tmp/*.yuv
rm -f ./dataDec.txt ./log.dec bits0001.mpv $videofifo $audiofile $outputfile"-tmp"
echo $0 complete.

Minimal X Environment

If you want to e.g. use nxserver, but only for a few selected applications it is often wise to install just the most basic packages, in ubuntu these are
xfonts-base xterm xutils xauth icewm

Then you should be able to login with nxclient, if you set it to use the custom environment with a virtual desktop and to execute /usr/bin/icewm.

Warning: Upgrade from Feisty to Hardy

If you want to upgrade your server system from Feisty to Hardy, make sure you're not running kernel 2.6.22-15-server, as the upgrade will crash with a problem creating your UFT8 locale, localedef will occupy all cpu. The work around is to simply boot 2.6.22-14-server and then do the upgrade. That will save you a lot of trouble.

Oggrecode Script

This script recodes an entire directory to a new quality of vorbis. It could easily be modified to transcode to ogg as well.


#!/bin/bash
# (c) 2008 linux-tipps.blogspot.com
# published under the GNU GPL v 3.0

echo OggRecode v 0.01
echo

OUTDIR="$1-recode_q$2"
ME=`basename $0`

if [ $# != 2 ]; then
echo \#$ME \"directory\" quality
echo I need two parameters: a directory and a quality setting,
echo but you gave me $# parameter\(s\): \($ME $*\)
echo
exit 1;
fi

if [ ! -d "$1" ]; then
echo Parameter \"$1\" is not a directory!
# direct file handling here
exit 2;
fi

if [ -e "$OUTDIR" ]; then
echo A file or directory with the name \"$OUTDIR\" already exists.
exit 3;
fi

if [ ! -f "$1"/*.ogg ]; then
echo No vorbis files found in directory \"$1\":
echo Directory listing:
ls "$1";
echo ---
echo
exit 4
fi

mkdir "$OUTDIR"
cd "$1"

for i in *.ogg; do
TO="`basename $i`"
TO="$i"
cd ..
cd "$OUTDIR"
echo Recoding \"$i\" ...
echo oggdec -Q -o - ../"$1"/"$i" \| oggenc -q "$2" -o "$TO" -
oggdec -Q -o - ../"$1"/"$i" | oggenc -q "$2" -o "$TO" -
echo ... finished recoding \"$i\".;
echo
done

cd ..
echo Finished encoding


Fix for the Samsumg yepp YP-T6 mp3 player settings.dat battery problem

If you've got the Samsumg yepp YP-T6 mp3 player and you have the problem where after a while the settings.dat gets corrupted and the mp3 keeps telling out it's out of battery, then you probably just have one or more files that the mp3 has troubles with during playback.

In my case it was an ogg vorbis file and I think it was probably because the bitrate was too low at some point in the file. Try deleting the last file you heard before the problem occurs and then post your results in the comments.

If you know of a better fix, please let everyone know.

Helping Windows Users with UltraVNC Single Click and ssvnc from Linux

If you ever (try to) use UltraVNC Single Click to help Windows users from Linux, you will find out that it's not that easy. Though you can use the UltraVNC viewer in Wine, you may see disconnects after around 15 minutes. The easy solution lies in starting a regular TightVNC with these parameters:

xtightvncviewer -listen 0 -encodings "hextile copyrect"

Replace the 0 with the display number, e.g. 0 for port 5500 or 400 for 5900. (port = 5500 + x) You need to have the package xtightvncviewer installed for this to work in Ubuntu. The color parameter does not work properly in this configuration.

Or give ssvnc a try. It works even with SCIII (uvnc Single Click via SSL), supports different color depths and much more!

And if you've got a current wine version, you might as well use the original ultravnc viewer. It works fine by now.

I usually use ssvn and the following script to start the vnc listener and quit it when finished.
VNC=$HOME/src/ssvnc/bin/tightvncviewer
$VNC -listen 487 -use64 & # 64 colors
read -p "Press enter when finished"
killall tightvncviewer vncviewer

Interesting KDE Feature Requests

  • 60037: JJ: "duplex printing wizard" for simplex printer
  • 86787: Merge & Split PDF documents
  • 37838: first key eaten by screen lock
  • 22540: Creating/Editing Symlinks
  • 79721: collaborative editing over a network (kate)
  • 87758: Supporting http 1.1 pipelining
  • 34362 support for additional mouse buttons
  • 165368 DPMS does not work with automatically started screensaver
  • 107302 Associate any virtual desktop with any xinerama screen
  • 37067 Per-virtual-desktop containments*
  • 91809 kpdf cant fill in formulars*
  • 125952: calendar synchronization with Google Calendar (korganizer)
  • 158556: Plasma Panel cannot be hidden*
  • 104464: Different styles for KMenu*
  • 59859: Major Improvements for the "What's this?" Item
  • 81272: Use more than one line per mail in message list
  • 50255 can I send mail later?
  • 102284: Support for Greasemonkey / User Javascript
  • 112027: adding smileys received from other people (kopete)
  • 87600: limit download bandwidth (kget)
  • 33839: add suspend / hibernate logout button (kdm)

(Wow I love the auto-save feature of Blogger. And Opera really still has issues in Linux.)

  • 92238: New sound theme for KDE
  • 64763: Support for UltraVNC file transfers

Open the webpage http://bugs.kde.org/show_bug.cgi?id=x to find out more about the bug, x being the bug number.

So there's a lot of things you can do if you're interested in KDE development. Of course you should first contact the developers of the part you want to fix to make sure there's not already someone working on it etc.

Also check out the complete list.

* Update: A lot of this stuff has already been fixed! Wow... nice.

KDE's Most Popular Feature Requests

KDE's Most Popular Feature Requests are...

http://bugs.kde.org/buglist.cgi?short_desc_type=allwordssubstr&short_desc=&long_desc_type=allwordssubstr&long_desc=&bug_status=UNCONFIRMED&bug_status=NEW&bug_status=ASSIGNED&bug_status=REOPENED&bug_severity=wishlist&bugidtype=include&bug_id=&votes=100&emailassigned_to1=1&emailtype1=substring&email1=&emailassigned_to2=1&emailreporter2=1&emailcc2=1&emailtype2=substring&email2=&changedin=&chfieldfrom=&chfieldto=Now&chfieldvalue=&newqueryname=&order=bugs.votes,bugs.priority%2C%20bugs.bug_severity%2C%20bugs.bug_status%2C%20bugs.bug_id%20desc

Somehow I doubt these bugs are very representative, though. And some of them are not up to date anymore. It is also disconcerting how many of these have existed for years without being fixed.

Kool Feature: Multiple Displays as Multiple Virtual Desktops

As most Linux Desktops already have Virtual Desktops, I've always wondered why multiple displays aren't mappable to a virtual desktop each. And it seems like wasn't the only one: http://bugs.kde.org/show_bug.cgi?id=107302. Unfortunately noone seems to be at it even in times of KDE 4.1.

Also check out http://bugs.kde.org/show_bug.cgi?id=64268 to go along with it.

Mounting ssh filesystem via fstab entry

The fstab entry has to look like this

sshfs#user@server:/directory    /localmount_directory    fuse  defaults,noauto  0 0

I use these options 

rw,noauto,nosuid,nodev,user,kernel_cache,auto_cache,transform_symlinks,reconnect

Git Magic

If you ever run into trouble trying to do something that should be really easy with git but doesn't seem to be, if you want to learn git or think you already know everything important about it, and in many other cases, this article about git is a must read:

http://www-cs-students.stanford.edu/~blynn/gitmagic/

Unknown CMake command "kde4_add_ui_files"

If you get this error

Unknown CMake command "kde4_add_ui_files"

while trying to use cmake, it usually means that

find_package(KDE4 REQUIRED)

is missing from the CMakeLists.txt file. Try adding it to the CMakeLists.txt file somewhere before kde4_add_ui_files is first called.

An example
project(plasma-network)

set(network_SRCS
network.cpp)

kde4_add_ui_files(network_SRCS config.ui )


becomes:
project(plasma-network)

set(network_SRCS
network.cpp)

find_package(KDE4 REQUIRED)

kde4_add_ui_files(network_SRCS config.ui )


See here for more information: http://www.vtk.org/Wiki/CMake:How_To_Build_KDE4_Software#Where_to_find_more_information .g

By the way, the same line helps for problems with "macro_optional_find_package" and most other KDE compilation problems.

Standby/Suspend to Ram with Dbus and HAL in KDE 4/GNOME/XFCE

I was trying to work out how to issue the standby command over dbus so that I can send my computer to standby with just a single click from a desktop icon. It turns out at least ksmserver can't receive such a command as there isn't even a type for it in kworkspace:

http://api.kde.org/4.x-api/kdebase-workspace-apidocs/libs/kworkspace/html/kworkspace_8h-source.html

00049 enum ShutdownType {
00053 ShutdownTypeDefault = -1,
00057 ShutdownTypeNone = 0,
00061 ShutdownTypeReboot = 1,
00065 ShutdownTypeHalt = 2
00066 };

So the best I could come up with was this to shut down the system(If anyone has seen suspend anywhere in KDE dbus, please comment!):

dbus-send --session --dest=org.kde.ksmserver --type=method_call \
--print-reply /KSMServer org.kde.KSMServerInterface.logout int32:-1 int32:2 int32:2


But then I found out you can use hal directly and finally I had my script working for immediate suspend:

dbus-send --system --dest=org.freedesktop.Hal --type=method_call \
--print-reply /org/freedesktop/Hal/devices/computer \ org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0

This should work in any desktop environment. You can replace the 0 after "int32:" with the number of seconds to delay the Suspend. And you can also use it for hibernation:

dbus-send --system --dest=org.freedesktop.Hal --type=method_call \
--print-reply /org/freedesktop/Hal/devices/computer \ org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate

Now we can enjoy suspend with a single click. Just put it into a shell script and link that to your desktop.