Thursday, February 16, 2012

IBM download manager

This post is just to make a stand against corporations like IBM that think we're so stupid and ugly we can't download and run a simple exe from the net.

Well, guess what: we can! Stop the damn reinforcement to give you all the personal information you don't need! It's against everything - not just the European data privacy laws.

And above all: come on guys! Do you really feel it is necessary these days to force the user to use a Java-based download agent? Ain't it simpler to finally enable HTTP resume on your server? Or can't you do that?


What a damn shame that the big ones can't keep up...

Wednesday, February 15, 2012

Grails, documentation and images

A quick tip of the day:

if you're creating a Grails project and want to provide documentation for it it might stand a chance you'll need to include images in that documentation. Unfortunately the official documentation is very sparse in this regard showing you only the syntax for including external images. As it turns out it is possible to have images that come specifically with the docs. All you need is to specify
grails.doc.images = new File("src/docs/images")
and then include them in the docs as usual but without a URL
!my-image.png!
Thanks to Lauro Becker for that hint!

Wednesday, February 8, 2012

Grails, Bootstrap and a pile of crap

Today we're going to pick on a good idea gone bad. The good idea being the ability to kickstart a Grails application with Bootstrap from Twitter. What's gone wrong is the actual implementation. But let's start from the beginning.

Create a new application

grails create-app example
You've seen this over and over again, right? Nothing new here. Let's install the kickstart-with-bootstrap plugin. For that in Grails 2 we'll modify the grails-app/conf/BuildConfig.groovy's plugins file like this:
plugins {
    runtime ":hibernate:$grailsVersion"
    runtime ":jquery:1.7.1"
    runtime ":resources:1.1.5"

    build ":tomcat:$grailsVersion"

    compile ":kickstart-with-bootstrap:0.5"
}
Easy enough. Let's compile the application first (grails compile) for the build system to fetch all the plugins and do its other bits. After that we'll execute grails kickstart-with-bootstrap (the one that just came about with the kickstart-with-bootstrap plugin), answer all questions positive and we're done. At this point you can create a domain class and a controller but that's not really the point of this blog. The point here is to pick on the way the master kickstart layout looks like.

The good part

Well... the appearance is really great! But let's face it: it's so because Bootstrap looks great. It has all the usual stuff, the top bar, nicely looking fonts, the layout is floating. That's all nice and dandy...

The ughly

Let's open the newly created grails-app/views/layouts/kickstart.gsp. Here are a few points I'd like to make:
<%--  <div class="container">--%>
What for the love of god was going through the author's mind to leave commented out code in official release? And believe me this is not a single place. There are actually 21 of those!

But that's as long as purity goes - let's try to find something scarier:
   <g:if test="${ params.controller != null
      && params.controller != ''
      && params.controller != 'home'
      && params.controller != 'login'
   }">
I mean what the heck is this?! We're in a reusable layout! Ok, you might think I'm bitching about one place in the layout... Well actually no. There is more:
class="${ params.action == "list" ? 'active' : '' }"
class="${ params.action == "create" ? 'active' : '' }"
So a list should be shown, right? Or maybe we're actually creating an entity... Hm,... What was going through the author's mind at this point???

Does it by any chance belong in a reusable layout?!

Summary

I personally think that such a plugin is a blessing for someone that starts a new project now and then. The original Bootstrap plugin just doesn't cut it. But for the love of God do it right! By providing such a half-done tool to others you're actually doing more harm than good.

I'd love to get in touch with the original author to straighten things out. I love the idea of having a plugin that supplies a set of scaffolding templates and a layout to get me started with a nice look and feel quickly. Never mind the fact that it doesn't use the resources plugin. I actually like it. But it needs to be done the proper way, the way it is reusable!

Thursday, February 2, 2012

Hosting Git like a professional - Gitorious!

I've been struggling over the past months to find a way to install Gitorious on my private network to have the same kind of power in hosting repositories as GitHub or BitBucket. For sure Gitorious is not as powerful as those guys but it is more than enough for in-house development.

And tada! Here it is: the automated process of installing Gitorious on a fresh Ubuntu or Debian machine.

Here are the main components being installed:

1. Ruby 1.8.7 - enterprise edition
2. MySQL 5.1
3. Stomp server
4. Apache HTTP server with Passenger module
5. Lots of supporting utilities
6. Last but not least: The Gitorious application.

The procedure to install using this script is as follows:

1. Make sure you do have sudo installed (on Debian you need to install it manually!!!)
2. wget the script from GitHub in raw form.
3. Edit configuration options found at the very top of the file
4. Launch bash (_NOT_ just sh!!!) with this script (bash install.sh)
5. Press enter when asked

One note: if the script seems to be hanging mid air (especially at the end of the installation where ruby interpreter is being invoked to add admin user and so on) press Enter. After pressing Enter the script will continue almost immediately.

Now this is a very basic installation of Gitorious. For example there's not Git over HTTP support available. But all the rest should be working just fine :)

Give it a shot! Give it a shot even if you don't need it :) Gitorious is an amazing piece of software and can help you out in Git administration like no other software will.