The new Web 2.0 car
[ Posted by Urban Hafner ]
[ Posted by Urban Hafner ]
This Typo blog is hosted on Textdrive, which is a really nice hosting company. More in the style of the guys next door than your average company that just wants to make money.
One problem though is that I have a shared account on one of their severs and therefore have rather strict limits on the number of processes I can run and their memory consumption. This is of course understandable as otherwise it wouldn’t be possible for them to offer such accounts. The problem I had for a long time with this was that my blog consumed quite some memory and got killed quite regularly. To keep it running most of the times I created a cron job that I ran 4 times a day to kill my Rails fcgi instance and spawn a new one:
#!/bin/sh
APP=www
ROOT=/users/home/hafner/bettong.net/$APP
TMP=/users/home/hafner/var/run
# Kill the old process
date
kill -9 `cat $TMP/$APP-0.pid`
sleep 1
# Start a new one
RAILS_ENV=production /usr/local/bin/spawn-fcgi -f $ROOT/public/dispatch.fcgi \
-s $TMP/$APP-0.socket -P $TMP/$APP-0.pid
Unfortunately that didn’t always work. Sometimes the spawn-fcgi exited complaining that I couldn’t allocate enough memory. But it worked well enough to keep the site running often enough.
Some days ago while restoring my Typo database (don’t worry, Typo didn’t mess up anything, it was entirely my fault that I deleted all comments while only trying to delete the spam … Oh, well) I noticed that the session table was quite full. So I created another cron script that would remove all session entries older that 3 days:
#!/bin/sh
echo "Clear Typo session table"
/usr/local/bin/ruby /home/hafner/bettong.net/www/script/runner \
'ActiveRecord::Base.connection.delete("DELETE FROM sessions WHERE updated_at < now() - INTERVAL 72 HOUR")'
Interestingly though since then my blog has been running much more stable (i.e. the restart-rails.sh cron job always had to kill the Rails fcgi before spawning a new one which certainly hasn’t been the case before). So I’ve now reduced the number of times restart-rails.sh is called to twice a day. So maybe the whole contents of the session table is loaded into memory and that caused the process to be so big. I’ll see how the process behaves when running for half a day and if that works out I’ll gradually increase the running time of the process. I’ll report back to you when I have some more data.
[ Posted by Urban Hafner ]
The last weeks I’ve heard some podcasts with Dave Thomas and in passing he mentioned that Joe Armstrong is writing a book on Erlang for them.
I’ve been interested in Erlang for quite a while but didn’t find time to look into it. But now that Dave Thomas (nearly) announced the beta release of their book I’m really exited. Once I find the money for the book I’ll definitely give it a try.
Oh, in case you’re wondering where to find the book just go to Dave’s blog post where he mentions how to find the book. It’s not that hard!
Update (one hour later): Well, I couldn’t wait and ordered it anyway. I just had to capitalize on the strong Euro ;)
Update (14 hours later): As Dave announced it already on the ruby-talk mailing list, here’s the link to the book page: http://www.pragmaticprogrammer.com/titles/jaerlang/
[ Posted by Urban Hafner ]
It might be surprising to write about the novelties in 10.4, but I’m currently writing an application that might need some of this stuff. And when you don’t know the right terms for things it’s hard to find what you are looking for. That’s why a high level, but technical, article like this is really helpful.
[ Posted by Urban Hafner ]
I just found this cool video mentioned on Lyle Johnson’s blog.
I couldn’t help myself and went to the iTunes Store and purchased Giant Steps … Together with 85 other songs. After all what are 9.99€ for 86 songs.
[ Posted by Urban Hafner ]
Today was the January 2007 KGS bot tournament and version 0.5 of HouseBot managed to get on the 7th of 10 places. What’s even more noteworthy is that it managed to beat version 0.4 which is a first. That’s probably due to the improved search (a Transposition Table was introduced) and due to some minor enhancements in Life & Death analysis (the first step beyond Benson).
The next goal will be to beat 0.4 consistently and retire it completely. I hope this will be possible until next months tournament.
[ Posted by Urban Hafner ]
I’ve just finished setting up Planet to aggregate all RSS/RDF/Atom feeds that I can get my hands on that are on the topic of Computer Go. You can find it at http://computer-go.bettong.net.
Unfortunately I haven’t found any blog on Computer Go! So if you have one please tell me and I’ll add it.
[ Posted by Urban Hafner ]
So I was starting some web development these days and the code I was working on had the name of the website hardcoded. So I thought that the easiest way would be to add a new entry to the machines directory in Netinfo Manager. Unfortunately that didn’t work. It still resolved the IP address to the real one and not to 127.0.0.1. After a while I found out that lookupd (the program responsible for the actual DNS look up) searched the DNS server before the Netinfo Manager entries!
After searching for a long long time I found the article MacOSX lookupd and NetInfo by A.P. Lawrence. Changing the order of the search path of lookupd boiled down to the following lines:
sudo mkdir /etc/lookupd
echo LookupOrder Cache NI DNS FF DS > hosts
sudo mv hosts /etc/lookupd
sudo kill -1 `cat /var/run/lookupd.pid`
This was done on Mac OS X 10.4.8 but according to the article from above it works on 10.2.6, too.
[ Posted by Urban Hafner ]
Via Bill Clementson
$ history|awk '{print $2}'|awk 'BEGIN {FS="|"} {print $1}'|sort|uniq -c|sort -rn|head -10
134 ls
88 cd
36 vim
27 fink
24 rm
24 make
17 update.rb
16 diary
15 sudo
13 gnucash
$ [ Posted by Urban Hafner ]
I went to the first CocoaDevHouse in Munich today. It took place at the office of Boinx Software.
We were planning on doing some hacking but at least I didn’t do much. That’s of course mostly because I’m not good at Cocoa programming, yet. But I had some nice chats with people who make there living with Cocoa programming.
The Boinx office was really nice and they did a really good job at providing the right environment for happy geeks (Pizza, M&Ms, ...). I also felt really important as this was the first time I got a badge ;)
So, thanks to Boinx and TheCodingMonkeys for organizing this meeting and I hope for another meeting. Until then I assume I’ll have learnt some more Cocoa and will be able to do some real hacking.