Javier's Blog

Mostly computers and other tech stuff,...

Sunday, September 17, 2006

SVN Automatic login under windows: Putty & TortoiseSVN

Digg!TortoiseSVN is the best SVN client I've been able to find for Windows, at first glance, however, it might seem a bit annoying because it asks for your password for just about every operation.

In order to get rid of this annoying password popup, all we need to do is generate a public/private key using Putty and install your public key in your server. This of course assumes that you are running a SSH on your server and have already setup your SVN repository.

We can generate a private/public key using Putty's Key Generator, the defaults should suffice, first generate the keys then save the private and public key. The public key will also display on the top square of Putty's keygen, copy this key in it's entirety and paste it into your server's ~/.ssh/authorized_keys2 file.

We can now test this by initializing Putty's SSH client and configuring it to use the private key we generated. Under 'Connection > SSH > Auth' we will see an authentication parameters dialog with a field called 'Private key file for Authentication', use the browse button to find your private key file. This tells Putty to use this key to authenticate with the server, under 'Connection > Data' enter in your username under 'Auto-login username'. Go back to 'Session' enter in your server address under 'Host Name' and save your session with a useful name, think of something more descriptive than 'mysession'. Click on the Open button you should be automagically logged-in.

Next step is to setup SVN_SSH environment variable, right click on 'My Computer' and go to properties, 'Advanced > Environment Variables', under 'System Variables', click on new and enter SVN_SSH for the variable name and 'C:\\Program Files\\TortoiseSVN\\bin\\TortoisePlink.exe' for the variable value, make sure the path is correct and using the double back lashes (\\).

Now click on your 'Desktop > TortoiseSVN > Repo-browser', the URL should look something like this svn+ssh://mysession/path/to/svn/repo. There are a few parts to note here, we are asking for SVN over SSH (svn+ssh), we are using the session name you saved under Putty's 'Saved Sessions' dialog, and the full path to the svn repository.


Friday, September 15, 2006


Did you know that the Web2.0 (cough, buzz word) is here? Sure, and it's even more tangible with script.aculo.us, there just nothing better around. I recently impressed everyone at work by integrating script.aculo.us into our Java/Struts (I know) application and gave it some awesome eye candy. Here's a quick couple of examples!

Click here to see some magic!

Click on this square

Monday, September 11, 2006

1st Dive into Python

Getting the links out of an html document using python's built in regular expressions:

from urllib import urlopen
import re

def links(url):
socket = urlopen(url)
html = re.sub('\n', '', socket.read())
return re.findall('< a href="(.*?)">.*?< /a>', html, re.IGNORECASE)

The regular expression might not show up as intended!
Remove the space between the less/greater-than sign and the a.

Thursday, September 07, 2006

1st Dive into Ruby

So here's a bit of code that demonstrates how to download a web page:

require 'net/http'
require 'html-parser'

url = URI.parse('http://www.sdsu.edu/')
req = Net::HTTP::Get.new(url.path)
res = Net::HTTP.start(url.host, url.port) {|http|http.request(req)}

puts res.body

Any suggestions on how to get just the links or any tag in particular?

First post, w00t!