11 Feb 2009

RSync for windows, mac and linux: Unison ?

Lately I re-installed all my home computers, that means backuping everything to DVD(s).
It's always a really painfull operation, there are differents files and differents folders structure across computers /os (windows, ubuntu...). Some files are the same, some where deleted but not everywhere etc...
So usually I spend almost a week-end cleanup the mess accumulated over 2 or 3 years.

I tried to use subversion to backup files so that I could use associate tools to ease the job. It was a failure for many reasons:
- Using svn add/move everytime you do something with a word, pdf etc... is painfull
- That means synchronising with some kind of server and I don't want to have a running computer all day long at home
- I don't need versions on those documents
- You need a big storage place (+ extra svn info) for the repository

For the sotrage problem I bought a 1To USB external drive! Should be fix now :)

For the rest, I think rsync is better for what I need!
Unfortunatly there is no such thing for windows unless you use cygwin... I'm not really found of cygwin (it's better than nothing but...)

I just found Unison, an implementation of rsync but available on multiple plateforms. Windows, Mac, Linux clients.
I did some tests under windows and it seems to work :)
I only used the client line since the graphical client need Gtk+ (I don't want to install it just for that) and it will be ugly (as usual with gtk).

I need to test the linux client and I should be ready to go...

6 Feb 2009

Jetty - change default java.io.tmpdir value and override web.xml parameters

Jetty is really nice, amongst the amazing things you can do some of my favorites are:
  • Change java.io.tmpdir default value
  • override params define in the web.xml embedded in a war file


java.io.tmpdir


<?xml version="1.0"  encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/test</Set>
...
<!-- change java.io.tmpdir default value -->
<Call class="java.lang.System" name="setProperty">
<Arg>java.io.tmpdir</Arg>
<Arg>/some/where</Arg>
</Call>
</Configure>

Change default values in web.xml


<?xml version="1.0"  encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
<Configure class="org.mortbay.jetty.webapp.WebAppContext">
<Set name="contextPath">/test</Set>
...
<Set name="overrideDescriptor">
<SystemProperty name="jetty.home"
default="."/>/contexts/test.d/override-web.xml</Set>
</Configure>

Create an 'override-web.xml'
<?xml version="1.0"  encoding="UTF-8"?>
<web-app ...>
<!-- Add or override context init parameter -->
<context-param>
<param-name>my.param/param-name>
<param-value>on</param-value>
</context-param>
</web-app>