Sonntag, Dezember 06, 2009

merge after pull failed

Did a commit on both repositories. The pull worked fine but the needed merge failed with abort: outstanding uncommitted changes. Checked again the status but there was no M. After some reading I encountered that deleted but not removed files ! are ignored by the commit but not by merge.

fix: hg remove <file>

Now the merge run, but let to unresolved merges. After merging the files by hand the commit failed with abort: unresolved merge conflicts. hg resolve -a showed that Mercurial didn't recognise the merges done by hand.

fix: hg resolve -m

This marked all the unresolved merges as resolved. After this the commit worked as expected.

Samstag, November 21, 2009

get text only from selected element

The jQuery method text() returns the text not only of the selected element, but also of all sub elements.

To get only the text of the selected element clone it first, than remove all children. After this call text().

Sonntag, November 08, 2009

changing Java version on Mac crashed eclipse

Checking the javac version from command line told me I was using 1.5. To change this I changed the Current and CurrentJDK. This worked fine for Java programs run from the shell.

The next restart of eclipse failed. Remembering that there should be a new version for Cocoa by now I downloaded the new 64bit eclipse version. Crashed with the same error messages.

Changed -Dosgi.requiredJavaVersion in eclipse.ini to 1.6 -> crash

Added Info.plist in Eclipse.app the line to require a specific Java version -> crash

Searching the internet for a solution I encountered the changing the link to select a Java version will bite you. This should be done with Java Preferences (Spotlight). Unfortunately the tool didn't start. Setting the links back to A changed this. With this tool you change the ordered of the preferred Java version.

With this changes eclipse started - and noticeably faster. The Activity Monitor now shows Intel (64bit). On the shell javac is now also 1.6.

Freitag, Oktober 30, 2009

ERDesigner NG

Downloaded and installed the open source ER tool ERDesigner NG written in Java. This will run on Windows, Linux and Mac OS X.

SQLite is not supported. To start drawing a design you need to define a database connection. It is possible to use a dummy one.

Adding attributes to a table not difficult as you need to press update before you add a new attribute or the last one added will be lost.

You can't declare a private key. You need to define an index for an attribute, this will now become a private key.

After this I stooped and deleted the tool.

SQLite database acces in NetBeans

Download the SQLite NetBeans plugin.

Add this to NetBeans: Tools - Plugins - Downloaded (Add Plugins).

Download the SQLite JDBC driver.

Add this to NetBeans: Tools - Java Platforms (J2SE - Sources).

Go in NetBeans to Services. Right click at Databases - Drivers - SQLite and select Connect Using .... Add the path to the SQLite database jdbc:sqlite:/home/...

Samstag, Oktober 03, 2009

debian lenny default X settings

The default X windows installation in debian looks broken to me. The default screen size used was 1600x1200. To much for my old TFT. Trying to resize the resolution from Gnome failed (ALT-CTRL-- and resolution tool). This is because in xorg.conf are no screen resolutions defined.

Adding the following lines to the screen section fixed the problem:
  DefaultDepth 24
  Subsection "Display"
  Depth 24
  Modes "1280x1024"
  EndSubsection

Montag, September 14, 2009

links to tips and experience using ZFS worth reading

During the searches yesterday about ZFS I found some links I should read after the frustration down to a normal level.


openSolaris documentation

This is the official/ideal start point to find documentation about openSolaris. There are links for use and internal technologies. Also book recommendations

ZFS Best Practices Guide

Only thing to say is "read it!"

Blog describing a ZFS Home Server setup

There are more to read. What I found interesting is ZFS file system and expireiences after 1 year

a Drobo replacement

Used 4 drives as RAIDZ

Overview of the ZFS File System

This sounds promising. This is in a Real Media format. VLC and mplayer only played the tone. At least I was expecting some video or slides. Come one Sun, move your "stuff" to JavaFX!

ZFS tutorial

Not only this two part tutorial looks interesting on this site. Like me he wrote down some experiences using linux, OS X and Solaris.

7 Easy Tips for ZFS Starters

Sun employee writing more about ZFS and openSolaris.

Sonntag, September 13, 2009

what ZFS pool to create

