29 January 2013

HOWTO: Grails / GORM + Oracle Schema

By simply adding schema to your domain classes, you won't be able to get it working in h2 afterwards. Here is how you fix that.

1. Update all your domain classes

grails-app/domain/Person.groovy
class Person {
        String name
static mapping = {
table name: 'PERSON', schema:"MYSCHEMA"
}
}

2. Update all your datasource

grails-app/conf/DataSource.groovy:
environments {
    development {
        dataSource {
            dbCreate = "create-drop"
            url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;INIT=CREATE SCHEMA IF NOT EXISTS MYSCHEMA"
        }


repeat that for the test environment also.

Putting this in writing because I wish I had this blog post a while ago.

18 January 2013

Cheat sheet: ssh + screen + irssi

Cheat Sheet: SSH + IRSSI + SCREEN 

1. ssh user@myserver
2. screen -r  resumes your screen. screen starts a new one, then type irssi
3. /server irc.freenode.org to connect to the server. /join #channelName to join a channel
4. /wc leaves a channel.
5. <ctrl+a d> detaches screen, type exit to leave your ssh session