Posts

  • Installing RMagick on Ubuntu Dapper

    Having played around with the latest version of the popular Ubuntu distribution in the last week or so, I thought I’d give a quick guide to installing RMagick. Unlike Breezy, Dapper doesn’t seem to work to well with the RMagick Gem (Norman Timmier has some great advice on installing RMagick under Breezy). Instead, use the following apt-get package command (It’s all one line) to get you up and running…

    $ sudo apt-get install imagemagick libmagick9 librmagick-ruby-doc librmagick-ruby1.8

    That should see you good. Now if you have the irb package you can test that RMagick is indeed loaded. If you don’t have irb installed, install it as so…

    $ sudo apt-get install irb

    Now you can test RMagick, remembering that the capitalisation is important here…

    
    $ irb
    > require 'RMagick'
    => true
    > exit
    

    Updated: If it returns true as in the above example, all is good. If you don’t get the true result, something has gone wrong with the installation, best try again it might still be ok, see Tim Hunter’s comment below to see why, thanks Tim.

    I hope this guide makes the installation slightly easier for someone, it took me a while when I transitioned to Dapper, I was still used to using the gem like I do on the Mac.

    Did you like my Ruby on Rails related article? Then why not recommend me on Working with Rails?

  • Search Back Up

    Thanks to Jens Kraemer for sending me a copy of the ferret_ext file I was requiring to get my search working.
    Maybe upgrading from Ubuntu Breezy to Dapper causes a few problems I hadn’t come across before. I’ll need to try a fresh install of Dapper, and see if compiling Ferret works on that.
    I’m now running Capistrano, a very clever set of Rake deployment scripts for rails. Being able to commit a revision to the live server, and revert to the previous version if it all goes wrong is brilliant.

  • Finally Online

    After 3 days of torment attempting to get my new Rails app online, it is now up!

    My server is now running Ubuntu Dapper with Lighttpd and FastGGI serving my blog. I ran into two problems getting this to work:

    1. First up Ferret does not install properly, and the file ferret_ext appears not to be compiled, and thus unavailable to the app. As soon as I started the server it would crash, citing the missing file. For this reason search is disabled, but will hopefully be reinstated as soon as I have solved my problems with this.
    2. The RMagick Gem wouldn’t work, and was again cited as missing by the server. I uninstalled the RMagick gem, and installed the ruby library available in the Ubuntu packages. I’ll put instructions for this in another Blog post.
    Hope you like the new design, I certainly feel it was worth all the effort it took, though I’m slightly disappointed that my search isn’t working for the moment.
  • YAND - Yet Another New Design

    Yep, my blog now has a new design! It has been over a year since the last one, and I really wanted to try out a design I’ve had on my sketchpad for ages. I can’t remember where I saw this style of blog (dark, light, dark, stuff at bottom etc), but if it does come to me, or I see it again, I’ll put a nod in the right direction, or change it completely if I find it is too similar (This is why using a random sketch isn’t so great, you forget sources, and it looks like plagarism).

    Design

    • My navigation is now at the top, but has now been joined by the search box.
    • On the bottom I now keep a short bit about me (which will soon link to the about page), some other links to RSS feeds and the like, and a sampler of gallery pictures (also to be implemented)
      *Tag clouds now appear at the bottom of most pages when there is no comments or older posts to display.

    Site Layout

    • The front page of the site now displays the latest blog post, as well as some of the more recent ones.
    • The Weblog page is now where the archives reside, and all my old posts can be found there.
    • On each post’s dedicated page, there is short summary of the post up top, just so people coming straight into the site know where they are.
    • There is a dedicated Tag Cloud page, making it easy to see what subjects I blog most often (bike is currently miles in the lead).
    • These is now a comment feed for the whole site, individual comment feeds for each post, and feeds for each of the tags. I’ll link to the last of those soon so you can try them out.

    Architecture

    • Ruby on Rails! Yep, my new site is the result of about two weeks of work with RoR. No more PHP for this blog!
    • Now with tagging. One of my main reasons for changing languages was that I could add new features such as tagging without having to work with old stale code, plus it let me learn something new.

    Operating System

    Installing mod_fastcgi on Fedora Core 5 was a bit of a nightmare, so I decided to change linux distributions. As I write this I’m currently running Ubuntu Breezy under Parallels desktop on my Macbook. Dapper doesn’t run under parallels for some strange reason, and the Edgy beta is also having problems, so I’ll stick with Breezy for these initial tests. If it doesn’t work out, I’ll also be trying out Solaris 10 and FreeBSD.

    Currently the site is served using… Lighttpd under Ubuntu Dapper.

    Still to Come

    As with all my new releases, it’s a little rough around the edges. The backend is still pretty much a Rails scaffold affair, and I still have features to add such as…

    • Gallery, might simply be Flickr, Zoomr, or Smugmug integration, I’m undecided as yet.
    • About, Bike, Contact, Design, and Links pages.

    Side Effects

    Obviously all these changes mean that some URLs have changed.

    • All the old blog post addresses will still work, but redirect to their new equivalents.
    • The RSS feed for blog posts has also now moved to feed://douglasfshearer.dyndns.org/feeds/blog, so make sure you update your RSS readers.

    See anything wrong?

    If you see anything wrong, please don’t hesitate to get in touch: dougal.s@gmail.com

  • Why Am I Here?

    If you find yourself asking the above question, your answer may lie in one of the following two answers…

    1. You saw the title of this post, thus expected some sort of highly intelligent musings regarding the futility of life and the impossibility we might actually discover our purpose on this earth.
    2. You clicked on a link in my new fangled design and were taken here, rather than to the page or feature you were expecting. Sorry about that, I haven’t got round to getting everything to work yet. Some of it is just for show. Hopefully I should have it all fixed up by next week.
  • Blog Address Slugs

    I came across an interesting dilemma of UI and back-end design. Most blogs use an address slug similar to ‘http://url.com/year/month/day/post-title-as-slug’. Part of my design was to create this automatically from the title once the creation form has been submitted. So what happens when we edit the title of this article? Do we change the slug or not?
    If we change the slug, we lose the original address. If word has got round and many people are now linking to your post, you’ll lose all those visitors. It’s a bit like your zip code changing just because you painted your house a new colour. A solution to this would be to keep the slugs in a separate table from the blog posts, so that old slugs remain, and new ones are added. In this way old versions of a slug will still point to the now updated article. This does however involve a lot of unnecessary complication.
    If we decide not to update the slug, it will be out of date, and perhaps not tie up accurately with the title. This is a minor flaw, as it is unlikely that a title would undergo a major change. We can show the user what the slug will look like using a quick bit of javascript in the UI, and tell them that they can’t change it in the future. This seems a nice way around an otherwise complex problem, and is going to be the approach I will take. To allow the article title and slug to be changed right up to the point it is published, I won’t generate a slug until the post leaves the draft state.
    It may be nice to have the option to edit the slug manually, that’s something that could be definitely be implemented as an advanced admin feature. This is something that Dolphinling has been talking about with regards to Wordpress.

  • Graduated!

    Got an email today to say that I have done enough to graduate with a Bsc in Ordinary Sciences. While being good news, it does however mean that I have to do something for the next year, then I’ll have a go at a Masters.

    Better get on with my Blog rewrite then…

  • Share Your iTunes Library to Linux

    Some of you may remember my attempts to access or stream my iTunes music library to a linux box. I didn’t get much further with the project, especially as I didn’t really have the time.

    Now a Linux project, Amarok has produced a solution. Amarok is a music player for linux that attempts to organise your library in a similar way to iTunes. A new feature in the latest version is Rendezvous sharing, which allows it to hook up to iTunes on another machine, and access the library. Problem solved.

  • Insomnia

    I had a cup of tea at about 2300, the result of which is that I can’t get to sleep, and it’s now 0226.

    I now have a good idea of where I want to go with the Ruby on Rails blogging engine and CMS for running this site. The framework that RoR provides should make it much easier to achieve what I desire than pure PHP did. My PHP code ended up being fat and bloated, and adding any functionality became a nightmare.

    Using Rails should also solve the problem of templating, as the view code shouldn’t be as mixed with the business logic. We’ll see how it goes, but the current want list is looking like the following:-

    • Admin – Multiple users, Permissions (definitely a later iteration)
    • Posts – tagging, textile, rss feed, drafts, previewing, recycle-bin, searching.
    • Nice addresses – http://douglasfshearer.dyndns.org/2006/09/04/tagline_of_post.
    • Commenting – akismet and CAPTCHA integration a must
    • Editing – Pane to add photos in gallery into post + uploading new images.
    • Pages – just html, textile will allow me to do this where I desire.
    • Gallery – tagging, resizing/thumbnailing w. cache (similar to what my php version did), sets, photostream
    • Links – tagging, thumbnails

    This is exactly where I realise that my current blog formatting is pretty poor when it comes to lists.

  • Curse the Royal Mail!

    Yesterday I posted my phone off to my telecoms provider to have it warrantied (The joystick has gone wonky, along with the sound). This morning, the package turns up at my door! Only the Royal Mail could send a package to the address marked ‘sender’, while an address, in type almost 4 times larger, is on the opposite side! Gah!
    I’m without a phone at the moment, though it has given me the oppertunity to experience some pretty bad user interfaces on several phone brands. Now I see why Nokia, Samsung and Sony Ericsson are market leaders; their phones are easy to use.