2007/02/28

Why Jenna? Why?

Ohh what happened to Jenna Jameson? I won't usually post about things like this, but I'm just so astounded. She was one of my favorites because she was just so cute, in a real (besides the breasts) sort of way. But something went sadly wrong.

Before, the beautiful Jenna:


And now:


I believe these pictures are not much over a year apart.

For more see Hollywoodtuna.

2007/02/27

Drive A Drunk

This is a service I really think should exist. Every major city should have a "Drive a Drunk" line you can call. They will drop someone off, via cab or something, who will get in your car and drive you and it home.

You know you've been at the bar a little too late. You drank a little too much. You could either take a cab, leave your car there, and that would suck, plus you have to get it back some how. That's another cab ride back later and maybe all sorts of parking fees and our car broken into downtown. It just sucks. Or you can drive your drunk ass home. If you're lucky, you are fine, or maybe you wreck your car, get a DUI, or even kill someone. That's no good.

So, you can "Drive a Drunk". They send someone out who drives your car home with you in it. They park your car, you pay them something like cab fare plus what ever it took for them to get to where you were and back to their base. Sure, it's more than a cab, but hey, you should have taken a cab anyway, and it's better than running into a light post.

"Drive a Drunk" Someone, start this business. I will use it.

Technorati Tags:

2007/02/26

No More Feed Resets, I Hope

Now that everything is imported I shouldn't have my Atom feed reseting any more. So apologies to any of my 3 subscribers who had a bunch of old posts shoved into their feed reader.

And now I have a fancy iLike widget over on the side. That's a shameless plug by the way.

2007/02/25

HOWTO: Migrate From Textpattern to Blogger

I just migrated all my posts from Textpattern to Blogger with a bit of ruby. This should actually work for any MetaWeblog enabled blog.

First I grabbed some code from Marcus Crafter that I found after many many Google searches. Since that didn't really do what I needed, but was a really good start, I hacked it up to use the ruby-blogger client library. It saved me a TON of work. I did have to apply this small patch:
--- client.rb (revision 24)
+++ client.rb (working copy)
@@ -147,6 +147,7 @@
xmlFragment.instruct!
xmlFragment.tag!("entry","xmlns"=>"http://www.w3.org/2005/Atom","xmlns:app"=>'http://purl.org/atom/app#') do | doc |
doc.title(@title,:type=>'text')
+ doc.published(@published)
doc.content(@content,:type=>'html')
doc.tag!("author") do | author |
author.email @author_email
@@ -242,7 +243,7 @@

#if no links are specified, then return an error!
if links.nil?
- raise ArgumentError "links parameter is required!"
+ raise ArgumentError("links parameter is required!")
end

#look for the 'service.post' value
Then I ended up with this script:
#!/usr/bin/env ruby
#
# Migrate from a MetaWeblog enabled blog to blogger
#
require 'xmlrpc/client'
require 'rexml/document'
require 'rexml/xpath'
require 'time'
require 'rubygems'
require 'RedCloth'
# Checkout http://code.google.com/p/ruby-blogger/ and point to it here
require '/Users/kelp/checkouts/ruby-blogger/lib/client.rb'

# Find this in the of your blogger page source
POST_URI = 'http://www.blogger.com/feeds//posts/default'
EMAIL = 'username@gmail.com'
PASSWORD= 'password'
# What ever user name you post as on blogger
USER = 'username'
OLD_BLOG_URL = "http://example.com/"
OLD_BLOG_URI = "/rpc/"
OLD_BLOG_USER = 'username'
OLD_BLOG_PASS = 'password'
OLD_BLOG_ID = blogid
# Number of posts to migrate
POSTS = number of posts

class Blog

def initialize(host, path, username, password, blog_id = 1, port = 80)
@server = XMLRPC::Client.new(host, path, port)
@blog_id = blog_id
@username = username
@password = password
end

def posts(count = 5)
puts "Getting Posts"
@server.call('metaWeblog.getRecentPosts', @blog_id, @username, @password, count)
end

end

# These should be: old blog URL, old blog URI, old blog username, old blog password, old blog id
oldblog = Blog.new(OLD_BLOG_URL, OLD_BLOG_URI, OLD_BLOG_USER, OLD_BLOG_PASS, OLD_BLOG_ID)

# replace 135 with the number of posts you intend to migrate
oldblog.posts(POSTS).reverse.each_with_index do |post, index|
blogger_post = GData::Post.new
puts "#{index}: migrating post: #{post['title']}"
puts ""
time = post["dateCreated"].to_time
blogger_post.published = Time.parse(time.to_s).xmlschema
blogger_post.title = post["title"]
body = RedCloth.new(post["description"]).to_html
blogger_post.body = body
blogger_post.author_name = USER
blogger_post.author_email = EMAIL
GData::Client.logger.level = Logger::DEBUG
client = GData::Client.new(EMAIL,PASSWORD,{"service.post"=>POST_URI})
client.save(blogger_post)
end
Several constants have to be set at the start of the script. Then it should go through and pull the posts out of your old blog and dump them into blogger. It does assume the old blog used Textile for formating and converts every post body to html. Also it doesn't migrate any comments or post tags. Maybe I will get to that later. Thanks to this handy page, I have a nice way to syntax highlight the code.

