Archive for the ‘Uncategorized’ Category.

2009 Statistics

Looking back at my website traffic in 2009 shows pretty amazing growth:

year	#reqs	#pages
2006	2362	1657	+
2007	14982	9867	+
2008	335897	227906	++++++++++++
2009	1149221	826814	++++++++++++++++++++++++++++++++++++++++++

Compared to 2008, I blogged much more frequently. I actually tried to post at least once a week, but couldn’t quite keep up during the second half. I also put up the M2Crypto API documentation, which gets a fair bit of traffic.

The most popular 2009 blog post was Multicolumn ListView in Android with about 5,100 page views according to Google Analytics. Most of my posts dealt with Python, however, and I posted several snippets of code that touched projects like Django, CherryPy, boto (Python interface to Amazon Web Services), Fabric and so on.

I continued to maintain Caltroid, the first Caltrain schedule application for Android. I also released three other Android applications: d20 Ability Calculator, 20 Ability Calculator Lite and ChandlerQE for Android. All in all I made about $250 on Android software sales (gross), but since the expenses were less I actually made a slight profit. Hourly pay would counted in pennies, though.

I continued to maintain CaltrainPy and CaltrainJS as well. Other projects that I did maintenance releases on were M2Crypto.

I ported Office Resource Locator to Django.

I created a little encryption library called m2secret in Python.

2009 Donations

Time for my yearly donations to Open Source projects I use. As I mentioned when I launched ChandlerQE for Android I planned to donate 20% of the sales to OSAF. Here are the statistics:

Market           Price  Copies
==============================
Android Market   $1.99  4
Android Market   $0.99  6
SlideMe          $1.99  0
SlideMe          $0.99  3
==============================
TOTAL                   $16.87
20%                      $3.37

Somewhat of a disappointment, but understandable given that nobody seems to be working on Chandler code anymore. But I sent the 20% to OSAF anyway.

I decided to donate to three other projects this year:

Like last year, I would have wanted to donate to Mozilla Thunderbird, Pidgin, Enigmail and Pylons but didn’t see any ways to donate directly to them.

Site Breakage Fixed

Last Sunday Dreamhost went and switched the host on which all of my sites run to a different machine. There was no advance notice, just an email after the fact informing me the change occurred and hopefully they did not break anything. As it turns out, they changed quite a bit. I am not sure if the old host was 64 bit or not, but the new one definitely is. Some of the apps I had compiled myself no longer run, complaining about wrong architecture. Some paths were different, some Apache settings were different, and mail filtering through procmail broke. As a consequence, my blog, M2Crypto Tinderbox and all my Python web applications broke. Those are the things that I know of, because I have now fixed all of them as far as I can tell. It was reasonably straight forward to recompile everything (luckily I had saved the previous configure options), find and change the changed paths, and google the Apache error. The procmail filter started working after I redid the mail filtering settings through the Dreamhost panel.

While this unannounced change was definitely not cool, it is the only time (so far) when I have been really unhappy with Dreamhost since I started hosting there in early 2006. So I am still recommending them as a cheap hosting provider: for under $9/month you get unlimited bandwidth and disk space, and cheap and anonymous domain registration to boot.

Anyway, Murphy’s Law still rules, as this all happened while I was on vacation with no net or even cell phone coverage. Sorry for the extended downtime.

My Amazon Store Open

I looked at the Amazon Associate store options, and since it was so easy to do I decided to open up my own store concentrating on books of interest to people in the software engineering trade. I have read a lot of technical books especially on software security, although my pace has slowed down recently. I also realized the store can act as a reasonably good way for me to keep track of the good books in my own library, and an easy way to recommend great books to other people.

There is also a section on electronics, geared towards people who use Linux (all things in my store should play reasonably well with Linux).

Switching from XEmacs to Emacs

My first editor in the *nix world was Emacs. When I started university, some friend showed me how to get started. I have never really become a power user with it, but it is the tool I use for random small editing tasks. At some point in time when I started using Linux on desktop more often I put some effort into making Emacs work well with my habits, and in the process I actually settled on XEmacs. At the time I believe it was more advanced than Emacs, more defaults worked out of the box, and the GUI actually had a button for copying text. This was important since I could never remember how to do that from the keyboard (I could only remember how to cut).

