Many guides are already written, but none of them covers my standard situation (which I think is very common):
- you are having a server git repo already, maybe on github
- you have a local clone of that repo already (git clone …)
- you need to setup you staging, production, whatever server right now
- I assume you are using ssh & authorized_keys as this is the best method for working with git.
Start on the server – login using the user where you have placed your ssh key and create your directory:
mkdir /srv/www/myfancyproject
cd /srv/www/myfancyproject
git init
Then edit the post-receive:
cat >> .git/hooks/post-receive <<-EOF
#!/bin/sh
git --git-dir ./ --work-tree ../ checkout -f
EOF
and set the execute bit & some git config:
chmod +x .git/hooks/post-receive
git config receive.denycurrentbranch ignore
git config core.bare false
Now you can switch to your local git clone and enter these commands:
git remote add staging ssh://myuser@myserver:22/srv/www/myfancyproject
git push staging master
Thats it!
Amazon RDS is a fantastic service for managed databases – a reliable solution which is hazzle-free and cluster-able.
In the background of Amazon RDS is a MySQL 5.1 Instance on an arbitrary Linux system. MySQL has one beloved “feature”; it is case sensitive – but to make it consistent and helpful – only on *nix systems. In our company I’ve set the standard just to use uppercases in SQL statements but even this won’t help you in case of GSQL or HQL queries, theses statements are build by the engines itself and so there is no possibility to force an uppercase field or table accessor.
As the most popular databases are not using case sensitive field or table names and even MySQL does make an exception on Windows this “feature” is complete garbage in my opinion.
Thankfully RDS does support lower_case_table_names since some weeks, I’ve changed that setting on RDS and could deploy Atlassian Jira successfully on AWS.
read more…
Ruby, Hashrockets and UTF-8

Image is property of PeepCode.
The years with the hashrocket syntax (=>) are over, Ruby has switched to the defacto standard which is used by JavaScript, Groovy and other script languages.
In Ruby 1.8 you needed to define a map like this:
my_map = {:ilike => 'apples', :and => 'pears'}
which you can write in Ruby 1.9:
my_map = {ilike: 'apples', and: 'pears'}
Even if the colon is on the other side, the keys are still symbols and are saving memory.
UTF-8
To use UTF-8 in your *.rb files with Matz’s Ruby you need to specify a magic comment:
# coding: utf-8
For more informations on how to switch code from 1.8 to 1.9 have a look here.
Restart…
..again.
I think this is maybe the fifth try to provide informations using a blog, but time will tell if it’s now something different
The first challenge was to create accounts, modify php stuff and images with a baby on one arm, but – hurray success – baby sleeps, blog is ready.
As I am currently investigating the changes in Rails 3.0, the first entries may contain informations about Ruby on Rails – maybe old stuff for the experienced. Don’t get boring, just stay tuned