Yesterday I bought two Western Digital 1.5GB Caviar green. But this are only the drives to start the pool with. To get all my data into the pool using RAIDZ, I need to add the drive to the pool after copying the data from it.
Luckily before starting this I was trying this in the VirtualBox to have all commands ready and not mess up the real data. But it is not possible to expand a RAIDZ:

Sun designed/cares about ZFS in the professional environment. There you don't set up box with only a view drives and add drive after drive. This is only a scenario for the home user. This is only possible with a mirrored
So I will start with the pool with the two 1.5GB drives mirrored. After copying the first two 1GB drives I will add this mirrored to the pool.

OpenSolaris and SiI3114 SATA controller

To build a ZFS file server I bought the DeLOCK Controller SATA, 4 Port with Raid 70154. Unfortunately openSolaris didm't see the drives.

Searching the net I found the following links:

What I've got out of this is that the controller will give you problems only if the RAID BIOS is flashed. As this is my lucky day my controller had the RAID BIOS. Got the flash tool and the BIOS from Silicon Image web page. And now the real trouble started - getting a machine to boot DOS.
It should be simple as nowadays you could use Windows to flash a BIOS. At least if you have a Windows machine with a PCI slot.
The first attempt to boot FreeDOS from a CF card failed. My BIOS only supported to boot from a USB CDROM not USB flash. But this I count as luck. In one of the post I found later that he killed one of his cards using FreeDOS.
I think I remember the last time I got MS-DOS it came on a CD-ROM. Found it. Didn't boot - the good old days. Remembering the hassle using a CD-ROM from DOS I decided to use a boot diskette. I still have old PC's for nostalgic reasons - but not with a PCI slot.
So, half I day, after I booted with the new SATA controller for the first time, it works with OpenSolaris. But as you can imagine I was not really delighted.

Samstag, August 08, 2009

iMac and MyBook FW800 trouble

I have a WD MyBook connected to my iMac via FW800. If not in use both are disconnected from power via a multiple socket outlet with a switch. If I switch this on a start the Mac the drive is not mounted automatically. Mounting it by hand doesn't work either.

My only solution so far was to unplug the Mac from the power outlet and switch it one. After a view seconds I plugged in the Mac and booted it. With this procedure the MyBook was mounted most of the time.

Searching for a better solution I found this alternative. This is not really simpler as the solution I found, but it helps, if in the case my failed.

  • unplug the power cord of the MyBook

  • unplug the FW800 cable on one side

  • keep the Mac running

  • plug in the power of the MyBook

  • plug in the FW800 cable


No the MyBook will be mounted automatically.

Samstag, Juli 04, 2009

mpd and ALSA

mpd is also dependant on x11-common. Started to install by hand but gave up and installed it with apt-get and all requested dependencies.

Steps I had to do, to get it this time working:

  • added to bashrc:
    export MPD_HOST=127.0.0.1
    export MPD_PORT=6600

  • copied some test files to /var/lib/mpd/music/

  • mpd --create-db

  • create a playlist in /var/lib/mpd/playlists

  • loaded the playlist and started it - played but no sound

  • apt-get install alsa-utils

  • used alsamixer to enable pcm

install sshd without X dependencies

The new debian installation is missing a ssh server. The obvious solution with apt-get listed a lot of X dependencies. As X is not installed and I want a more or less minimal system I installed it by hand.

download the dep package

the easiest way is to use apt-get with -d to only download the packages. apt-get -d install openssh-server

install the dep package

dpkg -i /var/cache/apt/archives/openssh-server...deb


This step required only the blacklists to be installed.

Freitag, Juli 03, 2009

update to lenny via net installation

I have an old PC which OS is totally out of date. As it has testing on it for quite some time and I also tried out a lot of programs, a new installation looks like the best thing to to.

To save me the trouble of downloading the boot CD and burning it, I will try the net installation. The installer will be started (booted into) from the HD (see debian installation manual).


  • download from initrd.gz and linux from debian nl (for squeeze) or any other debian server to /boot/new.

  • update menu.lst:
    title New Install
    root (hd0,0)
    kernel /boot/new/linux
    initrd /boot/new/initrd.gz

  • reboot

  • let the installer repartition/format the HD you booted from

  • continue like normal installation



