Freitag, 18. Juli 2008

Folderview in KDE4 RC1 under Kubuntu

I you have been looking for the folderview plasmoid like me, then here is how you get it under Kubuntu 8.04:

sudo apt-get install kdebase-plasma-kde4

Now the folderview plasmoid should be available to you in the plasmoid list...

Wie verwendet man den Robbe Lipo Top Equalizer S6?

Naja, wenn man es weiss funktioniert das Teil recht gut, aber bis dahin hat es mich nur genervt. Mit der Anleitung in der Hand und dem Equalizer in der anderen versuchte ich meine Lipo Akkus zu laden. Allesamt 3S Typen unterschiedlicher Hersteller.

Ich hatte immer damit angefangen den Balancer Anschluss des Akku an den Equalizer anzuschliessen und dann die Akku Kabel. In dieser Reihenfolge fängt es Teil nur wild an zu blinken und meldet, fehlerhafter Balanceranschluss. Also nächsten Akku versucht - wieder fehlerhafter Balanceranschluss... hmm bei allen Akku's? Kann nicht sein...

Also bei diesem Gerät kommt es auf folgende Reihenfolge an:

  1. Ladegerät an den Equalizer anschliessen - ohne Ladestrom zu aktivieren.
  2. Lipo Akku mit den dicken Plus/Minus Kabeln an den Equalizer anschliessen. Jetzt müsste die Rote LED des Equalizer bereits leuchten und den Single Mode anzeigen (Dauerlicht).
  3. Jetzt das Balancerkabel an den Equalizer anschliessen.
  4. Jetzt den Mode Taster des Equalizer 1x drücken. Jetzt sollte dieser im Sekundentakt blinken und damit anzeigen, das er zusammen mit einem Lipo-Lader betrieben wird.
  5. Jetzt kann man am Ladegerät den Ladevorgang starten.

In dieser Reihenfolge funktioniert die Kombination Robbe Equalizer / Lipo-Lader ausgezeichnet.

Mittwoch, 9. Juli 2008

Find files using disk space under Linux ...

Even with the largest harddrives at some point they run out of memory. Now you would like to find out where all the space is used. Under Linux you do it like this:

  1. Finding folders using a lot of disk space:
    user:/ # du -hs *

    This will give you a summary of the folders under root dir ('/') and their memory usage.
  2. Find files above a specific size
    Now let's assume that you found the folder using up the most disk space. Which files are cousing this? Well simply try to find the files that are e.g. larger than 30MByte:
    user:/ # find -type f -size +30M

    This will give you a list of all files larger than 30MByte. 

With the above information you should be able to locate the candiates using up the space of your harddisk.

Dienstag, 1. Juli 2008

Stolp Starlet - SA 500



Dieses schöne Modell gibt es bei PAF (Peter Adolf Flugmodelle). Das Modell kommmt ohne Querruder aus dem Baukasten. Die Ruder werden laut Bauplan mit Stahlstiften an die Fläche geklebt. Ich habe einen Umbau vorgenommen, und die Querruder beweglich mit Tesafilm angebaut. Da die Fläche viel zu dünn für ein Servo ist, habe ich eine eigene Konstruktion unter der Flächenmitte erstellt.

Das Modell fliegt sehr gutmütig, benötigt vorne im Rumpf aber jede Menge Blei. Das macht das Landen auf Rasen, ohne Kopfstand etwas schwierig.

Ansonsten ist der Rumpf vorne sehr lang und schmal. Das erschwert die Motormontage erheblich. Auch die Positionierung des Akku's ist in diesem Rumpf problematisch und durch die Fahrwerksaufnahme noch weiter eingeschränkt.
Kann man aber mit diesen "Problemchen" leben, dann hat man ein gutmütiges und optisch sehr schönes Modell.

Remastering Kubuntu Live CD

I have to say a very special thank you to Winnie. I did try to remaster a Knoppix live system and failed because my final result would no longer autologon the knoppix user account, making my own Linux live cd useless.
But then I found Winnie's great howto for remastering a Kubuntu live CD which is even more up to date to the latest software versions out there - at least compared to Knoppix at the time of this writing.

So why did I try to remaster a live Linux CD? Well I wanted to have a small Live Linux CD(!) system that had Qt 4.3.x and KDevelop installed and ready to be used on it. I browsed a lot of different distros but none of them did have KDevelop preinstalled. So I had to create my own Live-Linux-KDevelop-CD guided by Winnie .
Step by Step

For all of the steps to work, you need to run a Kubuntu system yourself. Since I use openSuSE on my notebook, I simply used a Kubuntu 7.10 Desktop Live CD to start a Kubuntu system for all required utilities and as a master for my new modified Live CD. I did use a normal USB harddrive with an ext3 formated partition to be able to extract the content of the live CD on it.

For the remainder of this documentation, I assume that the external USB drive has been mounted under $USBDISK = /media/disk
1) Creating directories for the remastering

Since we can't change anything on the Live-CD itself, we need to create an exact copy of the CD on our USB disk. Then we need to unpack the compressed data from the CD as well. For that we need to create some folders:
> mkdir $USBDISK/kubuntu710
> mkdir $USBDISK/squashmount
> mkdir $USBDISK/squashexpanded

