Pockets of Blue

musings of my mind

Category: Weblogs

Dude, what happened?

If you’ve been here before, you’ve surely noticed that things look a bit different. Well, it’s been a long time coming, but I’m finally changing the blog’s theme to make it a) look better and b) more readable and usable. The old theme was a bit stale and I had gotten a few complaints, so here ya go. There have been numerous changes behind the scenes, too:

I upgraded from Typo 4.0.1 to 5.4.3. This is a major update. The entire back-end has changed (drastically for the better!), and things work as never before. Funny how you can get used to and just accept a crap version of something. Perhaps this will entice me to post a bit more, since the UI has gotten quite slick.

Now for the nitty-gritty details of upgrading. Don’t bother continuing unless you’re interested in upgrading Typo on a shared hosting service (in my case, Dreamhost). I ran into a few roadblocks along the way, piecing the steps together from numerous sources:

  1. First, I went to the typo upgrade site to get things going. These directions aren’t very good, so I’ll elaborate.
  2. I have gems installed on my account (~/.gems), since mine is a shared account and I like to have control over the software being run there. I simply ran

    gem update -i ~/.gems typo

    to update the gems in my account. Pretty simple.

  3. The next step was to actually install the updated Typo gem into my existing installation:

    ~/.gems/bin/typo install ~/blog_home

    which is where the troubles began. Turns out that the ‘install’ gem tries to back up your entire weblog database into a .yml file. Well, if you have a decent-sized blog, this is going to take a lot of time, and consume a whole lot of CPU and memory resources. Dreamhost kept killing the backup process for that very reason (as this guy experienced, too) which was frustrating. I contacted someone via online chat (which has been quite helpful recently) and got some tech guy on the other end who temporarily turned off the kill process for my account. Well, the backup still took forever, with dire warnings from him periodically (99% CPU. 800MB RAM. How long is this going to take? Uhh…just a couple minutes..)

  4. If the previous command causes these types of problems, I’d suggest backing up your blog database manually via mysqldump, phpmysql, or some other utility. Then disable the auto-backup by hacking the rails install gem ($GEM_HOME/gems/rails-app-installer-0.2.0/lib/rails-installer.rb) and commenting out the ‘backup_database’ step in the install_sequence function:

    #backup_database

  5. Now re-run the command in step 3. This got much further for me, but failed again during the schema migration when Dreamhost killed the process again. The simple workaround here was to run the migration manually from the rails home directory via rake:

    rake RAILS_ENV=production db:migrate

  6. And finally, re-run step 3. This completed successfully for me; however, navigating to my blog again was less than successful, giving the dreaded 500 Rails Application Error. Now, Passenger to the rescue:

  7. Create the file $RAILS_HOME/tmp/restart.txt. Passenger watches this file and restarts when it is touched. This is quite handy for debugging. Now go into config/environment.rb and add these lines beneath the #bootstrap require line:

    if ENV['RAILS_ENV'] == 'production'  # don't bother on dev
      ENV['GEM_PATH'] = '/home/USERNAME/.gems' + ':/usr/lib/ruby/gems/1.8'
      Gem.clear_paths
    end
    
  8. This tells Passenger to use the gems in your local account first. Now touch the restart.txt file and you should be good to go!

Typepad -> Typo Migration

A few weeks ago I finally finished a long-standing project: converting all my photos on Typepad over to my personal photos site. When I first looked at converting my old blog to this one, I figured I’d be able to automate it all using existing tools. Well, not quite. It took some customization of an existing script to load a Typepad blog export into this blog’s Typo database. I have some Ruby and Rails experience so this was just a matter of learning Typo’s Rails model; your mileage may vary.

That was the easy part though. Next up was photos. Unfortunately, Typepad doesn’t have any photo export service. Perhaps this is due to a lack of standardization, but I ended up coming up with my own crude data format as well as a ruby script for exporting the photos, titles and captions. It uses a Ruby Web Application Testing API to actually click through a browser and download the relevant data. Basically it’s like having a robot sit at your computer and perform thousands of mundane copy/paste/download operations in a browser.

In order to run it, you will need to install Ruby and Watir.
Chances are, you’ll probably need to know a bit of Ruby, too, but I tried to design it so it’s self explanatory. Hopefully it’s just a matter of installing those packages and running the script.

The previous script simply downloads all those photos/titles/captions to your computer. Now how do you load them into your new, preferred online photo organizer? Well, that depends. If you’re using Gallery, you can use my script! Actually, you’ll still have to create the albums and upload the photos manually, but hopefully that’s not too painful a process. I had about 20 to move and it wasn’t all that bad, even for me, and I DESPISE repetitive, mundane computing operations. Why be a robot when you can build your own robot?

However, manually re-adding all those photo titles and captions would surely drive you to insanity, so just run this script instead. Even if you’re not using Gallery the code will be a good first step towards importing the data into your photo service of choice. Happy converting!

Blogging about blogs about blogging

Blog.  I’m quickly growing tired of the term.  It’s kind of like "hot" in pop culture ("omg that’s soooooo hot") or "stress" of the 90s ("dude, stop stressin’ it").  In reality it’s just a "hip" way of saying web-log, or web-journal, or the space you can rant about whatever you want to the entire world. 

Over the past few days I’ve learned quite a few things about blogs in general (through a former RIT student’s new company that I just happened to stumble upon via Google), as well as my own audience for this blog.  I’m proud to say that I didn’t learn a thing from the aformentioned site’s "writing for the web" article (guess I’m just a natural), but his views on human interfaces and the world of blogging were quite interesting.  Also, I had thought that my audience was almost entirely family, but in reality it’s only a part.  This was due to the large proportion of comments coming from family rather than friends.  After all, comments are my only form of direct feedback relating to the blog, so through them I perceive my audience.  Tell me what you think!

I should mention that TypePad keeps fairly detailed statistics on the traffic coming to the site (including referrers), so I have a fairly good idea of the volume of visitors I get to the blog and related photo albums.  However, it’s impossible to tell exactly who has been frequenting this site, so all you freaky voyeurs out there are safe (well for now, until I install an automated IP-address identification tool…hahaha, kidding…I’m not that vain).

All in all, though, I am pleased with the traffic and positive feedback, and am very glad I started this site in the first place.  But we all know communication is a two-sided activity, and each party motivates the other…so don’t be afraid to drop a line.

Blog bliggity blog blog bloggity bliggity blogg!

© 2024 Pockets of Blue

Theme by Anders NorenUp ↑