cloud.net

Monday, December 31, 2007

Online Open Port Check Tool

CanYouSeeMe.org - Open Port Check Tool. This is really useful for both security and usability (P2P). http://www.canyouseeme.org/

Friday, November 16, 2007

How to ruin a beautiful sunny Sunday


Sunday 23rd of September.
Beautiful sunny day. Get a call from a friend telling me “It’s on”, it’s on means it’s a good day to fly @ Stanwell Park (NSW, Australia). Get in the car drive the 60kms, unpack my glider take to the air.
Life is good... had a couple of flights, then the wind starts going north. Can’t fly Stanwell in Northerlies. Wind picks up and a bunch of us decide to go to “The World’s Greatest/Hill 60”... cool I’ve never flown there sounded OK. Drive down to Port Kembla.
Hill 60 looked a little dangerous. Wind had now picked up quite a bit. Saw a guy being dragged, so I decided to give it a mis. Couple of them started going to "The World’s Greatest". The World’s Greatest is a flat beach soaring site. There's a rock shelf, some sand and shrubbs.
People in the air seemed to be having fun. It was pretty windy now. The people I drove down wind wanted to do some ground handling in a park behind, so I could either watch or fly... I decided to fly.
It was windy 17-19kt, so I had to be careful launching. It needed to be windy to fly this site as there is very little elevation (2m). My main concern was launching safely, and this is where I made the first mistake that eventually lead to the disaster I'm going to describe shortly.
The very first thing I should have done was examin the terrain and look at my options if conditions changed, and mapped out my flight plan in my head. All I did was decide to go right after launching.
Above you have the site. The red line represents my flight path, the blue lines represent areas of lift and the big arrow represents the wind direction. As you can see from the above image I didn't really get in to lift. What you can't see is there's cliff wall (3m high) towards the end where I turn around. I turned around (mistake) because I didn't know what was around the corner, and I thought it best to try and get back to lift and sand. My options for landing were very limited, turn in to wind and risk going in the water. When I turned around I had the wind to my back, so my ground speed was +/- glider speed (38kmh) + wind speed (33kmh). On the beach there are large bolders 10-70 litres in volume. My harness/bum engaged one of those bolders, and the resulting impact fractured my back in 3 places; L2 severely fractured on all 3 columns, T4 and T5 fractured anterially, ribs 7 fractured on both sides.
Here's some CT scans. Pre Op Left to Right CT Scan

Pre Op Front to Back CT Scan

Pre Op Top to Bottom CT Scan

Post Op Front to Back CT Scan TPS (I'm not sure if I'll beep at the airport!)

Post Op Top to Down CT Scan TPS

FAQ

1.- How do I feel now?
A: Bad; but hey shit happens and life goes on.
Update 2010-10-10: Yup it still hurts. I get cramps. I can't feel my right foot properly.

2.- Do I beep when I go through metal detectors?
A: Haven't gone through any yet.
Update 2008-5-6: I don't beep.
Update 2010-10-10: Sometimes I beep sometimes I don't, depends on the detector.

3.- You going to fly again?
A: Yes, shit doesn't always happen.
Update 2010-10-10: Haven't flown much (just 2 times)... I get scared.


4.- Don't you think paragliding is dangerous?
A: Yes, but not as dangerous as drinking Tequila.

Friday, August 31, 2007

Recursive batch delete command

We all know the scenario: we have a list with a large number of junk testing records we need to get rid of.
We could write a console app with the following:
SPListItemCollection listItems = list.Items;
for (int id = 8; id <= listItems.Count; id++)
{
 try {
  listItems[id].Delete();
  Console.WriteLine("Deleting " + id.ToString());
 }
 catch(Exception ex){ }
} 
list.Update();

Now sit back and watch the numbers tick by... or you could what is widely considered the fastest way in SharePoint (WSS) to perform the operation, to use 'ProcessBatchData' as it avoids the Object Model and is considerably faster.
Here is some example code which will remove items from a SharePoint list.
StringBuilder oSBDelBat = new StringBuilder();
oSBDelBat.Append("<?xml version=\"1.0\" encoding=\"UTF-8\"?><batch>");
foreach (SPListItem item in CurrentList.Items)
{
 oSBDelBat.Append("<method>");
 oSBDelBat.Append("<setlist scope="\">" + CurrentList.ID + "</setlist>");
 oSBDelBat.Append("<setvar name="\">" + Convert.ToString(item.ID) + "</setvar>");
 oSBDelBat.Append("<setvar name="\">Delete</setvar>");
 oSBDelBat.Append("</method>");
}
oSBDelBat.Append("</batch>");
try
{
 SPContext.Current.Site.RootWeb.ProcessBatchData(oSBDelBat.ToString());
}
catch (Exception ex)
{
 Console.WriteLine("Delete failed: " + ex.Message);
 throw;
}

Tuesday, August 28, 2007

Deploying a dll to the GAC and recycling the application pool

When developing a sharepoint dll in Visual Studio 2005 the quickest way to deploy and test your dll is to automate it with a post build event.

How do we do this?
1.- Open the properties window for your project... solution explorer> right click project name > select properties.
2.- Click "Build Events".
3.- Paste
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\gacutil" -i "$(TargetPath)" } C:\Recycle.vbs
in to the "Post-build event command line" field.
4.- Create a new text file with the following script:
strAppPoolName = "Sharepoint - 80"
strComputer = "."
Set objWMIService = GetObject("winmgmts:{authenticationLevel=pktPrivacy}\\"& strComputer & "\root\microsoftiisv2")
Set colItems = objWMIService.ExecQuery("Select * From IIsApplicationPool Where Name = 'W3SVC/AppPools/" & strAppPoolName & "'")
For Each objItem in colItems
    objItem.Recycle
Next
Wscript.echo "Recycle Completed"
5.- Save as C:\Recycle.vbs

Tuesday, July 31, 2007

Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561

A Web part/InfoPath form with managed code causes the above error.

Cause: DLL's that access databases require at least the WSS_Medium security policy in the web.config file. If you receive a security message from the web part, it's usually the trust element in the web.config file.
You could also have a dll outside the GAC that's trying to access some part of the SharePoint Object Model.
Fix: There's a couple of ways to resolve this issue.
  1. Put you dll in the GAC. I don't like putting limited use web parts in there and managed code for InfoPath doesn't like it.
  2. Open wss_mediumtrust.config & wss_minimaltrust.config usually (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\12\config\) look in your web.config file for the exact path.
    Find in wss_mediumtrust.config:
    <SecurityClass Name="SqlClientPermission" Description="System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
    Copy and paste it in to the <SecurityClasses> node of wss_minimaltrust.config.
    In the PermissionSet section of this configuration file, add the following: Find in wss_mediumtrust.config: <IPermission class="SqlClientPermission" version="1" Unrestricted="true"/>
    Copy and paste it in to the a <PermissionSet> node of wss_minimaltrust.config. That about covers it.
  3. You could also set the trust level to "wss_mediumtrust" or create a custom trust level. Google it...