Now we can make a clone of the Live-CD and place it onto the USB disk:
> rsync -a /cdrom $USBDISK/kubuntu710
2) Adding support for squash file system

The compressed drive of the Live-CD does use a read only file system called squash fs. We need to add some tools to our running live system, so that we can work with that file system:
> sudo apt-get install squashfs-tools
3) Mounting the Live-CD squash drive

Now we can mount the compressed Live-CD file system onto our USB disk:
> mount -t squashfs -o loop $USBDISK/kubuntu710/caspar/filesystem.squashfs $USBDISK/squashmount

Now you are able to access the content of the compressed file system. So we will clone that file system onto our USB disk:
> rsync -a $USBDISK/squashmount $USBDISK/squashexpanded

4) Changing the content

Now we are able to enter the virtual Live-CD environment to be able to change it's content. Feel free to add and remove SW as you like, however make sure your final image does still fit onto the CD. But let's enter the new environment:
> chroot $USBDISK/squashexpanded

You may need to specify a nameserver for DNS to work (replace xxx.xxx.xxx.xxx with your name server):
> echo "nameserver xxx.xxx.xxx.xxx" > /etc/resolv.conf

To be able to access the Internet we need to mount the proc file system:
> mount -t proc /proc proc

To take advantage of the full Kubuntu software repositories, you should enable more repositories in apt's sources.list file:
> vi /etc/apt/sources.list

Enable the repositories you need, most likely universe / multiverse. Save your changes and update the package list:
> apt-get update

Now install software with:
> apt-get install new-package

Or remove software using:
> apt-get remove package

You can query installed software using the dpkg command. E.g. to search for installed office applications:
> dpkg-query -W *office*

The packages that are presented, can be used as a guide for removal from the Live-CD.

Looking for new packages to install? Just type this:
> apt-cache search appname
5) Leaving the squash file system

When you are satisfied with your software selection, we can prepare to exit the chroot environment. Before you do so, you need to cleanup the system and remove all unused files:
> apt-get clean
> ...

You should remove all files that you don't need on the live CD.

Next you should update the filesystem manifest, containing the list of installed applications:
> dpkg-query -W –showformat=‘${Package} ${Version}n’ > /tmp/filesystem.manifest

When that is done, you need to unmount the proc file system first:
> umount /proc

Then you can exit the environment with:
CTRL+D

Now you are back in the running Kubuntu Live-CD session.
At this point you move the filesystem manifest to the proper Live-CD location:
> mv $USBDISK/squashexpanded/tmp/filesystem.manifest $USBDISK/kubuntu710/caspar/filesystem.manifest
> cp $USBDISK/kubuntu710/caspar/filesystem.manifest $USBDISK/kubuntu710/caspar/filesystem.manifest-desktop

Next you can create the ISO image.
6) Creating a new squash file system, creating a new Live-CD ISO image

At this point you are almost done. First we will create a new squashfs file holding your modified Kubuntu system:
> umount $USBDISK/squashmount
> rm $USBDISK/kubuntu710/caspar/filesystem.squashfs
> mksquashfs $USBDISK/squashexpanded $USBDISK/kubuntu710/caspar/filesystem.squashfs


Finally we can create a new ISO image for our new Live-CD:
> cd $USBDISK/kubuntu710
> mkisofs -r -V “MKRUEGER” -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -o ../kubuntu710-custom.iso .

That's it. You now have a customized ISO image of your own Kubuntu distribution. Start your favorite cd burning application and burn a CD from the image. Enjoy your own Live-CD.

Most of the steps above have been taken from Winnie's tutorial.

Array of pointers to objects

Well this does seem to be an easy task, but it wasn't obvious to me how to do this. I used this for a producer-consumer-pattern. The producer did allocate objects, and should place their pointers into a fifo. The consumer is suppose to take the object pointer from the fifo.

So I had to create an array of pointers to my objects, but how is this dynamically done?

The first idea was that I needed a pointer to pointer type, holding my array:
MyObject** ppMyObjectArray = 0;

So far so good. I wanted to allocate the size of the array dynamically and thought, to assign it to the dereferenced pointer:
*ppMyObjectArray = new MyObject[m_iArraySize];

However this would be wrong, because I would create an array of objects, instead of an array of pointers to objects. I did have to sneak a little in the web... but found something that is working, which I haven't seen or read anywhere before:
ppMyObjectArray = new MyObject*[m_iArraySize];

The above does allocate an array of pointers of type MyObject. Once you know how to do it, it's obvious, but again I haven't read a book or article so far were I was able to read something like this.

Have fun...

Extending Kubuntu System Menu

Did you ever wonder how to extend the Kubuntu system menu with your own directory links? Well here is how you do it:

a) All the links are stored in a folder called:
/usr/share/apps/systemview

b) Use whatever editor you like to create new link files for your directories. The content of such a file should look as follows:
[Desktop Entry]
Encoding=UTF-8
Type=Link
URL=[Path to the folder you want]
Name=[Give your link a friendly name]
Icon=[Specify path to any icon you like]

That's all you have to do. Now you can add shortcuts to all of your favorite folders.

Have fun!