I recently travelled to Tunisia for a holiday. Visiting the ancient ruined Roman city of Dougga was a highlight. It is quite hard to reach as an independent traveller. First you have to find the Tunis Northern Bus Station (out of the tourist areas), go on a 2-hour bus journey to Teboursouk (the closest town), from there you arrange a return taxi trip to the ruins. Once there though, it is quite impressive. We had the place almost to ourselves for a couple of hours - perhaps we should have arranged for a longer stay with the taxi driver, but we had to catch the last bus back to Tunis! Some of the best photos I took are here on Flickr. In future I will put more photos up under that Flickr account.
December 2008 Archives
Now that I have a couple of sites up and running on the web, I thought I'd talk about how I chose my hosting providers and how it's going. For those who just want the short version: I use Slicehost and am very happy with them. Read on for more details.
When looking at potential hosts for my Rails web apps I took into consideration price, speed/memory, reliability and flexibility. I basically wanted something cheap, reliable and fast. I've been an amateur sysadmin before (and at my first dotcom job was technically a pro sysadmin), so I wasn't scared of getting into the unix command line. Thus support wasn't important. Similarly for a small project, bandwidth, email accounts and credit-card billing systems would not be used. I wanted more than a hobbyist's hosting site (even if that is exactly what I am), but not costly, professional hosting.
My first thoughts were my domain name register, GoDaddy, or the host of this blog, pair. I know a number of people have issues with GoDaddy, but I've always found them fine for buying domain names and I can just ignore their constant upselling. However, I wasn't sure about their Rails hosting and a search only found bad stories (eg. here, here and here). I've also been happy with the service Pair have provided with this blog and associated static website. I didn't find much online about their Rails hosting and decided it would in any case be best to use different providers for this blog and my Rails apps.
Next I took a look at some webpages specifically listing Rails web hosts, such as on the Rails wiki. Among the massive listing there, special mention is made of Joyent and EngineYard on a couple of occasions. Certainly, these two companies seem to be held in very high esteem in the Rails community and host many well known Rails sites. However, they are both quite expensive - aiming for the high-end market. Too expensive for my goals or really anyone without funding. They are more aspirational - it would be nice to one day need the services of such a hosting firm.
I also found a couple of lists at rubyonrailswebhost and Zen and the Art of Programming. They rate Dreamhost and Site5 highly and both hosts matched my needs: dirt cheap (under $10/month) and with decent reliability according to reviews. Before signing up I sent Antonio Cangiano at Zen and the Art of Programming (a decent Rails blog I now subscribe to) an email asking if he had any updated advice since his blog on hosting was nearly 2 years old. Antonio suggested a new name, Slicehost. Slicehost use a virtualisation system so that it appears to the hosted application that it has a whole server to itself (albeit a fairly small server). This means that someone else's app can't hog resources slowing down your app. With memory intensive Rails apps this is very useful. They also have full command line access - you basically start with a clean build and can install/configure it how you like. While any "point and click" users would find it daunting, this really appealed to me. They provide a number of useful getting started articles, including some Rails ones, so I was sold. They are more expensive than other hosts at $20/month for a 256MB, but I have been very happy with their service over the last 6 months.
I have been asked what time I get the forecasts for a location in my historical weather forecast system. The obvious problem being that if I read all the forecasts at nearly the same time, different cities could be in different days due to differing timezones.
The answer is, I read the forecasts at roughly midday in each of the locations. That is, every hour I read the forecasts for the locations where it is roughly midday. This is done by approximating the various timezones using the location's longitude. This isn't exact - it doesn't account for daylight savings or places like China, which is all one timezone despite being wide enough to be split into many. Generally it is accurate to within a couple of hours - fine for the purpose. The code is below.
time_band = -Time.now.gmtime.hour + 12 locs = Location.find_by_sql ["select * from locations where longitude >= ? and longitude < ?", (time_band-1)*15, time_band*15]
Update: The weather_report project and the weather archive is no more. The effort required to maintain it was too great, for more information see here.
I often have ideas for little projects, most never go anywhere, but some act as distractions and bother me until I complete them. Recently, I wanted to know what the weather was in London a few days in the past. Easy, I thought, I just find it online. I couldn't. There are many sites with the current weather or forecasts. However, I could not find any with historical weather. So I quickly created one based on my knowledge of BBC Backstage.
I have put the system up here. It is still at an early state, it may change or be shutdown. At the moment it displays only last month's historical weather forecasts.