Monthly Archive for March, 2008

Painless backups - solved for now

If you’re anything like me, you’ve dabbled in various solutions for your personal (and professional) backup of data. Being the geek that I am, these are some of the different solutions I have used in the past:

  • External harddrive (on my fifth (!) drive now, they keep crashing)
  • CD/DVD-backups (takes time and they’re fragile)
  • Extra internal drive (What was I thinking? Hacker’s paradise)
  • External server with plenty of storage space (Setup my own with 750 GB RAID’ed; linux, rsync, ssh, cron and all that jazz. But it also gets hacked…)
  • Flickr.com Pro (Good for my photos, but what about the rest?)
  • Cheap web hosting (Yeah, this works, although a bit unreliable, and messy to FTP every now and then)

So, I was thinking it was time for something new, something that doesn’t bother me and something that just works, automagically. What I’m using right now, and have been using for some months, is Mozy. It’s a service owned by EMC and it’s a no-frills automatic backup tool.

It has clients for Windows and Mac (found none for Linux yet) and just works. I has all the stuff I want such as encryption, incremental, block-level syncing, support for several computers on one account etc.

There’s a free version which I suggest you start with, to see if the program and service suits you (you get 2 GB for life) and the full version is about $5 / month for unlimited storage. I think it beats my other solutions and about the only other thing I would like now, is to have the client backup to both Mozy and Amazon S3 (for the paranoid person lurking inside me), but I’ll wait a bit for the S3-part. (There’s plenty of tools for doing just that though)

I’m not one to spam, but if you would like to try Mozy and get 256 MB extra, feel free to use this link. By using that link, I also get some extra love from Mozy.  On the other hand, if you don’t like me, just go to https://mozy.com/ and spare me the love! ;)

Manually adding MD5 checksum to files using Ant

I just added some JAR’s from the DctmUtils project to my local Maven repository to be able to use it like anyother dependency. In doing so I had to create a POM and the structure for the JAR. This in itself works like a charm, but if you do not supply valid checksum-files (SHA1 or MD5) for the POM and JAR Maven 2 will give you warnings.

Solution:
Save the following in a build.xml file in your folder and run ant md5 to generate MD5-files for all files in the folder. Easy peasy.

<project>
  <target name="md5">
    <checksum forceOverwrite="yes" fileext=".md5">
      <fileset dir="." excludes="**/*.md5"/>
    </checksum>
  </target>
</project>

Getting a handle on custom WebTop components using Spring

When customizing an EMC Documentum WebTop application and using the Spring Framework to tie everything together, you find yourself wishing you could use Dependency Injection at all places in the existing WebTop source.

I don’t yet know of a workable way to achive that sort of plumbing with a WebTop application (especially for all types of existing components and tags) to just expose any new dependencies and let Spring handle it all.

Another way to achive interoperability with Spring and still use most of what’s good there is to allow our legacy components to have access to a Spring ApplicationContext, but setting one using Spring is not feasible because of the same reasons as above. Thus we introduce the StaticSpringApplicationContext.

The StaticSpringApplicationContext works simply by containing a static reference to the Spring ApplicationContext and exposing a static helper method to get beans configured by Spring.

Configure the helper class by defining it in your web.xml like so:

<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

And at least the following in your WEB-INF/applicationContext.xml file:

<bean id="StaticSpringApplicationContext"
class="com.palbrattberg.spring.StaticSpringApplicationContext" />

This will make sure Spring itself configures the StaticSpringApplicationContext on startup.

Now you can simply get your configured beans (preferably in your constructor) like this:

MyBean myBean = (MyBean) StaticSpringApplicationContext.getBean("myBean");

Now you are free to use Spring for configuring all your future code.

Source code for StaticSpringApplicationContext