In case anyone finds themselves in this position, here’s what I did, bearing in mind that just beacause it worked for me doesn’t nessesarily mean it won’t screw your site up even more.
UPDATE `wp_terms` SET `name` = `term_id`;
Next time I’ll be a bit more careful upgrading, and will definately make sure I have a backup of the database. I was lucky I didn’t get burnt worse than I did!
]]>
“I am rarely happier than when spending an entire day programming my computer to perform automatically a task that it would otherwise take me a good ten seconds to do by hand.”
Douglas Adams, Last Chance to See
The Incredibly Strange Film Festival is back with the Rebirth of Cruel, starting today in Auckland and on the 18th in Wellington. I’m personally looking forward to Timecrimes as I have a bit of a thing for time travel movies.
The timetable is online at the official site, but personally I find an iCal file much more useful, so after a bit of playing around here are iCal files for the Auckland and Wellington timetables. The calendars are generated by a php script reading two xml files: venues.xml and movies.xml (which may or may not be valid xml). There’s a bit more data in the files that I’m not using yet, but when it’s finished the info should get picked up by iCal (or Google Calendar) when it refreshes.
To use them, just right click and copy the link, then in iCal go to the Calendar menu, pick Subscribe… and paste in the link. Please set the refresh rate to something low to avoid killing my server.
Disclaimer: Please don’t rely solely on these calendars! Check the official timetable to confirm screening times. If you spot any errors, please let me know in the comments.
]]>
This is a fun little script I wrote up that reads your weekly top albums chart from Last.fm, gets the cover art for each album, then displays the top albums on your blog. Scroll to the bottom of the page to see how it looks. Yes, there are Wordpress plugins that do this already, but I always think it’s a bit more fun to try to roll my own. Most of other scripts tend to use your recent tracks feed as well, which doesn’t work well for me as I tend to listen through albums so my feed only ever shows a couple of albums. The data I’m using comes from Audioscrobbler’s web services, and there a loads more feeds available for those wanting to customize the script.
The script needs to be included manually in your blog template, so should work fine in any blog software running on a server with php 5 or higher. If you are comfortable with php you should find it easy to customize the output to suit your blog design.
To use, download the script, upload to your server and use include 'path/to/lastfm.php'; to add it to your template. Then you’ll need to create a cache folder somewhere on your server and change it’s permissions to 766. (The script uses some simple caching to avoid over use of the xml feeds, but it should probably be caching the images as well.) Then edit the top of the lastfm.php file to customize your settings. You’ll also need a blank album image to use when something goes wrong.
The script outputs pretty simple html that should be easy enough to style with just css.
]]>
In case anyone else runs into this problem in the future, here are the steps needed to share a Canon Imageclass 4140 laser printer between OSX and XP. I’ve only tested this under Leopard, but it should work for Tiger as well.
First, the problem. While the printer works fine attached to the XP machine, print jobs sent from the Mac disappear into the ether without actually printing. According to the Canon guy I spoke to, chances are this is because the mac is sending Postscript data which the XP driver doesn’t know how to handle. Conversely the printer also works fine attached to the mac (as long as you use the most recent drivers, currently version 1.6), however the XP machine is unable to connect to the printer. In the Printers and Faxes window you just get an ‘Access denied, unable to connect to the printer’ error.
In order to make the two play nice, first we need to edit the smb.conf file on the OSX machine. In terminal, type:
sudo pico /etc/smb.conf
Scroll down to the [printers] section and add the line:
use client driver = yes
I also set the ‘guest ok’, and ‘printable’ settings to ‘yes’ as well.
Save the file, then try to add the printer on the XP machine. This should get you past the access denied error, but you still can’t print. Finally, change the printer driver on XP to the Apple Laserwriter driver (any of them should work), which lets the XP machine send Postscript data to the mac.
]]>
Its always annoyed me that double albums showed up as two cds in iTunes. The only reason most double cds are two discs is because there is more content than one cd can hold (ie 74 mins), but as mp3 files this limit doesn’t exist. Fortunately iTunes is pretty smart, and a little tag editing can put everything together into one ‘album’, both in list view and in coverflow.
All you need to do is make sure the disc number tags are set (ie disc 1 of 2 and disc 2 of 2) to ensure that the tracks stay in order when combined, then simply give both discs the same name. The result is one long album with disc 1’s tracks followed by disc 2’s, which lets the album play right through.
]]>The file format is simple (and still being developed) and consistes of a few key symbols to indicate tasks and headings.
A heading ends with a colon: A description is just a regular line of text. - A task starts with '- ' on a new line. - Here's another task, with a context: @next - Completed tasks end with @done
I started thinking about ways the display could be improved without compromising the key point of difference of plain text files, and came up with this mockup.
Note: Mockup, the program shown below is based on TaskPaper, but doesn’t actually exist.

