Thursday, April 30, 2009

Resolving Cannot generate SSPI context.

While there are some pretty complete explanations regarding this error (see links below), if you're looking for a post that forgoes the lengthy explanations and just gets to the good bits ...

You are out of luck on this one :)

That being said, I know that I would have benefited from someone mentioning some of the more basic places to look. In my team's case, the SQL Server account that our web app was using had the password expire on us. When we set up the account we inadvertently neglected to check off the bit about having the password never expire. In a production environment that's probably a good thing. But this is our test server.

Here are those helpful links I mentioned earlier:
How to troubleshoot the "Cannot generate SSPI context" error message
Cannot generate SSPI context” error message, when connect to local SQL Server outside domain

Friday, April 24, 2009

Filter Lists With JQuery

Here's a little snippet that will filter a list as the user types as well as bold the search expression within the list.


$("#searchMyProjects").keyup(function() {
var filter = $(this).val(), count = 0;
$("span.projectSelectionName").each(function() {
if ($(this).text().search(new RegExp(filter, "i")) < 0) {
$(this).parent().parent().hide();
$(this).hide();
} else {
$(this).parent().parent().show();
$(this).html($(this).text().replace(new RegExp(filter, "i"), "<b>" + filter + "</b>"));
$(this).show();
count++;
}
});
$("#filterCount").text(count);
});


The filter expression s updated with <b> tags to highlight the search expression within the text. You can use whatever styling you want, of course.

Enjoy.

Monday, April 20, 2009

Upgrading A Subversion Repository

I recently had to move several Subversion repositories from one server to another. Normally, this isn't a big deal, but these repositories were using an old version of Subversion (1.4.something) and had to be upgraded to 1.6.1 which was an entirely different file format. I was able to find the following documentation which fortunately made the process very simple. The following is taken from the Collabnet site. I actually only needed steps 1 and 2. Hope this helps.

HOW TO UPGRADE/DOWNGRADE YOUR REPOSITORY:
----------------------------------------

1. Use an 'svnadmin' binary from a release with the same schema version
as your repository to create a dumpfile of your repository:

$ mv myrepos old-repos
$ svnadmin dump old-repos > dumpfile

2. Use an 'svnadmin' binary from a release with the same schema version
as you want your repository to have to load the dumpfile into a new
repository:

$ svnadmin create myrepos
$ svnadmin load myrepos < dumpfile

OR, if you're feeling saucy, you can do it all at once with a pipe:

$ svnadmin-new create myrepos
$ svnadmin-old dump old-repos | svnadmin-new load myrepos

(If you are running at least version 1.4 and would like to make a
format 3 repository, pass the --pre-1.4-compatible flag to
"svnadmin create".)

3. [OPTIONAL] Loading a dumpfile is both time- and disk-consuming,
as it replays every commit. If your new repository is a BDB
respository, then after the load is complete, you may want to
free up some disk space by removing unused BerkeleyDB logfiles:

$ svnadmin list-unused-dblogs newrepos | xargs rm

Note: If you're using BerkeleyDB 4.2 or newer this will be done
automatically for you, unless you've configured the repository
not to behave this way.

4. Don't forget to copy over any hook scripts (and DB_CONFIG for BDB
repositories, if you changed it) from the old to the new
repository:

$ cp old-repos/hooks/* repos/hooks/
$ cp old-repos/db/DB_CONFIG repos/db/

Monday, April 13, 2009

Setting Up a Subversion Server With Port Forwarding

Requirements: VisualSVN Server

Setting up a Subversion repository, like anything else, is really easy if you know how to do it. Fortunately, VisualSVN Server handles most of the painful stuff that used to have to be done manually. Now it's as simple as installing and setting up your router.

So first, install VisualSVN Server. It comes with it's own set of instructions that are very easy to follow.

Next, open up the admin console to your router and find the section that handles port forwarding. VisualSVN Server gives you the option of using either port 8080 or 8443 for a secure connection. I'd recommend going the secure route, just because. Enter the ip address of the machine on which VisualSVN Server is installed and enter 8443 as the start and end for the ip range. If needed, enter HTTPS as the service type.

That's it. Done. So now you should be able to access your repository from the internet using https://[router_ip_address]:8443/svn/. So let's say your router's ip address is 79.168.199.4 and you have a repository called MyCoolStuff. The url to your repository (from outside your network) would be https://79.168.199.4:8443/svn/MyCoolStuff.