c o d i n g f r o g s

croaking about programming, programming languages, software engineering, and the business of software

12Aug/100

Ruby Time

I figure it is time to start learning how to program in Ruby.  It appears that this Ruby fad is not going away.

(That was a joke, Ruby people.)

I'm reading Geoff Moore's "Crossing the Chasm" now, and as a result I seem to be applying that metaphor to just about everything.  Oddly, I find that I'm more in the early-to-late majority camp with a lot of things, even in technology (for example, I still do not own a smart phone - gasp!).  Is this a concern?  Does it mean I am not sufficiently passionate?  Or does it just mean that I prefer to focus my efforts on learning stuff that will be meaningful?

I don't know, but likely this is why I am still not a Ruby programmer.  At any rate, web application development is not exactly a strong point with me, and I figure if I'm going to shore up that part of the fortress, or whatever, then perhaps Ruby is the way to go.

Sadly, this probably does not bode well for nearlyfreespeech.net, my current hosting provider.  I've been happy as a clam with nearlyfreespeech.net, but they only provide PHP.  That's fine for running a WordPress blog like this one or Seeping Matter (my personal blog) for now, but if I start programming in Ruby I'll end up choosing another provider, and I'm likely to only want one.

I'm looking at a few different hosting providers.  I'm open to other suggestions or comments about how these choices are great or not great.  Current short list includes:

  • WebFaction - $8.50/month
  • HostingRails - $8/month
  • RailsPlayground - $9/month

All of them support Ruby/Rails, PHP, and Python; all offer SSH access; all provide Subversion; all offer nightly backups.  HostingRails also offers pay-as-you-go pricing like NFSN so that's a bit of a plus.

Stay tuned.

7Mar/100

Even Simpler WordPress Administration on NFSN

I'm a fan of both WordPress and NearlyFreeSpeech.net, which you may have already figured out if you've done a little digging.  This blog is hosted on NFSN using WordPress, as is my personal blog.

Installing WordPress is a fairly straightforward adventure, but this script makes it a little bit easier:

wget http://wordpress.org/latest.tar.gz
tar xvzf latest.tar.gz
cp -R wordpress/* .
rm -rf wordpress

head -44 wp-config-sample.php > wp-config.php
wget http://api.wordpress.org/secret-key/1.1/
cat index.html >> wp-config.php
rm index.html
tail -28 wp-config-sample.php >> wp-config.php

echo "" >> .htaccess
echo "RewriteEngine On" >> .htaccess
echo "RewriteBase /" >> .htaccess
echo "RewriteCond %{REQUEST_FILENAME} !-f" >> .htaccess
echo "RewriteCond %{REQUEST_FILENAME} !-d" >> .htaccess
echo "RewriteRule . /index.php [L]" >> .htaccess
echo "" >> .htaccess

Run this script directly in your document root. You can get a copy of it here.  It grabs the latest version of WordPress and unpacks it, updates your configuration with your own set of unique WordPress keys, and updates your .htaccess file to support the pathname URLs used by WordPress.  Now all you have to do to set up WordPress is set up a database and provide wp-config.php with your database info and you should be good to go.

WordPress updates regularly, which is good news because it means the project is active.  The downside is that this also means upgrading the installation frequently.

To help deal with this I also wrote an upgrade script:

if [ -d "backup" ]
then
        echo "Delete backup directory first."
        exit
fi

mkdir backup
cp -R index.php license.txt readme.html xmlrpc.php wp-* backup

wget http://wordpress.org/latest.tar.gz
tar xvzf latest.tar.gz
cp -R wordpress/* .
rm -rf wordpress

This upgrade is pretty simple but keeps your site intact, including any themes or other content you might have added.  This script is also available here.

I tried this today setting up a new blog as well as upgrading this blog, and the scripts seem to work fine.  Any feedback is welcome.