/ #blog 

Daily-Log, 2010-11-05

Almost no programming today, but meeting with people, discussing the future. Also looking into the cost of doing business and re-calculating our hourly rates (We need to stop subsidizing too many projects….) In the end, we have decided to hire two new developers. If you are looking for a job in a great little company and are either a Software developer or a Web developer (or the combination of the two) then head over to our Job Page and take a look at our offering. Be sure to forward to other people that you might know. ...

Jens-Christian Fischer
/ #blog 

Daily Log, 2010-11-04

The monit saga from yesterday continued - and was solved. Somewhere deep in the monit documentation, it is stated that monit calls the start and stop programs with a very very minimal environment, and certainly not the full environment that for example the deploy user has. So the following code will not work: check process some_process with pidfile /path/to/process.pid start "/path/to/executable start" as deploy stop "/path/to/executable stop" as deploy You can do the following to create an environment for the program: check process some_process with pidfile /path/to/process.pid start "/usr/bin/env PATH=/usr/local/bin HOME=/home/deploy RAILS_ENV=production /path/to/executable start" as deploy stop "/usr/bin/env PATH=/usr/local/bin HOME=/home/deploy RAILS_ENV=production /path/to/executable stop" as deploy ...

Jens-Christian Fischer
/ #blog 

Daily Log, 2010-11-03

Yesterday, one of our Amazon EC2 servers “spontaneously” rebooted, leaving the production environment of our new secret project in shambles. The problem was that we hadn’t yet written monit scripts that watched over if the different database and application servers were restarted as they should have been in such a case. So I spent today writing monit scripts for our unicorn servers and testing them. One thing leads to another, so I also did the same thing for our Postgres server. This in turn led to the realisation that Postgres 9.0.0 (which is current now) doesn’t read database files written by 9.0beta4 (which was installed due to the non-availability at that time of 9.0.0). So back to 9.0beta4, dumping all databases, re-installing 9.0.0, re-creating the databases (as per these instructions). Fun and joy! ...

Jens-Christian Fischer
/ #blog 

Daily Log, 2010-11-02

Spent quite a bit of time with Keith getting a Cross Site JSON call to work in jQuery and Sinatra. The problem (or security feature) is that a browser will not make an XMLHttpRequest to another domain than the one it’s currently displaying data from. We are building a widget that is going to be embedded on other servers, and we wan’t to make such a call… Luckily, there’s JSONP which “pads” the response by the server in a JavaScript function call and thus bypasses the problem. jQuery supports JSONP natively in it’s $.ajax request and we tried hard to get it to work with a POST request (as the docs suggested would work). It doesn’t however, and we had to change to a GET request (using the handy $.getJSON method. So we sacrificed the purity of our REST API (we are really creating a ressource) by allowing that ressource to be created and retrieved by a GET request. Still that beats using iframes for our widget - at least in our book. ...

Jens-Christian Fischer
/ #blog 

Daily Log, 2010-11-01

Little work done due to hospital visit and lot’s of talking. Working on secret project (to be released soon) and getting fed up with this message when running the cucumber features (Ruby 1.9.2, Rails 3.0, Cucumber Beta 0.22): “warning: regexp match /…/n against to UTF-8 string”. It turns out, that others have had that too: Crimpy Code and Openhood have the solution. We are looking into providing support for login via Facebook. OmniAuth seems to fit the ticket nicely (and it also handles a bunch of other authentication systems based on OAuth, OpenID, LDAP and many others). We’ll see how this works out. ...

Jens-Christian Fischer