Thursday, August 21, 2008

Error code: ssl_error_rx_record_too_long

had trouble setting up ssl on ubuntu 8.04. keep getting Error code: ssl_error_rx_record_too_long in firefox

this is how I fixed it:

create ssl certificate for apache on ubuntu 8.04 :
sudo mkdir /etc/apache2/ssl
sudo /usr/sbin/make-ssl-cert /usr/share/ssl-cert/ssleay.cnf /etc/apache2/ssl/apache.pem

cd /etc/apache2/sites-available
cp default ssl

edit ssl, add
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem

enable site,
a2ensite ssl

htpasswd syntax

add new user to subversion password file

htpasswd -m /etc/svn-auth-file sally

change application context in grails

to change the application context in a grails app,
in Config.groovy add grails.app.context=/mycontextpath

Sunday, March 30, 2008

creating an iso from file on linux

I have a file that I need to convert to iso so that I can mount it cd a CDROM in QEMU. Here's how to do it:

mkisofs -o foo.iso foo.file

Thursday, March 6, 2008

change postgres user password

ALTER USER postgres WITH PASSWORD '';

Wednesday, February 27, 2008

groovy script to rename a lot of files

I got a hold of 1692 mp3 files of Chinese characters for a Chinese-English dictionary that I wrote with my 16year old cousin to introduce him to programming in Groovy. The dictionary is called xiaosu cidian 小苏词典 http://www.diningphilosophers.net/xiaosu

The mp3 files are all in uppercase but I wanted them in lower case. Here's the script I wrote to do that:


new File(".").eachFile{ f->
def cmd = "mv $f.name ${f.name.toLowerCase()}"
cmd.execute()
}


Much easier than with Java!

Tuesday, February 12, 2008

internationalization (i18n) in grails

any .properties files put in grails-app/i18n can be used to store internationalized text.

for example, grails-app/i18n/foobar.properties

the internationalized text can be accessed in the view using