Another scpresume alias with rsync

File copy over ssh is nice but it has no resume support. That can be a pain if dealing with big files and/or poor connectivity.

As a reminder to myself here is a shell alias I use :

alias scpresume='rsync -Pazhv -e ssh'

  • -P is the same as –partial –progress, this enable progress indication and partially downloaded files transfer to be resumed
  • -a activate archive mode to be recursive
  • -z enable compression
  • -h outputs human readable units
  • -v add more verbosity, especially reassuring with poor connectivity
  • ‘-e ssh’ is needed to use ssh as transport, you can change this to ‘-e “ssh -p XXXX”‘ if you need to change used port or any other ssh options

Maven, help-plugin and continuous integration

MavenWhen a maven build fails in continuous integration you often end up reading the console output, sometimes browsing kilobytes of text (yes, maven outputs a lot and can seem chaotic). To ease build debugging you can tell maven to output some introspectional data.

The idea is to use the maven-help-plugin a lot but you can add others and home made ones to the mix. To quickly see what can easily get outputed my maven you can play with the following commands :

mvn help:system
mvn help:active-profiles
mvn help:effective-settings
mvn help:effective-pom

Here is a sample output of the active-profiles goal :

[INFO] ------------------------------------------------------------------------
[INFO] Building my-project
[INFO] task-segment: [help:active-profiles] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] [help:active-profiles]
Active Profiles for Project 'myGroupId:myArtifactId:jar:0.1.0-SNAPSHOT':

The following profiles are active:

- continuous-integration (source: settings.xml)
- libs-daily (source: pom)

[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------

Adding such output at the very start of builds is really handy when setting up a CI service or during build refactorings.

Note that if a profile is defined in a parent pom it won’t be shown as activated in submodules by help:active-profiles but if you read the help:effective-pom output on one of the modules you’ll see it’s effectively activated, see this comment in MNG-3228.

Hope this helps.

If you read this, you certainly want to read Maven Continuous Integration Best Practices.

Unit test JPA Entities with in-memory Derby/JavaDB

HibernateAbout two years ago I blogged about using HSQLDB to unit test JPA entities. This year, Apache released a Derby version allowing you to use an in memory backend. As I use Derby in software I write, being able to run unit tests on the very same SGBD but in memory is a real gift.

For reference, here is a link to my previous post titled Unit test JPA Entities with in-memory database. What follows is just the very same method applied to Derby.

Continue reading “Unit test JPA Entities with in-memory Derby/JavaDB”

Isolated VirtualBoxes network on a Linux laptop

I like emulation/virtualization a lot. I used to use Win4Lin and VMWare for testing new systems/applications I now have switched to VirtualBox mainly because of the automation scripting tools (VBoxManage and friends).


I work/play on a linux laptop and need to run several virtual machines interconnected in an isolated network and the VirtualBox network configuration can give headaches, it gave me some : ) During the setup I had to write things down on paper, walk around chewing my pencil, scratch my head .. so I will share theses notes here hoping it will be usefull to someone.


For a 10000 feet view of the setup explained here, a simple picture is better than many words :

Virtual Network Overview
Virtual Network Overview

Host->VBoxes: permanent
Host->External: independant the virtual network
VBoxes->VBoxes: permanent
opt switchable per vbox
VBoxes-->External: virtualbox nat

Continue reading “Isolated VirtualBoxes network on a Linux laptop”