Posts

Why are you coding?

There is a good article here about the need to explain why you are coding. I've often found that with most projects or tasks people are reluctant to give you the high level picture - it wastes too much time and, "you don't need to know". It reminded me of several situations where someone comes to me and says - "I want you to write a program that does this...". I say "sure", expecting that they have done the due diligence and arrived at the conclusion that this is the correct thing to do. (I've even had my knuckles wrapped several times for second-guessing these requests). So, you proceed with development and somewhere along the line (at the watercooler, elevator or kitchen) you mention what you are doing, and they hit you with "There's no need to do that because system XYZ is being replaced with ABC" or some other equally jaw-dropping statement. I like to know the bigger picture of where a piece of work fits in, because then I ca...

grails-p6spy-0.2

This information is out of date - please see http://grails.org/plugin/p6spy for the current documentation. Grails 0.6 was recently released, and this new version included changes to the way the DataSource is defined. So, to make my grails-p6spy-plugin compatible with 0.6, here is a new release: grails-p6spy-0.2.zip P6Spy lets you monitor the JDBC queries by proxying your database driver. In addition to logging the prepared statements, it also logs the sql with parameters in place so you can copy and paste the exact sql into your favourite database client to test the results. This Grails plugin makes it easy to utilize P6Spy in your Grails applications. Introduction This plugin contains 2 files - the p6spy jar and spy.properties. After installing the plugin in your Grails application, you can find them in: <project directory>/plugins/p6spy-0.2/grails-app/conf/spy.properties <project directory>/plugins/p6spy-0.2/lib/p6spy-1.3.jar The install script updates your DataSourc...

Changing code in Grails services

I've been using Grails for the last couple of months, and I'm loving it. While looking up some reference information, I stumbled across this gem . Its always been frustrating when updating services that the server needed to be restarted. Well, this problem has been caused because I've been specifying the type of my services instead of using the def keyword. Now that I'm not specifying the type, no more server restarts!

Jetty - lost in the web

Grails uses an embedded Jetty instance to serve the application during development. I'm trying to figure out how to configure it with Apache in front using mod_proxy - this means I need to do some Jetty configuration so that when running Jetty it knows it has a proxy in front of it. It seems though that jetty.mortbay.org is not available on the web (for the last 24 hours I've been getting 'Can't find the server'). Google, however is turning up a lot of documentation that points there. So, its taken a long time to find information not on jetty.mortbay.org. http://docs.codehaus.org/display/JETTY/Jetty+Wiki seems to be the best reference - it has working links to the binary distributions and source repositories.

Apache 2 mod_proxy - 403 error

I've been trying to put Apache2 in front of my Grails Jetty instance so that I can have common resources served by httpd and not included in my Grails web application. I enabled the proxy module , but always got 403 forbidden errors. Searching around the web turned up this post , which lead me to check which modules were loaded. Where I had simply done: a2enmod proxy I really need to also do: a2enmod proxy_http a2enmod proxy_connect Of course, after enabling these modules, remember to force a reload: /etc/init.d/apache2 force-reload

Nautilus - stop opening new windows

Image
Nautilus on Fedora has an annoying habit of opening new windows every time you double click on a directory. This is enough to drive any one mad, but there is a solution. Under the edit menu select preferences. On the behaviour tab click the 'Always open in browser windows'. Not particularly intuitive. Thanks to Lars E. Pettersson for this tip! Now, Nautilus behaves sensibly and we have access to the directory tree.

Dovecot - Error: No protocols given in configuration file

I have been trying to get Dovecot running on my laptop for development purposes, but something went wrong somewhere. The service never started and running the /etc/init.d/dovecot start script never complained or produced any output. Just trying to find out what the problem is can be difficult sometimes, never mind finding the solution to the problem. Luckily excellent documentation from the makers came to the rescue. A wiki entry on logging showed how to find where the logs are: root@laptop:~# grep "starting up" /var/log/* /var/log/acpid:[Sun Aug 19 14:05:05 2007] starting up But no mention of Dovecot in those logs. The clue came from directly running dovecot: root@laptop:~# dovecot Error: No protocols given in configuration file And sure enough, looking at /etc/dovecot/dovecot.conf showed: ... # Protocols we want to be serving: imap imaps pop3 pop3s # If you only want to use dovecot-auth, you can set this to "none". #protocols = imap imaps protocols = ... Setting...