At the top I’ve added a standard unified toolbar with search field and a filter bar. I imagine the filter bar automatically picking up on the most common tags used, with the rest under the ‘More’ popup. The search field would highlight the search term everywhere in the document.
At the side I expanded on the use of round buttons instead of the usual checkboxes. The + and - buttons appear next to each list heading, and expand and collapse the list. The task dots can be colour coded based on the applied tags - in this example I’ve highlighted @waiting in orange and @next in green.
I’ve also started thinking about a way to bring the tasks into iCal, possibly using some of the code I wrote for my RSS to iCal script. It should also be fairly easy to write a parser for the format in php which you could run from your desktop. You could then build a web interface and access your lists from anywhere, like an iPhone for example.
]]>Came across this screenshot while clearing out some files. It’s from a version of Connoisseur I played around with a while ago. I was wondering if any of the various recipe apps around would make a good cocktail database. I was poking around the preferences and noticed that I could switch the units to metric, but after I made the change some odd measurements showed up in the built in recipes. After switching back and forth a few times, I ended up with a recipe for 15min Brownies calling for 83 43691/131072mls of Butter. That’s pretty impressive accuracy.
]]>
This is a quick and dirty php script I wrote up to convert an RSS feed into ics format so I could display it in iCal. It uses MagpieRSS to parse the RSS, then creates an event for each item. There is plenty of room for improvement here, but it’s working - in the screenshot above I have iCal subscribed to my feed, Daring Fireball, and FlickrBlog.
To do:
To use, download the script and upload to your server (or use from your local server). In iCal, select Calendar > Subscribe…, and enter the path in the format http://path/to/rss-ics.php?url=http://path/to/feed/.
In it’s current form it’s not particularly useful, but I have a few ideas already, and if anyone comes up with anything interesting using this I’d love to hear about it.
Update: Should now handle feeds that store the date in the dc:date field as well as those using pubDate.
Update: This works great for facebook status feeds.
]]>
Last week drunkenbatman popped up in my feeds again after almost a year offline. The last few comments on the previous post had led me to suspect the worst, though he is fairly prone to slipping off the radar for extended periods. Drunkenblog is a must-read for any Mac geek, so to celebrate, here’s a simple but classic drink everyone should know: the White Russian.
Build up over ice in a short glass and stir well. I prefer to use Tia Maria in a White Russian as it has a slightly smoother, creamier taste than Kahlua, which I find quite harsh.
]]>
Last night I opened iTunes to find that all my genres had disappeared.
After the initial shock wore off it occurred to me that since the genre info was stored in the id3 tags of each file it was unlikely that they were completely gone. Getting info on a couple of tracks confirmed that the data was all still there, and interestingly, once the info window had been opened the genre info appeared for that track. It seems that, somehow, iTunes had simply forgotten the genre of every song in my library.
Surely there was an easy way to ask iTunes to simply refresh my library by reading the id3 tags of each file? Apparantly not. A bit of googling suggested that you could do this by selecting all the tracks (Command - A), getting info (Command - I), then pressing OK. You need to make sure that none of the fields were checked before you hit ok, or iTunes will go through and actually edit the tags, making things even worse. This seemed promising, but unfortunately it didn’t work. After a few minutes of processing, nothing had changed.
Since the data was all there in the music files I knew that I could just ditch my library and start again by re-importing everything, but that would be a last resort. I would loose all my play-counts, playlists, ratings, etc, and probably have to re-sync the whole lot to my ipod.
One thing I noticed while experimenting was that the info window didn’t even need to be closed for iTunes to update - I could open it, hit ‘next track’, and iTunes would pick up the info from each track as I paged through the songs. That gave me an idea.
It’s a very simple, and slightly silly applescript, but it works. To use it, you need to enable GUI scripting in System Preferences under Universal Access (check ‘Enable access for assistive devices’). Then open Script Editor and enter the following applescript (or just download it).
tell application "System Events"
tell process "iTunes"
set frontmost to true
keystroke "i" using {command down}
repeat 10000 times
keystroke "n" using {command down}
end repeat
end tell
end tell
You could change the repeat line to ‘repeat while true’, but I wanted to be sure that it would actually stop.
Open iTunes, select the first track, switch back to Script Editor, and hit run. Applescript will switch to iTunes, get info on the selected track, then hit the next button 10,000 times. On my machine applescript seems to be too quick for iTunes so it doesn’t actually go through 10,000 tracks. When it stops, just scroll down and select the first song with a missing genre and start the script again.
Obviously this would have been much easier if I’d had a recent backup, and I’ll definitely be backing up a bit more frequently now. It would be nice to see a re-build option in iTunes though. The data is all there in the files, iTunes just needs to be told to look for it.
Disclaimer: If you try this, back up first. It shouldn’t cause any problems, but I won’t be held responsible if something goes wrong… or if you end up with 10,000 empty playlists.
]]>