It is now 2009, and I think Emacs has long since eclipsed XEmacs in features etc. At least on Ubuntu, Emacs also comes with the important copy toolbar button ;) . Besides, when I log in to remote systems they will almost certainly have Emacs but not XEmacs, meaning I can’t just upload my XEmacs customizations file and expect things to work. So I decided to see if I could make Emacs work at least as well as my XEmacs does.

Most of the settings were trivial; just copy to .emacs. Keyboard customization uses slightly different syntax in Emacs, but it was an easy conversion. The problematic things were font size and clipboard functionality. I wanted a bigger font size, and the best solution I found was to set the font face height explicitly (actual value will depend on your resolution and your likes), but the following gives me a nice 80×63 Emacs window that will use half horizontal and 100% vertical space:

;; With my resolution, dpi and fonts this let's me display 80x63 geometry
(set-face-attribute 'default nil :height 100)

The XEmacs clipboard worked out of the box with my X and Gnome settings, but Emacs needed some tweaks:

;; Make copy and paste work with other applications
(global-set-key [\C-z] 'undo)
(global-set-key [\C-x] 'clipboard-kill-region)
(global-set-key [\C-c] 'clipboard-kill-ring-save)
(global-set-key [\C-v] 'clipboard-yank)
(setq x-select-enable-primary nil) ; stops killing/yanking interacting with primary X11 selection 
(setq x-select-enable-clipboard t) ; makes killing/yanking interact with clipboard X11 selection

Incidentally, with those settings I have no problems with copying and pasting text since the key combinations are the same as in any other program I use. So I could even take out the toolbar, since I only needed it for copying.

Since I do most of my programming in Eclipse, I also wanted matching comment/uncomment region settings:

;; Comment/uncomment reqion similar to Eclipse: C-/ and C-? (control shift /)
(global-set-key [(control /)] 'comment-region)
(global-set-key [(control \?)] 'uncomment-region)

Probably my nicest customization (although not written by me) is to be able to cycle between buffers with Ctrl-tab and Ctrl-Shift-tab. They are kind of long, so see the links below.

I think I found the answers to most of my problems on EmacsWiki.

I have always found other people’s (X)Emacs customization files fascinating reads, so if you are like me, here you go: .emacs and .xemacs/custom.el.

Update: As was pointed out in the comments, binding C-x etc. breaks havoc with many Emacs bindings. However, I did this only after I was unable to get CUA mode to work properly (namely, copy and paste did not work between Emacs and other applications). But I gave it one more try, and it seems like adding these things to .emacs does indeed make copy and paste work like I want:

(cua-mode t)
(transient-mark-mode 1) ;; No region when it is not highlighted
(setq cua-keep-region-after-copy t) ;; Standard Windows behaviour

Of course, remove the lines that bound C-z, C-x, C-c and C-v (since CUA mode does that).

Year 2008 Metrics

I worked a lot on my site(s) in 2008. I started a couple of new open source projects, and started experimenting with advertising to counter my hosting and domain costs. Oh, and I switched jobs.

Software

I made a new release of M2Crypto. I also updated my Caltrain schedule applications, both the Python and online version.

I created a Caltrain schedule application for the Google Android platform. I also created a simple office resource finder.

I also created a Pylons project, although it isn’t Open Source: horsetrailratings.com.

Check the list of my software projects.

Traffic

I started blogging pretty regularly around January. It wasn’t until I asked to be included in the two Python planets that my blog traffic skyrocketed. Someone seems to be submitting almost all entries to those planets to Reddit, which brings additional readers.

I also wrote a number of articles on how to run Linux on various laptops and submitted them to Linux on Laptops site, which seems to bring in a fair amount of traffic. Linux on Laptops has been a great resource for me over the years, so I am glad I am finally contributing to the effort as well.

My most popular blog posts include SSL in Python 2.6, Pythonic application deployment and how to use decorators to add arguments.

Below are the raw statistics for my main site:

month	#reqs	#pages
Jan	4303	2647	++
Feb	9524	5846	++++
Mar	7626	5542	++++
Apr	9281	6677	+++++
May	9469	7363	+++++
Jun	8549	6787	+++++
Jul	12690	9282	+++++++
Aug	25567	18250	+++++++++++++
Sep	38036	27645	+++++++++++++++++++
Oct	96574	56477	++++++++++++++++++++++++++++++++++++++
Nov	54221	38583	++++++++++++++++++++++++++
Dec	58537	41648	++++++++++++++++++++++++++++

Advertisements

Google AdSense statistics show over 15,000 impressions (I started in the summer), which have resulted in about $10 of advertising revenue. At this rate it will take about five years to get the first check from Google. Quite disappointing, but in retrospect understandable: the topics I write about tend to interest people like me who are pretty unlikely to even notice the ads.

Dreamhost referral links have been clicked something like 500 times, but nobody has signed up. Again, a bit of a disappointment, but after doing some searches again understandable, since there are pretty good promotion codes out there.

Amazon has been the most disappointing. Just a handful of clicks and no purchases. I will probably be phasing that out in 2009.

I also briefly experimented with an AdSense competitor, but realized quickly that splitting the small ad revenue between several ad providers would mean even longer wait for the first check.

All in all, the results are so insignificant that unless something drastic happens in 2009 I might as well get rid of the ads since managing them does add a little bit of work (not to mention the addiction of checking the statistics to see how much you made at any given time period).

Problems Publishing: Blank Page

I was unable to publish new posts since early December, 2008. Hitting Publish button just gave a blank page. There were no Javascripts errors in browser console. Scheduled publish did not give any errors, but wouldn’t publish either. I read several posts about blank pages, but none of them matched what I was experiencing.

In the end I found it was two problems, although at first I thought there was just one problem. An upgrade of WP Super Cache plugin (0.8.6) had made it impossible to post. But at the same time, an upgrade of WP Widget Cache made it so that attempt to post would result in blank page. In fact many other actions would also result in blank page, like trying to delete posts and do some other administration functions.

After I deactivated and reactivated the WP Super Cache plugin I realized the .htaccess rules had been in error, but deactivate and reactivate fixed this. I was then able to post, but I still got the blank page, and was still unable to do many other actions. I finally went and deactivated a plugin at a time until I found I was able to do everything. It turned out WP Widget Cache upgrade (0.25.1?) was the culprit. I left the WP Widget Cache plugin deactivated for now.

The pattern of error I was seeing in Apache error log was this:

[Mon Jan 05 23:33:25 2009] [error] [client 24.130.151.91]  File does not exist: .../heikkitoivonen.net/failed_auth.html, referer: http://www.heikkitoivonen.net/blog/wp-admin/post-new.php

Sorry for the blog spam during my attempts at fixing this.

Undocumented Gotcha with Drupal Installation

I have had an idea for a website for a couple of years. I registered the domain, and never got anything else done. Until now.

Since it seems like a content management system matches the requirements the closest, I did some investigation into content management systems. I host at Dreamhost, and they offer two popular CMS systems in one-click installs: Joomla and Drupal. There are lots of other options too. I decided I did not want to write a custom CMS from scratch, and figured I’d try how far I can get with popular off-the-shelf systems. Wikipedia has some lists and comparisons of CMS software, but the nicest comparison tool I found was cmsmatrix. I looked at some Python options as well, but I didn’t want to go with Plone or any Zope-based system; I am just assuming they are too heavy for Dreamhost’s shared hosting. And they don’t really have a reputation of being easy.

In the end I decided to try Drupal. Besides being an easy install at Dreamhost, the modular architecture is appealing. And while I suspect I won’t be modifying Drupal itself, it has gotten some reputation of being rather well designed. I have read some problems about database connections being too slow on Dreamhost, so I will need to keep an eye on performance.

Installation was an interesting experience. I read the Dreamhost Drupal wiki page, which pointed to an installation video. I think this is the first time I have watched a video on how to install something. Seemed simple enough, but I actually got stuck in a spot: the 6.6 installer requests that you copy sites/default/default.settings.php to sites/default/settings.php and ensure it is writable by the web server account (which in case of Dreamhost is just your user account). Even after the copy I was still getting the error message that I needed to do this. I then made it world writable, with no difference. I found the INSTALL.txt and read through that with no clues. I did a bunch of searches to see if others had seen it, but no luck. I read other people’s install stories, and by luck happened to notice someone mentioned you need to chmod 755 the settings file. Doh! That did the trick, but nowhere in the installation instructions did I find any mention that this file needs to be executable.

I have still tons of configuration to do before the site becomes even remotely useful. I am also on the lookout for a horse-related theme. These themes seem to be surprisingly rare. Maybe most people who are into horses aren’t into computers, and vice versa.