How to Recreate your Central Administration Web

I'm sure a lot of you have done this one before:

Moved all sharepoint databases from one db server to another, probably in the process of upgrading from SQL 2005 to SQL 2008 right?  Then you realize that you have now lost your central administration site and really have no idea how to get it back so you can change the location of the databases?  Yeah…I did it this weekend too.

Luckily, you can run the following command to get your central administraiton site service running on a web front end:

stsadm.exe -o provisionservice -action start -servicetype
Microsoft.SharePoint.Administration.SPWebService -servicename

Another way of doing it is to remove the web server from the farm, then add it back, selecting the advanced option to make it host the CA web application

This made me very happy that I didn't not have to recreate my Farm simply for the lack of a front end web to change things!

Deleting Long File Paths

I was installing MacOS Leopard a few weeks ago and ended up unzipping the HFS file system DVD to my desktop.  It created a file path the likes I have never seen!  In order to get rid of it I couldn't simply click the "delete" button without getting an error about the file path.  reminded me of the times of FTP tagging!  I fould this nice articule to delete long file paths:

Hope this helps some of you!

Calculating distance between two Points – GPS

It's a crazy long algorithm, but it works…in C#:  A and B are point classes.

Math.Cos(Math.Sin((A.Latitude * Math.PI / 180)) * Math.Sin((B.Latitude * Math.PI / 180)) + Math.Cos((A.Latitude * Math.PI / 180)) * Math.Cos((B.Latitude * Math.PI / 180)) * Math.Cos(((A.Longitude – B.Longitude) * Math.PI / 180)))) * 180 / Math.PI) * 60 * 1.1515)

I use it in my platform when determining closest user and if a person is at an event.