Do your backups work?

A sobering tale from the operator of social bookmarking site ma.gnolia which lost half its users bookmarks through not having a decent backup. Interestingly they were running off 2 Xserves and 4 Mac minis.

  • They had RAID (but of course that doesn’t protect you from data corruption, as both copies get corrupted).
  • They did a FireWire backup (but of course that just backs up your corrupt database).

Hint: mysqldump is your friend.

Video interview on the Ma.gnolia site, with a transcript here.

Meanwhile TidBITs have declared Friday 13th as “Verify your backups day”. And remind us of the Tao of Backup.

Remember, sometimes the cloud blows away.

MySQL ‘unknown column’ in ‘on clause’ error

So if your MySQL query is mysteriously giving you an error about an ‘unknown column’ in the ‘on clause’, it’s possibly because in MySQL 5.0.12 the handling of the left join was changed to conform to the SQL standard. Basically it means that because of changes to precedence you’ll probably have to re-order your list of tables in the from statement. Documentation here. Discussion of the problem here.

Mac server hosting

Edition.net areร‚ย offering dedicated Xserve server solutions for US$250 (presumably per month, plus US$400 setup). For that you get “MacOSX Server featuring Xserve – 1.33Ghz PowerPC G4, 60gig storage, 512MB ram, WebObjects 5”. Although the RAM (and storage) seems a bit small. There are other options available which include WebStar V, FileMaker Unlimited (version 5?), and Lasso Pro 6 (not 8!). They do offer “flat-rate pricing with no traffic surcharges”.

digital.forest offers an Enhanced plan for US$30 setup and US$19/month (+US$10/month for MySQL) with perl, PHP5, Python, Mac OS X and more, 100MB of storage, and 3Gb of data transfer. Not sure what their colocating price is like though as you need to contact a salesdroid. Digital.forest have been around since 1994 and have a long time association with Mac newsletter TidBITs.

Leopardisation

So, despite wanting to get my copy of Leopard on the day of release (sad Mac fanboy that I am), I waited some days to install it. Some of these were because my offsite backup was offsite, and I didn’t realise its power supply and cable were also offsite ๐Ÿ™‚

Anyway, I began the upgrade process by upgrading a PowerPC PowerBook G4 which already had a developer pre-release copy of Leopard installed. Reassuringly this installation failed, leaving the machine in an unusable state.

Buoyed with enthusiasm by this experience (well, ok it’s somewhat traditional for the release build to fail to install over a developer build), I proceeded.

Having by this time got the first bug reports on Macintouch and news of the Keychain/login update I cautiously turned on auto-login on my machine so that I didn’t need the password to get in (theoretically). I also downloaded the update. I backed up my Intel machine and ran the Leopard installer. I bravely selected the ‘Upgrade’ option rather than ‘Archive and Install’, but I was feeling lucky and wielding a backup.

The machine rebooted (alas I did it overnight so I missed the install movie) and I was in Leopard.

So, fire up Safari and… no network. Bummer.

Install the login/keychain update and reboot. Well, at least the network has come back!

So, what to do? Check out the new Finder features. Launch some Apps. Upgrade some Apps that report upgrades are available. Try AppleWorks, which quits on launch (with the recent items panel open). Eventually this is resolved some days later when I read on Macintouch that the AppleWorks Users Group suggest:

1. Quit AppleWorks and switch to the Finder.
Delete the Recent Items folder at Macintosh HD > Users > yourname > Documents > AppleWorks User Data > Starting Points.
2. Re-launch AppleWorks. AppleWorks will create a new (and empty) Recent Items folder and should then run reliably under Leopard.

Other things I noticed:

  • Arrow keys no longer work in vi in iTerm Build 0.9.5.0611. I’m sure that will affect a lot of users!
  • httpd is now actually Apache2. This means that the config file has moved from /etc/httpd.conf to /etc/apache2/httpd.conf which is where you’ll have to enable php5
  • mysql.sock appears to need to be in /var/mysql/mysql.sock by default. I did

    sudo mkdir /var/mysql
    sudo ln -s /tmp/mysql.sock /var/mysql/

    after which mysql once more behaved.

  • My cups-pdf printer has vanished into the void. I haven’t tried reinstalling and there doesn’t seem to be mention on the site about Leopard support, so ignoring that one for the moment
  • “fink selfupdate” seems to have happily updated fink for most things
  • Fired up Mail.App and it proceeded to attempt to update my mailboxes. It then complained at one stage that it couldn’t, so it switched to importing my mail. I’m not sure what difference this made, but it seemed to work eventually.
  • I had the cursor vanish once, but it got better and came back
  • The grammar checker detects double words such as “the the”, but doesn’t let you hit the ‘Change’ button to just fix it, which would seem logical.
  • Speed comparison wise, Leopard seems a little more responsive. Must be leveraging the GPU that does it.
  • Spaces is hard to get the hang of.
  • The dock does not seem to be worth the attention lavished on complaining about it
  • The firewall was down. Turning it back on was a good idea
  • Although the Sharing Preference pane showed “mycomputername.local”, clicking the edit button actually revealed that the name was in fact “Macintosh.local”, which conflicted with 3 other machines on our network as I found when I opened the laptop at work ๐Ÿ™‚
  • Address Book not being able to send/receive SMS messages via BlueTooth sucks. Hopefully that functionality will be re-enabled shortly.
  • iChat’s new effects are cool. I can’t wait for the hologram effect ๐Ÿ™‚ “Help me Obiwan Kenobi, you’re my only hope!”
  • Coverflow is cool for paging through those piles of PDF documents generated by the ScanSnap S500M and ReadIRIS
  • Searching by filename is easier in Spotlight, yay!
  • The build number is 9A581. Java is version

    java version “1.5.0_13”
    Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
    Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

  • After a cursory look, NeoOffice seems to work. Eclipse seems to work ok.
  • Other mission critical apps that will need an update are Missing Sync and Filemaker

