Wednesday, October 3, 2012

maven-assembly-plugin - stackoverflow

currently I'm developing several helper tools for the alchemy project and promtply run into the issue of a stackoverflow exception with maven. Basically I try to assemble several archive, including all the required jars and generate the corresponding MANIFEST.MF files for a couple of main classes. apparently with maven3, you have to set the following flag: export MAVEN_OPTS=-Xss2m to avoid having a stackoverflow exception. Annoying... solution found here

Friday, September 21, 2012

Maven - generate executable jar file

Recently I started to work a bit more with scala again and also finally upgraded to my new nemesis, maven3. More torture than maven2, but I could not live without it.

So what I wanted todo is rather simple, build an archive containing all my classes, a generated manifest and make it executeable.

10 minutes later we found the solution:



<plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <id>convert-to-asci</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <archive> <manifest> <mainClass>edu.ucdavis.fiehnlab.alchemy.core.process.util.ConvertMZXmlToAscii</mainClass> <packageName>edu.ucdavis.fiehnlab.alchemy.core.process.util</packageName> <addClasspath>true</addClasspath> </manifest> </archive> <descriptors> <descriptor>src/main/descriptor/jar.xml</descriptor> </descriptors> <finalName>ConvertMzXmlToASCII-${project.version}</finalName> <appendAssemblyId>false</appendAssemblyId> </configuration> </execution> <execution> <id>alchemy-converter-zip</id> <phase>package</phase> <goals> <goal>single</goal> </goals> <configuration> <descriptors> <descriptor>src/main/descriptor/zip.xml</descriptor> </descriptors> <attach>true</attach> <finalName>alchemy-converter-${project.version}</finalName> </configuration> </execution> </executions> </plugin> The important part is to set the appendAssembyId to false, otherwise you get all kinds of annoying exceptions....

Thursday, August 23, 2012

relocating a git repository

Recently I started creating a new project, with the amazing name 'alchemy'. Sadly it turned out that this name was already taken on google code. So to start working on it I had to create a temporary project on google code and once I managed to get my greedy fingers on the others project name (successful I might add!) ...

...I had now the challenge to move my dozen or so lines of codes over to the new repository.

Now I'm the first one to admit, I'm still kinda green with 'git' and have only used it in the past on 1 or 2 little project and never on anything real. So how complicate will it be to move the code and not loose your complete history of commit (all 7 of them...)

Surprisingly easy it turns out, just issue the following magic commands and you are all set.

  1. git remote add alchemy https://code.google.com/p/alchemy/
  2. git push alchemy master
  3. git remote rm origin
  4. git remote add origin https://code.google.com/p/alchemy/
  5. git remote rm alchemy
Now looking at this, I'm quite sure I could had simplified this even more, but for now it got the job done.



Tuesday, June 26, 2012

VMWare and keyboards and mapping

currently I'm doing a lot of international traveling for our little company and to install BinBase systems at different locations in the world and keep running in the issue that my keyboard mapping is completely off.

For example denmark:

We have a danish server with a danish keyboard connected, which starts a vmware player instance. This instance has an english keyboard setup and an english keyboard layout. Now we are remotely connecting to this using a TeamViewer instance, with a US keyboard.
What is happening all the key maps are completely random and neither english or danish. The solution

in the configuration of the virtual machine, we need to explicitly set the hardware keyboard model to a danish model and the mapping to an english mapping to make it all work correctly using a remote session.

Monday, May 7, 2012

replacing space in filename under osx/linux

just a little handy script to replace all the spaces in a filename with an underscore


for file in *.txt do newname=$(echo $file | tr ' ' _) mv "$file" $newname done




just a little handy tool

where is my space?

so since 24h I try no to discover why my harddrive is full... All I did was deleting a VMWare image and now all my space is gone, which look like there were some error during the delete option...

for example:


sh-3.2# du -shcx /*
 11G /Applications
8.4G /Developer
5.7G /Library
  0B /Network
2.8G /System
4.0K /User Guides And Information
 28G /Users
4.0K /Volumes
4.1M /bin
  0B /cores
4.5K /dev
4.0K /etc
1.0K /home
  0B /lost+found
 15M /mach_kernel
1.0K /net
 49M /opt
8.6G /private
2.3M /sbin
4.0K /tmp
1.4G /usr
4.0K /var
 65G total


means that the system should have a total size of 65GB.

Now on the other hand,

sh-3.2# df -h

Filesystem      Size   Used  Avail Capacity  Mounted on

/dev/disk0s2   238Gi  181Gi   57Gi    77%    /
devfs          182Ki  182Ki    0Bi   100%    /dev
map -hosts       0Bi    0Bi    0Bi   100%    /net
map auto_home    0Bi    0Bi    0Bi   100%    /home



it says that 181GB are used, which is a difference of ca 120GB. Now where is this space?

Disabling the local backups in OSX, verifying the disk and rebooting using Command-R. I was able to reapair the disk, which cleaned up the space.


Filesystem      Size   Used  Avail Capacity  Mounted on
/dev/disk0s2   238Gi   68Gi  170Gi    29%    /
devfs          181Ki  181Ki    0Bi   100%    /dev
map -hosts       0Bi    0Bi    0Bi   100%    /net
map auto_home    0Bi    0Bi    0Bi   100%    /home

Thursday, May 3, 2012

Basic Rocks linux stuff.

Some basic Rocks Linux Cluster stuff... just some stuff I need to remember and always forget:

list all host interfaces:


rocks list host interface

changing the mac address of a network card: 


rocks set host interface mac HOSTNAME iface=eth1 mac=00:00:00:00:00:02



please be a aware that you also have to remove the mac address definition in the following file:


/etc/sysconfig/networking/devices/ifcfg-eth*


you should be able to just uncomment the mac address line, without any ill effects and this will simplify this process next time.


and possible in the dhcpd.conf file


vim /etc/dhcpd.conf


in case you modify the eth0 interface. To ensure that the dhcpd configuration still works as supposed to.