Archive

Archive for May, 2009

Porting phone book from Nokia 6230i to Samsung S7220

2009/05/30 Comments off

There must be a smarter way to do this… But I’ll describe my combersome way anyway. It depends on having windows somewhere.

Old phone: Nokia 6230i

New phone: Samsung S7220

Goal: Get all phone contacts from old phone to new phone.

Solution:

  1. Install Nokia phone software on windows
  2. Sync phone content with Outlook-Express (make sure Outlook-Express has an emtpy address book before)
  3. Export the address book from Outlook-Express as vcf or wab to a file
  4. Install Samsung phone software on windows (does not work with wine)
  5. Import address book from vcf/wab
  6. Synchronize with new phone using Windows software from Samsung

NAS-Box SS4000-E ignores partition table of plugged-in external harddrive

2009/05/26 Comments off

Intel’s NAS Box SS 4000-e ignores the partition table of external usb-drives if the latter is connected directly to the NAS-Box. Not nice, because my external USB-Drive is split into two FAT32 partitions.

This is not reflected by the “mount” command:

root# mount
...snipped some lines...
/dev/sdf1 on /nas/usbdisk1 type vfat (rw,nodiratime,gid=11578,fmask=0000,dmask=0000)

I’ll have to copy the data via intranet (slower than via USB).

Categories: Uncategorized Tags: , , , , ,

Problem upgrading VMware Tools (because of JIT-Debugger) solved

2009/05/26 Comments off

After resurrecting an old VMware installation (I started with the first freely available version of VMware.. version 1) and upgrading successfully (see this post), I was not able to update Vmware Tools within my guest OS (Windows XP SP3). I tried the automatic update option as well as the interactive update option. Both resulted in Visual Studio’s JIT (Just-In-Time) Debugger complaining and aborting the upgrade (on the guest OS).

Solution: Within the guest OS (WindowsXP in my case), uninstall VMware Tools and restart the guest OS. After restarting the guest OS the VMware UI “VMware Tools”-section will have changed from “Upgrade VMware Tools” to “Install VMware Tools”. Clicking the latter installed a fresh version of VMware tools without any problems.

This worked with VMware-server-2.0.1-156745 in combination with host OS Ubuntu 9.04 and guest OS Windows XP SP3.

Ubuntu 9.04 with VMware-server-2.0.1-156745

2009/05/26 3 comments

I have used VMware for some years. There are many alternatives. I won’t get into that 😉

I always download the tar.gz file from VMware directly.

After unpacking the file and running the install script I encountered the problem vsock (German UbuntuWiki page).

Then I ran into the often reported error message: “Unable to make a vsock module that can be loaded in the running kernel”

I can confirm that patching vmware’s configuration script works with

$ uname -a
Linux golem 2.6.28-12-generic #43-Ubuntu

and
VMware-server-2.0.1-156745.i386.tar.gz

Here is the patch (mind to line breaks):

