Jonathan sent me this interesting link to a small app that calculates how much a blog is worth, derived from Technorati APIs and the AOL-Weblogs deal and based on Tristan Louis’s research. My http://saush.com/blog address, which I was using for about 3 months is $6,774.48 while my http://blog.saush.com address which I was using for slightly more than a month is $1,693.62.
Satish from PuneRuby interviewed me by email — I was quite pleasantly surprised and flattered by his interview request. After all, I’ve only been doing Ruby for about a year or so now and it felt good to be considered a ‘Ruby guru’. (*chest puff*)
So there I was, shooting off a response to his interview request at 2am in the morning in a hotel in Ho Chi Minh City, trying to put together a proposal for a project migration in Mexico City, while discussing a cutover for the same project with people from Aix-en-Provence and Singapore. Next thing I know, RedHanded picked up the interview because of a bad English phrase I used! How embarassing!
Honestly, the ’5.times do’ thing was the only think that came to mind then. I was thinking writing Ruby was like having a conversation with the computer and how clear it was to me that I was asking the computer to print out the statement 5 times and that was what attracted me to Ruby. No cryptic hand-waving to get the computer to do stuff, just simple statements.
But it’s not that bad — it did pick up on the SRB (some free promo) and I did have some 5 minutes of notoriety on RedHanded.
I was trying to move my application (Sam) up to Dreamhost over the weekend. It might sound silly, since Welcome has its own server facilities, leased line etc but I ran out of servers and I was reluctant to ask for more out-of-budget hardware. Anyway this application needs to be available for access from France and Singapore and prior experience of hosting applications in Singapore resulted in terrible performance.
So anyway the plans looked great and I took out one that gave me 300GB of bandwidth and 20GB for US $120 a month, which even gave me a free domain to boot. Great deal! The admin panel looked a bit strange (I’m more used to cpanel style) but it was ok. I was planning to use Capistrano to do the deployment, with Subversion as source code control. Dreamhost offers FastCGI, which was great.
The first indication of problem came when I was using Subversion. I struggled half a day to get it up and running ,but I put it down to my inexperience with SVN. Shrugging it off, I tried Capistrano, poring through the wiki and Googling like mad trying to understand and use Capistrano. Learning it was no big and it was easy to use. Using it on Dreamhost was a nightmare. After much creation and deletion of subdomains, I finally gave up on it.
Quite discouraged now, I abandoned Capistrano and manually checked it out from SVN into the directory. To my horror it now gave me a ‘not enough space on device’ error! I had 20GB (it said so in the control panel) but after 19MB I don’t have enough space?? Another flurry of file deletions. I removed my SVN directory to keep the files down to size and tried to upload the files directly from FTP. I uploaded the files successfully. (Later after reporting this error Dreamhost came back with an apology that it was their fault, they were clearing up some files or something).
You can guess how ‘eager’ I was to tackle the MySQL database migration. Fortunately a simple backup and create script did the job. Next thing –making the app work.
Following instructions from the wiki, I created a brand new Rails app from my shell login. Then I changed the settings at this new app to fit the required settings to run it on FastCGI in Dreamhost. Then I moved my code to the domain directory. Does it work? Yes!
Then, no. Randomly, somehow the application would go down in flames with the dreaded ‘Rails application failed to start properly’ error. More checking in the wiki and forums and all over the Web. Apparently Dreamhost randomly kills the dispatch.fcgi process like sitting ducks in a shooting gallery. What the — ?? Some code in the wiki gave a workaround to fix this (a hack, really — before in its last dying gasp, the process will spawn another process to take its place). It works, somewhat. However, some times my app will log me out halfway doing something. Still frustrating, still don’t know how to fix that.
Now, most of the application works. Except a couple of pages. Why? I checked the production log. No errors. Errors on the screen? Nothing. Pissed off now, I tried to run Webrick. Hey hey it works! I go to port 3000 and my app pops up! I go to the recalcitrant page. It works! What the –??
Thoroughly turned off now, I took my controller and view apart, line by line, commenting it and uncommenting it until I get something working and worked my way up from there. A few hours later, I found the problem.
I have this bad habit of putting debugging lines in my code, by printing out strings to the console. Fastest and laziest way of debugging. In other words, I used ‘puts’ or the shorter form — ‘p’. Apparently FastCGI doesn’t support Rails with ‘puts’ and it doesn’t give any error messages, it just says ‘Rails application fails to start properly’. I removed that and it worked!
Then another page failed to load at all. But by this time, my weekend was shot to pieces, and my patience was at its end. Time to sleep it off and fight another day.
Aneace asked me casually the other day how many visitors do I get on average every day. I gave a quick gauge of around 100 per day, but I wasn’t so sure, so I did some charts using the stats from the site. These are the numbers for this year.
|Month||Unique visitors||Number of visits||Pages||Hits||Average no of visits/day|
I really only started pumping in articles and such starting in May, so you can see the numbers really increase in May.
Some charting from Excel gave me these nice graphs.
The numbers are not too bad I suppose. More trivia — the majority of my visitors are from US (54%), followed by Singapore (14%), which is interesting but not surprising. I got a lot of visits from an article on mashups which I posted in this blog, which got coverage from an article from the Web Services Journal.