Avoid preload under Lucid

Since Ubuntu 8.04 one of the first packages I have installed after a fresh system install was preload. So I did this also for Lucid but discovered that it does not work well together with ureadahead.

preload is a daemon that fetches libraries and binaries into memory based on statistics of your application usage. Often used applications will start up faster.

ureadahead
will read all files that are used during boot into memory so that the different start up scripts and services do not need to be loaded individually. It will improve the boot performance.

The combination of both does not work well. Boot time did increase significantly and even worse: sometimes my screenlets did not start up after login.

After removing preload everything was good again: quick boot times and reliable start of my start up applications.

Back to top

VNC viewer with panning

Once in a while I want to take over my desktop machine from my notebook.

On my desktop I can simply run

x11vnc -loop

to fire up the VNC server.

On the notebook I can connect via

vncviewer <hostname or ip of desktop>

Because the desktop screen is much bigger than the notebook screen, I have to deal with scrollbars in the viewer application to navigate on the big desktop screen.

My notebook has Intel graphics, so I can use xrandr to enable panning on a bigger virtual screen. So I wrote this little script to connect to my desktop pc sirius:

#!/bin/sh
HOSTNAME="sirius"
LOCAL_RES="1366x768"
REMOTE_RES="1920x1200"
xrandr --output LVDS1 --panning "$REMOTE_RES"
vncviewer $HOSTNAME
xrandr --output LVDS1 --panning "$LOCAL_RES"

With this script the notebook screen switches to a big virtual screen with panning (screen window follows the mouse) before starting the remote desktop viewer. So no scrollbar handling an more :-)

Back to top

Tweak gdm for web browsing without login

With the new gdm its possible to tweak the login screen to do some fancy stuff (see forum post http://ubuntuforums. … thread.php?t=1333683). By following these steps we can enable web browsing without user login.

1. To allow a network connection:

sudo cp /usr/share/app-install/desktop/nm-applet.desktop /usr/share/gdm/autostart/LoginWindow

2. Install alltray (needed to get Firefox into the bottom tray):

sudo apt-get install alltray

3. To add Firefox in the bottom tray:
Drag and drop Firefox from the menu to your desktop and copy it to the autostart directory of user gdm:

sudo cp /home/<user>/Desktop/firefox.desktop /usr/share/gdm/autostart/LoginWindow/

Change the desktop file to start Firefox in alltray:

sudo sed -i 's/^Exec=/Exec=alltray /' /usr/share/gdm/autostart/LoginWindow/firefox.desktop

4. Logout again to see the changes of gdm.
If you have created your wireless connections as a normal user before and flagged the connection data to be used for all users, wireless should work without setting up a password. Else you have to follow the instructions in the forum post ( http://ubuntuforums. … thread.php?t=1333683) to set up the network.

There is only one issues, but I can live with it. The Firefox tray starter will vanish after closing Firefox and the browser can not be started again from the login screen.

Back to top

Cowon D2, ffmpeg and Ubuntu 10.04 Lucid Lynx

I’ve installed Ubuntu 10.04 Lucid Lynx in order to replace my main desktop running 8.10. The biggest problem I’ve encountered yet was that ffmpeg can no longer encode videos for my little Cowon D2 media player.

I was using this command to encode the videos and it worked well under 8.10:

ffmpeg -i <file> -r 25 -b 600k -mbd rd -flags +4mv+aic -cmp 2 -subcmp 2 -g 300 -vcodec libxvid -acodec libmp3lame -ab 128k -async 1 -s 320x240 -aspect 4:3 <outfile>

On Lucid ffmpeg gives this version

FFmpeg version SVN-r0.5.1-4:0.5.1-1ubuntu1

on Intrepid it’s this one

3:0.svn20080206-12ubuntu3.1

I tried to install the latest ffmpeg (http://ubuntuforums. … wthread.php?t=786095) but the problem remained. So I checked the version on 8.10 and compiled an old ffmpeg version like this, assuming you compile everything under /home/myname/software.

1. To build xvidcore, get xvidcore-1.1.2 and extract it to /home/myname/software/

cd /home/myname/software
cd xvidcore-1.1.2/build/generic
./configure
make

2. Build a static executable of an “old” ffmpeg version by checking out the version from 2008-02-06:

cd /home/myname/software
svn checkout -r {2008-02-06} svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --enable-gpl --enable-nonfree --enable-pthreads --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libtheora --enable-x11grab --enable-libxvid --extra-libs=/home/myname/software/xvidcore-1.1.2/build/generic/=build/libxvidcore.a  --disable-shared --enable-static --extra-libs=-static --extra-cflags=--static
make

The library options are there to build a static version including the xvid codec.

Now I’ve got some compilation errors and had to fix some lines in file ffmpeg/libswscale/swscale.h (I’ve attached the file). The compilation did run through now and created a static ffmpeg. With this new “old” ffmpeg a can encode the videos again for the D2 with the command mentioned above.

I’ve also attached my static version. It can be executed on it’s own from any directory.

Back to top