--- /usr/bin/vmware-config.pl.orig 2008-11-28 12:06:35.641054086 +0100
+++ /usr/bin/vmware-config.pl 2008-11-28 12:30:38.593304082 +0100
@@ -4121,6 +4121,11 @@
return 'no';
}
+ if ($name eq 'vsock') {
+ print wrap("VMWare config patch VSOCK!\n");
+ system(shell_string($gHelper{'mv'}) . ' -vi ' . shell_string($build_dir . '/../Module.symvers') . ' ' . shell_string($build_dir . '/vsock-only/' ));
+ }
+
print wrap('Building the ' . $name . ' module.' . "\n\n", 0);
if (system(shell_string($gHelper{'make'}) . ' -C '
. shell_string($build_dir . '/' . $name . '-only')
@@ -4143,6 +4148,10 @@
if (try_module($name, $build_dir . '/' . $name . '.o', 0, 1)) {
print wrap('The ' . $name . ' module loads perfectly into the running kernel.'
. "\n\n", 0);
+ if ($name eq 'vmci') {
+ print wrap("VMWare config patch VMCI!\n");
+ system(shell_string($gHelper{'cp'}) . ' -vi ' . shell_string($build_dir.'/vmci-only/Module.symvers') . ' ' . shell_string($build_dir . '/../'));
+ }
remove_tmp_dir($build_dir);
return 'yes';
}

Apply the patch by

sudo patch --backup -p0 < vmware-patch.txt

See my short shell script in this post on how applying a patch file works.

Categories: IT, linux, windows Tags: , , , ,

Maven2 Heap Overflow in JUnit test cases: Howto increase memory

2009/05/22 6 comments

For the past few days I was wondering why Maven’s install gave me a Heap Overflow exception on JUnit tests on some of my machines. I tried increasing the memory by using the environment variable MAVEN_OPTS, by passing the option “-Xmx512m” to the JVM through Eclipse and from the command line. All to no avail.

Then I found this blog entry by Keith Chapman. And it worked! Here’s the solution in short:

The JUnit tests ignore the environment variable MAVEN_OPTS. You have to tell Maven’s surefire plugin to increase memory. Add this to your pom.xml file:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <forkMode>pertest</forkMode>
    <argLine>-Xms512m -Xmx512m</argLine>
    <testFailureIgnore>false</testFailureIgnore>
    <skip>false</skip>
  </configuration>
</plugin>

Creating and applying a patch file

2009/05/21 1 comment

This is a simple example shell script demonstrating how to apply a patch file.

#!/bin/sh
#
# Description: Simple demo of creating and
# applying a patch file.
#
# Author: draptik
#
## TODO: Make sure you don’t have a directory by
## this name
DEMODIR=”$HOME/tmp/diff-patch-demo-draptik”
ORIGDIR=”$DEMODIR/original-stuff”
APPLYDIR=”$DEMODIR/patch-usage”
#
## Cleanup before use
rm -rf “$DEMODIR”
mkdir “$DEMODIR”
cd “$DEMODIR”
#
## Create directories
mkdir $ORIGDIR
mkdir $APPLYDIR
#
## Switch directory
cd $ORIGDIR
#
## Create original file (the file you want to patch)
ORIGCODE=”mycode.txt”
echo “This is the old content” > $ORIGCODE
## Create file with your changes
NEWCODE=”mycode.new.txt”
echo “THIS IS THE NEW CONTENT” > $NEWCODE
#
## ============================
# 1. CREATE A PATCH
## ============================
#
## Make a diff between the files and save the
## result to $PATCHFILE
##
## You can use different diff options:
## “-u” (unified)
## OR
## “-c” (context).
##
## The “-u” option is specific to GNU.
## PDTODO: Write about different diff formats.
PATCHFILE=”patch-mycode”
echo “”
echo “***************************”
echo “*** YOU ARE NOW IN FOLDER: \”$PWD\””
echo “*** DIFF BETWEEN\n***\t\”$PWD/$ORIGCODE\”\n*** AND\n***\t\”$PWD/$NEWCODE\”:”
echo “***************************”
diff -u $ORIGCODE $NEWCODE | tee $PATCHFILE
#
## Switch directory
cd “$DEMODIR”
#
## Copy the unpatched original file ($ORIGCODE) and
## the $PATCHFILE to different directory ($APPLYDIR).
cp $ORIGDIR/$ORIGCODE $APPLYDIR
cp $ORIGDIR/$PATCHFILE $APPLYDIR
#
#
## ============================
# APPLY A PATCH
## ============================
#
## Apply the patch to a copy of the original file
##
## The “–backup” option will create a file
## “$ORIGCODE.orig” as backup.
## You can drop this option.
##
cd $APPLYDIR
echo “”
echo “***************************”
echo “*** YOU ARE NOW IN FOLDER: \”$PWD\” …”
echo “*** NOW PATCHING WITH COMMAND \”patch –backup -p0 < $PATCHFILE\"..." echo "***************************" patch --backup -p0 < $PATCHFILE ## patch -p0 < $PATCHFILE # ## Show that the file has been patched correctly: cd .. echo "" echo "****************************" echo "*** YOU ARE NOW IN FOLDER: \"$PWD\"" echo "*** DIFF BETWEEN\n***\t\"$ORIGDIR/$ORIGCODE\"\n*** AND\n***\t\"$APPLYDIR/$NEWCODE\":" echo "****************************" diff -u $ORIGDIR/$ORIGCODE $APPLYDIR/$ORIGCODE [/sourcecode]

Categories: IT, linux Tags: , , , ,