Deepak Mittal

AWS

How to delete all contents/objects of Amazon S3 bucket

If you have an S3 bucket with a huge number of files, and you want to delete the bucket, you need to empty the bucket first. If the bucket has a handful of files, then it is easy enough from the AWS interface, but if the bucket has a large number of files, then AWS interface is not an option; and you must use s3cmd or may be some other...

12-Nov-2011

Grails, Technology

Why use Grails?

Last week, I was talking to a prospective client, who instead of asking me, why we should go with TO THE NEW, asked me, why should we go with Grails? Considering the fact that I have been working with Grails for over 3 years and we are a Groovy/Grails focussed shop, it should have been an easy question to answer; but there were so many...

16-Jan-2011

Grails

Get absolute URL of site Grails application is available at?

Many times, we need to get the absolute URL of the site/application. One such case is when we are sending out links to the application in emails. The default Config.groovy file provided by Grails has a property with the name grails.serverURL. I have typically used it to get absolute URL (environment specific)  of the site Grails...

14-Oct-2010

Grails

How to generate DDL script for domain classes in Grails using schema-export target

On most of my grails projects, I am used to let grails handle database schema creation for me. However, there is a project where the database is shared between multiple applications. In that project, we have to check-in our table creation/modification script as a SQL file, which is later executed by a DBA. I use a not-so-commonly known...

15-Jul-2010

Technology

How to allow non-root user to start/stop Apache process on a *nix server

Recently, I had to write a script to deploy a Grails application on a cluster of 7 servers without prompting for any kind of passwords. The load balancer was configured so as NOT to direct any request to the node, if the Apache process is not running on the server. So, my script to do the deployment on all the servers one by one is...

13-May-2010