After the first reboot the file system check failed with this error:
The file system size (according to the superblock) is 992013 blocks The physical size of the device is 736981 blocks Either the superblock or the partition table is likely to be corrupt
Running fsck by hand didn't help. Booting from a rescue CD and running resize2fs /dev/hda1 fixed the problem.

Sonntag, Juni 28, 2009

groovy tools very picky at GROOVY_HOME

Today my groovy script wouldn't start. It couldn't find org/apache/commons/cli/CommandLineParser. As I didn't use this class I tried groovy -version. This also produced:

java.lang.NoClassDefFoundError: org/apache/commons/cli/CommandLineParser
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:99)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.CommandLineParser
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:330)
at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
... 6 more

Next I checked if I had set GROOVY_HOME and JAVA_HOME. OK.

Asked the web and found a bug report with the same error message. The conclusion is that startGroovy fails to accesses some resources, if a constructed path from GROOVY_HOME, contains //.

As I had created my GROOVY_HOME with TAB completion, the path had a / at the end. Removing this one fixed the problem.

Samstag, Juni 27, 2009

mixing Java and Groovy in Eclipse

As a server back end for Greasemonkey calls I use com.sun.net.httpserver.HttpServer. The work is done inside an implementation of the com.sun.net.httpserver.HttpHandler interface. To write the HttpHandler in Java started to take more time as I was willing to spend. So I thought it is a good idea to try out Groovy.

Installing Groovy and the corresponding Eclipse plugin was no problem. Running the first test script was straight forward also. But compiling a Java and a Groovy class inside the same project didn't work.

Therefore I did a test by hand.

  • set JAVA_HOME and GROOVY_HOME

  • compile the Groovy class inside projects src directory:

    1. groovyc PlayHttpHandler.groovy

    2. javac AjaxHttpHandler.java

    3. javac AjaxHttpServer.java


  • start the server: java -cp /Volumes/Macintosh\ HD/Applications/groovy-1.6.3/embeddable/groovy-all-1.6.3.jar AjaxHttpServer


This worked. So try again in Eclipse.

First step was to clean the project. But it still doesn't work. All classes are build twice. In bin the Groovy class has an unresolved compile problem. To me it looks like the class was build with javac. In bin-groovy the Groovy class is OK. Unfortunately the Groovy class used during run time is the one from bin. Not sure how to fix this.

Donnerstag, Juni 25, 2009

Javascript speed of Firefox 3.5

Today I installed Firefox 3.5 RC. The first thing I did was to test the speed of the new Javascript engine. For this I used sunspider. On my machine Safari is still twice as fast as Firefox.

But as long as Safari has no security features like NoScript and CS Lite I will not use it.

Sonntag, Mai 03, 2009

NFS server installation

My last NFS installation must have be nearly 10 years ago - was still using OS/2 on one machine.

On the server I installed nfs-kernel-server as I read about some problems with the user mode server. From the old day's I still remember the files used to configure the server.

  • /etc/exports: /dir ip(rw)

  • /etc/hosts.allow: ALL:ip

  • /etc/hosts.deny: ALL:ALL

This didn't work. Access was denied. The access is controlled by the user and group ID. All users are created separately and not controlled by NIS or LDAP server. The quick solution is to map all access to the local user with anonuid and anongid.

Still not able to connect from the Mac. The user access is granted by the server. The Mac connects with a port number greater than 1024. Therefore insecure is needed.

Help was the nfs howto and this thread about mounting nfs on Mac.

TODO: look into the command exportfs to manipulate the NFS exported file systems.

Montag, April 20, 2009

network file system to use

Two thinks happened at the same time. I had again problems with my Samba/SMB setup and found and old article about OpenAFS.

AFS still sounds good but most of the advantages are not important on a home network. Also all the good features are now part of NFSv4. As it is still not widely used it probably is more difficult to find a already existing solution on the net. This is also true for all the other protocols found on wikipedia.

Therefore it still comes down to SMB or NFS for me. As the new file server I build will use ZFS and run on OpenSolaris NFS might be the way to go. At least I will give it a try and see if I have less problems or run into other disadvantages compared to my use of SMB.

Samstag, April 11, 2009

output caller as Morse code

In CQ DL 4-2009 was a entry about CW for Windows Mobile.This will play information about the caller as Morse code. As I don't have a Windows Mobile phone, I searched for a program like this for my phone. But I couldn't find one.