Soon with shiny WordPress 2.3 goodness

So, I’ve converted to the latest wordpress 2.3. Basically this involved

  1. If you’re using Gallery2, you may need to upgrade that to a more recent version so that your WPG2 plugin is compatible with it. Grab the latest version of the WPG2 plugin while you’re there (note that I haven’t got it working properly again yet ๐Ÿ™‚
  2. Backup the MySQL database ร‚ย mysqldump -umysqlusername -p --opt wordpress > wordpressackupfilename.sql. Or using the WordPress Export or Backup plugin. Check the backup in a text editor ๐Ÿ™‚
  3. Backup the WordPress installation (cd /Library/WebServer/Documents; mv blogname blognamebackup). Paranoia is a wonderful thing ๐Ÿ™‚
  4. Upgrade WordPress by doing a subversion checkout (it’s much nicer to upgrade with subversion) svn sw http://svn.automattic.com/wordpress/tags/2.3/
  5. If subversion complained about it, move wp-content/themes/classic/functions.php out of the way ร‚ย and then do the subversion checkout again to get the new version.
  6. Go to the WordPress plugins page. WordPress 2.3 lists outdated plugins on the plugins page. I had to download and replace widgets, akismet, google-sitemap-generator, and wpg2.
  7. Turn off Jerome’s Keywords and Ultimate Tag Warrior if you’re using them.
  8. Bizarrely I got the “Call to undefined function the_post_keytags()” from the index.php file in my default WordPress theme. I guess I’d altered it to include that call. I just edited it out from the index.php file.
  9. Go to Manage -> Import to import your tags from Jerome’s Keywords and/or Ultimate Tag Warrior
  10. Hopefully that’s it! You may need to turn off some other plugins (probably best to turn them all off then turn them back on selectively.

Write some posts!
(Yes, I know this post’s formatting is borked, I’ll fix it when I’ve upgraded this blog to 2.3 which will probably be when I’ve used it for a few more days and got comfortable with any more surprises)

Palm releases Centro Smartphone bundled with Sprint

Palm has released the Centro Smartphone (not sure if that’s pronounced “chentro” or “sentro”). The Palm Centro “gives you voice, text, IM, email and web”. Includes Bluetooth, but not WiFi. Uses the Blazer web browser.

Probably not an iPhone killer but might be useful if you need something to use while waiting around for the iPhone to come to your country. Assuming you’re somewhere that has Sprint coverage of course.

MySQLdb lays an egg

If you’ve got a Python CGI that uses MySQLdb and it mysteriously fails to display, you may want to check /var/log/httpd/error_log where you might find something like:


Traceback (most recent call last):
File "/Library/WebServer/CGI-Executables/test2.cgi", line 12, in
import MySQLdb
File "build/bdist.macosx-10.4-i386/egg/MySQLdb/__init__.py", line 19, in
File "build/bdist.macosx-10.4-i386/egg/_mysql.py", line 7, in
File "build/bdist.macosx-10.4-i386/egg/_mysql.py", line 4, in __bootstrap__
File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 800, in resource_filename
self, resource_name
File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 1228, in get_resource_filename
self._extract_resource(manager, self._eager_to_zip(name))
File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 1250, in _extract_resource
self.egg_name, self._parts(zip_path)
File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 880, in get_cache_path
self.extraction_error()
File "/sw/lib/python2.5/site-packages/pkg_resources.py", line 846, in extraction_error
raise err
pkg_resources.ExtractionError: Can't extract file(s) to egg cache

The following error occurred while trying to extract file(s) to the Python egg
cache:

[Errno 13] Permission denied: '/Library/WebServer/.python-eggs/MySQL_python-1.2.2-py2.5-macosx-10.4-i386.egg-tmp'

The Python egg cache directory is currently set to:

/Library/WebServer/.python-eggs

Perhaps your account does not have write access to this directory? You can
change the cache directory by setting the PYTHON_EGG_CACHE environment
variable to point to an accessible directory.

As it says, you need to either create the directory and set the privileges (chown -R www:www /Library/WebServer/.python-eggs) or set the PYTHON_EGG_CACHE environment variable to a directory that’s writable by the user executing the cgi (probably www).

Fixing fulltext errors in autometa plugin for WordPress

So if you’ve got the autometa plugin installed in your WordPress installation, and you’re getting error messages like:

WordPress database error: [Can't find FULLTEXT index matching the column list]
SELECT MATCH(post_content, post_title) against ('installation') as score FROM wp_posts where id=59;

whenever one of your posts autosaves, you need to execute the following sql command on your database, either via mysql on the commandline or by using phpMyAdmin or CocoaMySQL

alter table wp_posts add fulltext autometa (post_content, post_title)

At least I assume it’s the autometa plugin, as that’s the file that shows up when I grep around a bit for fulltext.