Tuesday, January 8, 2008

Remote clipboard - revisited

I've blogged about a remote clipboard before (and search for Remote Clipboard). Back then, I used two computers, basically because some applications were only available on one computer. For this I used the "Remote Clip" tool, unfortunately, it hasn't been updated since 2002. I know that it works fine between Windows computers. It works between a Linux and Windows computer, but with reduced functionality (no file copy, text encoding issues). I was interested to see whether it still works under Mac OS X.

And the results are pretty much negative. Connecting between computers works, but getting anything over is not possible. It might be related to the fact that I'm using VMWare to test the setup... Still, I think it is a pity that this small tool doesn't work quite as well on different platforms. Especially because Java is used, so one should expect some cross platform functionality.

So, Remote Clip is not an option anymore. I would really like a solution that enables me to synchronize text between computers. I was thinking of a simple web page with a text box, that is continuously synchronized with a back-end system, so that if I open the same page on another host, I would see all changes. This shouldn't be that hard, but I don't feel like implementing it myself ;-)

Getting a static version of a wiki

I love to use a wiki. I use it whenever I need to communicate and log information in a project with at least one other team member. Even it is only used by myself, I think the flexibility of a wiki is great and the information is always available in a familiar format (the web).

But from time to time, a project needs some stable documentation (typically at release time, or at any point in time that is a milestone). And since I'm not planning on duplicating information in other formats (like Word documents or Excel sheets), I need the possibility of extracting the information from the wiki in a static format. Another reason for being able to convert a wiki to a static format is when you want to make it available to people that don't have access to the infrastructure or you don't want them to install the necessary infrastructure to only consult the information on the wiki.

Some wikis have the functionality to export the contents to another format, like PDF files or static HTML pages. But most of the time, that functionality is not that easy to use or is not available. For example, I use JSPWiki a lot. It is a great very lightweight wiki, certainly because it stores its content in plain text files (no need to setup a database and you can always just read the text files if for some reason the software is not available). But, I haven't found a good plugin to extract the wiki as a static website. That is exactly what I want.

For the moment, I use a combination of the following unix tools to spider and convert a JSPWiki instance to a static version.

rm -rf static-wiki
mkdir static-wiki
cd static-wiki
wget -A *Wiki.jsp*,*.jpg,*.gif,*.css,*.html -R *Diff.jsp*,*PageInfo.jsp* \
-r -l2 -k --http-user=user --http-password=***** http://server/wiki/
cd server/wiki
rename 's/jsp\?/jsp_/' *
find ./* -type f -exec sed -i 's/jsp?/jsp_/g' {} \;

Some remarks:
  • Use wget with accept (-A) and reject (-R) attributes to filter the correct information. By default wget would get all possible links, also edit forms, history pages and all diferences.
  • The level of spidering (-l2) might need to be adjusted. It depends on how your wiki is structured. I would expect that setting the level higher has no big impact if you use the accept/reject attributes. Possibly, avoid spidering external references (like links outside the wiki domain).
  • JSPWiki uses only a few JSP pages to show the content of the wiki. The resource to be shown is added as a parameter in the URL. When wget saves those pages, they will look like this: "show.jsp?page=SomePage". Unfortunately, a browser will not correctly follow links that have this format. Therefore you need to rename all files and convert all links in the HTML pages (replace "?" by "_" for instance).
There should be a better way, but this works just fine...

Sunday, January 6, 2008

JRuby 1.1 (trunk) and Rails

At Javapolis 2007 I went to Practical JRuby on Rails to see how compatible JRuby has become compared to the normal Ruby and the Rails framework. The session was good, not great, but I still wanted to look a bit more into JRuby, as I still have trouble letting go the Java background. It just makes sense to reuse all the infrastructure and frameworks that are around for Java and complete this with an agile web development framework such as Rails.

I bought the book "Practical JRuby on Rails Web 2.0 Projects: Bringing Ruby on Rails to Java" and started by getting the latest sources for JRuby (which is currently going for 1.1). From there I got all the latest versions of the little gems you need to get Rails running. But that was perhaps a little mistake. JRuby 1.1 is at the moment not stable enough... There is a lot of activity on trunk and bugs are constantly filled and fixed, but things quite often break. And it is not only JRuby's fault. Gems, Rake, ActiveRecord-JDBC, Mongrel (and all other dependencies) break from day to day. So figuring out what went wrong spoils a little bit of the fun.

The fact that I have Rails 2.0 installed doesn't help either... There are quite some changes, and most books don't cover the latest version. On the other hand, this forces someone to understand the samples and look for a solution... Perhaps that is the reason why I'm still trying out the latest version ;-).

The book itself is less good than I anticipated. Sometimes I miss some details or explanations and so I certainly don't recommend the book if you have never read a book on Ruby or Rails. I do recommend the "The Pragmatic Programmers" series.

Saturday, January 5, 2008

Second attempt

I don't remember how long ago I stopped blogging. But, I've decided to start again. And it is not a New Year's resolution. Several reasons and some warnings:
  • At first I thought that a blog should only contain original content. I didn't want to create another link blog. But I couldn't write much original content, so I stopped. Now, I think it doesn't matter anymore; a web log can "log" anything that can be useful to "me". If others can use that information as well, good for them.
  • I'm not a writer, and I'm not a native English speaker, so there will be spelling and grammar mistakes in this blog. I will try to do my best to avoid errors, but frankly I can't be bothered anymore.
  • I've just decided to stop watching the diggnation podcast after 2 years. I win back another hour per week not watching it; available to be spent on better things. It has been good, but in the end, it is pretty much the same each week (certainly when you're following digg.com as well).
  • I have a collection of repositories to keep references to all sorts of information and I'm tired of spending time to find the information back. Plus, it requires me to give the information a bit more context, just a link doesn't cut it.
  • This blog is hosted at blogger, so I'm not sure whether it will work out for me. Let's see...
  • This blog has nothing to do with my professional job and so all content is my personal opinion.
So here goes the second attempt. Please be gentle, if you accidentally reach this blog. I will not make it public deliberately.