There is a new phone project for me. The above program started with WAV snippets and then a MIDI file. He was not satisfied with the result and generates now the whole WAV file to play.

Never the less I will start generating a MIDI file. This should be the easiest way to start. Finding the inforamtion about MIDI was not difficult:

I found also a page that generates Morse code via MIDI. The perl script that dose the work is available for download. This will be the starting point for my own program (perlscript repository).

The first attempted, to find information on how to run a program if the phone receives a call, was not successful.

Copying a MIDI file onto the Centro is described here.

During my search I found the following interesting page about learning Morse code with the Koch method.

Sonntag, März 15, 2009

start zfs pool with one disk

Some first test using the OpenSolaris live CD in VirtualBox. It helps testing the things directly you read about.

zpool create mypool c3d0
start pool with ony one disk

Created in /mypool a directory and some testfiles.

zpool attach mypool c3d0 c3d1
add a second disk as mirror

zpool detch mypool c3d0
now only the second drive exists in the pool
the data was mirrod to this drive

after reboot "mount" the pool with
zpool import mypool
use -f if the pool was not properly "exported" before

Sonntag, März 08, 2009

some new Java build tools

Reading an article about The future of Java build tools, I started to think what this means for me.

So far I needed only to modify build processes using Makefiles and perl scripts. Our "new" (4 years old) company project I'm involved, in uses ant for the complete build. Down the chain where my code (C++) is located, still Makefiles are used.

On Java projects at home, eclipse is doing all the work for me.

Some of the new build tools define the rules in a script language like Gradle in Groovy or Raven in Ruby. Looking deeper into one of this makes only sense for me in the case

  • we use one in a project

  • I know already the used script language

  • it becomes the successor of make and ant



This build tools are very new and only time will tell if the concept of defining the build rules in a script language will succeed. For me it makes more sense to use a declarative build rule description every one knows and add if needed scripts in a language also every one in the projects knows.

My conclusion is to look deeper into ant as we use it in the project at work. It might also get handy in my private Java projects with eclipse.

Some wikipedia links to start

  • Ant claims to be simpler to use as make

  • Ivy is a dependency manager for Ant

  • Maven claims to be simnpler to use as Ant

Montag, Februar 02, 2009

Darlington-Arrays ULN2x0y

To easily switch loads from a microcontroller the Darlington-Arrays ULN2803 from SGS-Thomson are used. But there exists different types like ULN2003 or ULN2801. What are the differences?

ULN200y has 7 (16 pin) and ULN280y (18 pin) has 8 switches. Both have a integrated suppression diode for each switch. Each switch is able to provide 500mA.

The "y" is for the different logic families:

ULN2x01
General Purpose, DTL, TTL, PMOS, CMOS

ULN2x02
14-25V PMOS

ULN2x03
5V TTL,CMOS

ULN2x04
6–15V CMOS, PMOS



There are also the ULN2064, ULN2066, ULN2068, ULN2070, ULN2074, ULN2076. This contain only four Darlington switches, but are able to switch up to 1.5A at 50V.

Dienstag, Januar 20, 2009

again password storage for different devices

I'm stll not sure what tool to use. Played a little bit with KeePassX and PasswordSafeSWT on the Mac.

KeePassX works fine but the main development moved on to version 2. The new version has some nice features but unfortunately uses .NET. It should run with Mono under OS X and Linux. But I'm not sure if I want to install the compete framework only for a password manager. Also running on other devices, like Palm and Phones is only version 1.

Bye the way KeePass doesn't run on Palm. There exists a converter for V1 and V2 data Keyring. As mentioned before Keyring was not updated since 2005. Also it stores the data with triple-DES using a 112 bit key. This is not really insecure, but better not to be used any more.

PasswordSafeSWT could only access a view groups of my key storage. PasswordSafe and MyPasswordSafe don't have this problem. Generating the storage new didn't solve the problem. And now new version (0.6 from Jan 2007).

An other PasswordSave V3 compatible program is Password Gorilla. It also runs under Linux and Mac. Unfortunately the latest version is from 2006.

Found LockCrypt with is available as Java on Mac and J2ME. I will test this.

There is a Ruby Tool to access different password containers. There are descriptions of the different formats. Will also search for a Perl tool like this.