Tuesday, September 23, 2008

Ubiquity Command: urlencode

I just hacked up this quick Ubiquity command because I was cuttin' and pastin' URLs all over the place, and I needed some of them url encoded...

Ubiquity, by the way, is totally sweet.

Run "command editor" and paste the block of Javascript below somewhere in the text field.

That's all you need to do. It auto-saves.


CmdUtils.CreateCommand({
name: "urlencode",
takes: {"what": noun_arb_text},
preview: function(pblock, what) { pblock.innerHTML = CmdUtils.renderTemplate(escape(what.text)) },
execute: function(what) { CmdUtils.setSelection(escape(what.text)); }

Wednesday, September 17, 2008

Jaiku: still in beta. I blame GAE.

(this is a rambling rant about Jaiku and Google App Engine.)
(I'm probably totally, totally wrong.)
(but I like to hear myself talk.)
(er, type.)

If you've heard of Twitter, you've probably heard of Jaiku at some point in your life, then immediately forgot about it when you realized it was invite-only. Or maybe you did some begging for invites, then tried to invite your friends on to the service, only to realize you didn't have enough invites for them all.

Or maybe you were like me and just said, "fuck it, I'm not begging for invites."

Whatever.

Anyway, something -- I'm not sure what it was -- brought Jaiku to my attention again. This is the fourth time it's caught my eye: the first time was when it was announced as a serious, but closed, competitor to Twitter. The second time was when Google bought it, and the world was a twitter with sugary dreams of sweet sweet integration. That, of course, failed to happen, which was a major disappointment. The third time was... fuck, months ago, I think, when they announced their move over to Google App Engine. I'm sure your first thought on hearing that was, "finally, in a few months we'll see how Jaiku does in The Real World."

That, much to your overwhelming surprise I'm sure, also failed to happen.

Jaiku's development team just finished up the port to Google App Engine a month or two ago, according to an official blog post. Well, team? Maybe it's just one guy working really long hours: the public perception of Jaiku's slow development + lack of blog updates makes me wonder if any one person is at the helm of that bad boy, much less a team.

Anyway.

To celebrate this momentous occasion, they... uncapped invites.

Yes.

They uncapped invites. So now you can invite all your friends!

But you can't sign up for an account by your lonesome.

So, I'm going to hit you with a big WTF now: is GAE not scalable?

They did about 6-8 months of development porting Jaiku over to Google App Engine, and yet they're clearly not quite ready to unleash this thing on The Public At Large. Why not? What's the missing piece of the puzzle? Scalability? Wasn't Google App engine built for scalability?

I won't say that Compete is the Definitive Source for information, but take a look at this:



The numbers (you'll see'em if you click through the image) are:

jaiku.com: 98,106
appspot.com: 182,747

I'm going to move with the assumption that Jaiku is the single biggest GAE user. It's convienent for me to do so. (Am I wrong? Man, who knows. I think it's a safe assumption to make, but if you know otherwise let me know.)

So, looking at those paltry numbers (I'd have put Twitter on there, but it TOTALLY fucks up the graph) I have to ask, can GAE scale? I'm really grasping for a reason as to why Jaiku hasn't finally opened its doors for one and all yet. If you mention Jaiku you will inevitably be hit with a deluge of comments in the form of: "goddamn it, it's been X-months/years and they haven't added a single feature / fixed this outstanding bug / stopped sucking!" I think it's reasonable to extrapulate from that either they're "done" with the user experience, for now, or that it's hit the point of "good enough" and at the moment they're not really interested in fucking with it. I mean, it's not really reasonable, but I'm saying it is because I don't want to have to add a bunch of conditionals to every fucking sentance I make here.

They've been bought by Google. They've moved to Google technologies. They're ready, right? Why aren't they opening their doors and screaming "COME GET SOME!" to the Internet at large? Getting ready for a marketing push, maybe? Preparing some ninja-style corporate espionage against Twitter?

Or is the ultimate answer something much simpler? Maybe moving Jaiku over to Google App Engine -- the database-like bits of it, specifically -- has surfaced some critical flaws. Knowing this, they can't just throw open the doors, because the moment they do there will be the usual flood of users going, "Google product? Must have!" It'd be total embarrassment for Google to have the same kind of uptime problems Twitter suffered, you know, what with them being the mighty infallible Google and all.

Saying that GAE can't scale for Jaiku seems like a bit of a stretch, but the architecture of a messaging system (Twitter-like microblogging, etc) is very different from the architecture of a standard website; if you've been following the finally resolved up-and-down saga of Twitter then you're sure to know that by now. Different strokes, different folks, or something punny like that.

Now, we all know that Google's BigTable database (the same database that powers GAE sites) can scale, otherwise Google wouldn't exist as we know it. It scales quite nicely, actually, for it's problem domain. But does it scale well for Jaiku's problem domain: messaging?

Short version: Did Google try to shove the square peg into the round circle and leverage BigTable in a way that can't scale gracefully for Jaiku's messaging needs?

Well, I just got bored writing this, so now's a good time to kill this post:

KUNG-FU CHOP OF DEATH!

Sidenote: Blogger's rich editor totally blows. Someone replace this thing, STAT.

Friday, September 12, 2008

Capistrano + Git: fatal: 'origin': unable to chdir or not a git archive

Getting that error?

Short answer: you fucked up, then Capistrano fucked up right behind you.

SSH into your deploy target, go into shared, and then frag the shared_cache directory.

Then, cap deploy:cold.

Why?

It normally happens when you try to set your repository as a local filesystem path. Capistrano populates shared_cache with an empty Git repo, and then tries to pull in your repository, which it can't reach... but it doesn't frag shared_cache, so the next time Capistrano looks, it's there, and goes, "Hey, we've already built the repository cache, let's just call git fetch and update it!"

Good luck.

Capistrano + Git: Host key verification failed.

Getting 'Host Key verification' failed when you're trying to do this? You might be trying to deploy source in a Git repo, and the Git repo is accessed via SSH.

cap deploy:cold


Do this: ssh into your target machine (the one codes getting deployed on), and then ssh into the Git repo machine -- or just do a 'git clone' if that's not possible. Accept the key, and then you're golden.

Deploying Git over SSH (username, password) with Capistrano

This one bit me.

Hard.

If your Git repo is accessed via SSH using a username and password instead of a public key, you're probably having problems getting it to work. Notably, the password prompt isn't prompting you for your goddamn password.

Do this in your deploy file:

default_run_options[:pty] = true
set :scm_password, Proc.new { Capistrano::CLI.password_prompt "SCM Password: "}


Using Capistrano 2.5.

default_run_topions[:pty] will fuck up your output, but it's necessary for reasons I don't fully grasp and after about 3 hours don't care to.