Technorati Tags: ,

2007/02/22

Moving It All To Google Apps

I've completely moved plek.org to google services. It's all been super easy and it's working out well so far.

The only hard part was remembering how to make tinydns output the proper MX records to send all my mail to gmail. This did the trick:
@plek.org::aspmx.l.google.com.:1:1800
@plek.org::alt1.aspmx.l.google.com.:5:1800
@plek.org::alt2.aspmx.l.google.com.:5:1800
@plek.org::aspmx2.googlemail.com.:10:1800
@plek.org::aspmx3.googlemail.com.:10:1800
@plek.org::aspmx4.googlemail.com.:10:1800
@plek.org::aspmx5.googlemail.com.:10:1800
'plek.org:v=spf1 a mx include\072google.com, include\072googlemail.com ~all:3600
So far so good. I'm just waiting for tight integration with various Mac apps, Mail, Address Book, iSync, etc.

2007/02/19

Need To Write My Own Migration Scripts

I just noticed that my old blog had 135 posts, and I only have 45 here on Blogger. Something is unhappy in the migration tool I used before, and I'm not about to dig into it's Java guts to find out. I guess I get to write my own when I get around to it. At the very least I'll hack up some shell script that calls curl to do the job.

Migrated to Blogger, Mostly

Taking my queue from Carrel.org, I've spent that last several hours (or days?) trying to migrate all my posts from my old Textpattern blog to Blogger. It doesn't seem to be a common thing to do, so nothing would do it out of the box. Using the web APIs is totally the way to go, but I didn't know much about either, so I wanted to find something to do most of the work for me. I found a program called blogsync that did the job fairly well, and here we are. The only trick there was rewriting the assumed WordPress XMLRPC URL to Textattern's location.
However, a few problems remain.

  • Imported posts came with Textile rather than proper HTML.
  • URLs have all changed.
  • I should probably start writing actual content now.
  • Comments weren't migrated, not that I had many. So No big loss.
Fixing the Textile problem is the annoying one. I'm not much of a programmer and I've been sick the last week so my brain barely works. I will eventually write some quick ruby to pull each post, parse the Atom, run just the body through Redcloth's to_html filter, and then update the post. Not rocket science, but my brain is having a bit of a hard time with it.

mod_rewrite on my old server takes care of some URL problems. The main page does an external redirect here, and the old feeds redirect to Feedburner.

Just had to mix a little magic in with the rules I already had:
# Really old B2Evolution blog I used for like 2 days
RewriteRule ^xmlsrv/rss2.php$ http://feeds.feedburner.com/plek [R=permanent,L]

# Old style Textpattern feeds
RewriteCond %{QUERY_STRING} ^(rss|atom)=1
RewriteRule ^(.*) http://feeds.feedburner.com/plek [R=permanent,L]
# New style Textpattern feeds
RedirectPermanent /rss http://feeds.feedburner.com/plek
RedirectPermanent /atom http://feeds.feedburner.com/plek

# Redirect any main page access to the new site
RewriteRule ^$ http://blog.plek.org/ [R,L]

# Keep old Textpattern direct links working
RewriteRule ^(.*) index.php
mod_rewrite really makes my head hurt. I always have to refigure out it's magic. The last problem is all my old URLs won't redirect unless I figure out some real magic since Blogger likes ulrs as 2007/02/article-name and Textpattern did 2007/02/19/article-name. I could do some more rewrite magic, but that stuff just hurts. For now I will just keep the old stuff running for those 3 hits a year it gets.

Technorati Tags:

2007/02/18

Airbus A380 Engine Blade Destruction Test

All the destructive tests they do on new air planes are so cool!

Via Jeremy Zawodny:

One of the design goals on the Airbus A380 engine is that the engine housing protect the aircraft (and its passengers) from harm if one of the fan blades breaks off. In the A380 Blade Off Test video, you get to see how it's done.


Technorati Tags:

Blogger plus Adsense plus Analytics equals pretty cool

It's pretty handy how I can get Adsense and Analytics all working where without much more than a few clicks. I wish I could do all those things on LiveJournal.

Now the next trick is for content. I'll need some.

2007/02/17

Naomi Wolf's Porn Myth

It's a few years old but I recently stumbled upon The Porn Myth by Naomi Wolf and she has some valid points there, but maybe not the whole picture. It does make sense that our ready access to limitless porn is leaving us jaded with stupidly high expectations, but I wonder if that's not the only reason men in America may be losing interest in real Women. It's funny that as we do paint and ever harder to attain standard, the reality is getting worse. People are getting fatter. Just spend a bit of time in a suburban shopping mall. It's amazing, in this horrible way. People are HUGE. No wonder many people would rather go the porn route. Still, I think the jaded argument does make sense.