Another reason I like SVK

April 16, 2008 at 02:47 PM | DrProject, Work | View Comments

I got a fairly significant patch to DrProject today. I wanted to show it to the other developers so they could give it a look over. How'd I do it?

Permalink + Comments

SSH and HTTPS on the same port?!

April 11, 2008 at 05:38 PM | Python, Play | View Comments

A friend of mine was over the other night, and we were talking about how much we like running SSH on port 443. It gets you around all but the most insane firewalls, and to anyone but the keenest of observers it just looks like HTTPS traffic.

But running SSH over port 443 makes it particularly difficult to run a secure web server as well.

So what can be done?

Well, it turns out that when an SSH client initiates a connection, it waits for the server to send a banner (SSH-1.99-OpenSSH_4.7, for example) before beginning the secure negotiation. Browsers, on the other hand, just go right ahead and begin the secure negotiation.

Knowing this, it didn't take long to formulate a plan: write a little program which will listen on 443. When it gets a connection, it figures out if the remote end is trying to speak SSH or HTTPS, makes the appropriate connection on the local end, the passes the data between the two.

It only took a couple of hours to write a small proof-of-concept... And, believe it or not, it even works! Disclaimer: this particular implementation is not quite suitable for any real use.

Anyway, this may not be the most efficient way of doing things... But that's no matter. It's still neat :-)


Permalink + Comments

How SVK has made my life happy

April 04, 2008 at 03:40 PM | Work | View Comments

SVK, despite some of it's shortcomings, has proved worthy of my use in the last couple of days. Here is a quick script which shows how I've been using it, and how it's rocked the pants off of SVN:

red = commands with SVN
blue = equivalent SVK commands
green = comment

# Mirror the DrP repository to //dpr
$ # No equivilent
$ svk mirror //drp/

# Create the tags branch
$ svn cp \
$ svk cp //drp/trunk //drp/branches/tags

# Check out the branch
$ svn co Tags
$ svk co //drp/branches/tags Tags

# Some changes are made to the tags branch

# Checkin those changes
$ svn ci -m "Made some changes to tags branch"
$ svk ci -m "Made some changes to tags branch"
# In this case, SVK is not being used in decentralized
# mode, so the changes will be pushed upstream to the
# SVN repository, just like the svn commit does.

# Changes have also been made to trunk.
# Time to merge those changes in.

# First, a merge with SVN:
$ svn log --stop-on-copy
# Look for either the last revision which trunk was merged
# You can't always use the base revision, otherwise conflicts
# may ensue.
$ svn merge -r $REV:HEAD .
# Hope that there are no trivial conflicts to sort out,
# then test and commit the merge. 
$ svn ci -m "Merged trunk into tags."

# And now, exactly the same operation with SVK:
$ svk pull
# ... changes are merged ...

I don't think I need to say any more :-)

(Yes, I realize that there are tools like which make SVN merges less painful... But that's one extra command to run. And you've still got those stinking .svn directories everywhere.)

[edit] Fixed up the coloring so it may work a little bit better, and my stylesheet doesn't destroy the layout of the comments section. [/edit]

Permalink + Comments