the .NET Framework sourcecode release and how to unpack it…

It’s great to finally have the .NET sourcecode for debugging purposes – inconveniently it’s in a format you might have your difficulties just browsing along. A little tool is here to help!

After you installed, let’s say the WCF sourcecode and debug symbols you get a directory structure similar to this:

wcfsource

This source.zip.tmp file holds the whole sourcecode as one big package. It can’t be unpacked – even one would suggest that by just looking at that .zip ending in the name of the file.

Instead this is a plain-text file of a certain yet simple format. I wrote me a little tool to unpack this file into it’s original files and directories.

You can get the little tool, including sourcecode, here: UnpackMSSources.zip

To start the magic, you would like to go to the command line and start the tool with two parameters. Parameter 1 is the path and filename of the source.zip.tmp file. Parameter 2 is the part of the Path that needs to be cut-off. For the WCF Sources it’s “/DEVDIV/depot/DevDiv/releases/Orcas/SP/ndp/cdf/src/” for example.

The tool will then start to whirl through the file and extract all the files it founds into directories it’s creating along the way. After some seconds you would end with a directory tree like this:

unpacked

Have fun!

Source 1: http://referencesource.microsoft.com/netframework.aspx
Source 2: http://www.schrankmonster.de/content/binary/UnpackMSSources.zip

Plain-Text Username Password Authentification with WCF

If you got it, it’s easy. If you’re starting from scratch it ain’t as easy. We were in need of such a Username+Password Authentification so I started googling around.

I found several articles but had to mash it all together in a trial-and-error session. Now that I am enlightened I want to share my knowledge:

Step 1: Implement an UserNamePasswordValidator class and override the Validate method.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IdentityModel.Tokens;
using System.IdentityModel.Selectors;

namespace sones.Pandora.Database.Hosting
{
    public class UserNamePasswordAuthentification: UserNamePasswordValidator
    {

        public override void Validate(string userName, string password)
        {
            if ((userName != "Username") || (password != "Password"))
            {
                throw new SecurityTokenException("Validation Failed!");
            }
        }
    }
}

Step 2: Edit the App.config file to enable the previously implemented UsernamePasswordValidator.

    <bindings>
      <basicHttpBinding>
        <binding name="CustomAuthentication">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Basic" proxyCredentialType="Basic"/>
          security>
        binding>
      basicHttpBinding>
    bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="SecurityBehavior">
          <serviceCredentials>
            <userNameAuthentication
            userNamePasswordValidationMode="Custom"
            customUserNamePasswordValidatorType="sones.Pandora.Database.Hosting.UserNamePasswordAuthentification, PandoraDB_WebServiceHost_UsernamePasswordAuth"/>
          serviceCredentials>
        behavior>
      serviceBehaviors>
    behaviors>
    <services>
      <service behaviorConfiguration="SecurityBehavior" name="sones.Pandora.Database.Hosting.PandoraDatabaseHost">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="CustomAuthentication"
          name="ep1" contract="sones.Pandora.Database.Hosting.IPandoraDatabaseHost" />
      service>
    services>

In this example the ServiceHost will use no server SSL certificate and therefor allow normal http access instead of just using https ssl. You can configure that behavior with the <security mode=”TransportCredentialOnly”> line. Just change there and define an apropriate certificate and you’re good to go with https / ssl.

Zed-4

Uhh what a day! We had the opportunity to test drive a brand new BMW Z4 sDrive23i. This straight-6 engine is just phenomenal. Even this smallest 204 hp version feels and sounds like a roadster should sound and feel.

We almost emptied a complete fuel tank on about than 350 km of road today – which means we had that much fun. Maybe when we buy one in the future it should have a bit more horsepower.

We even made some pictures:

IMG_6832

IMG_6850

IMG_6874

thanks to our dealership: BMW Autohaus Poerlitz

Allowing Web Service host to run locally without Administrator rights

If you’re writing WCF Web Services you maybe came to the point when you needed Administrator rights to start the Web ServiceHost. As a matter of fact the only thing you need is the right to use a that URL space.

So for  a WCF Web Service running on http://localhost:80/TestService/Ep2 you would use the netsh command line tool to set the correct rights.

Step 1: Start an Administrator-Commandline

Step 2: run “netsh http add urlacl url=http://+80/TestService/Ep2 user=SONES\bietiekay

(SONES\bietiekay = the Domain+User to grant the right)

netsh

Hail Eris! All Hail Discordia!

pope

I was in desperate need for an DDate equivalent running on Windows. DDate is an unix implementaion of date accoridng to the erisian calendar described in the principia discordia.

I only found some C Implementations. And since it’s fun to do I ported the original Discordian Date C code to C#.

You can download the C# sourcecode, licensed under CC-BY-NC here.

I also created a web page which displays the current discordian date and offers you to convert any gregorian date into discordian date representation.

This page can be accesses here. You can call another page with parameters and you only will get the ddate output back:

for example: http://ddate.schrankmonster.de/DiscordianDate.aspx?year=2009&month=6&day=9

Source 1: http://ddate.schrankmonster.de/
Source 2: http://dropbox.schrankmonster.de/dropped/SharpDDateLib.zip

farewell Songbird

sonb

After not less than 3 and a half hour Songbird finished with importing the iTunes library I am using for about 6 years.

The first impression is: Cool, it’s got plugins!

The second impression is: Booh, it wants to restart (while stopping the music) to install!

It’s not faster than iTunes. And this is a sad thing, because the only thing I hoped it would be was faster. It’s not – the UI it’s as fast and responsive as iTunes’ UI – at best. With just a few clicks the whole songbird window went into sleep mode and the well known beachball came into the play.

Even worse: for some strange reason Songbird consumes considerably more CPU time while just sitting there and playing an MP3 than iTunes does:

songbirdcpu

18,7% CPU load used by songbird just by playing an mp3 (no filtering, no visualisation, no nothing)

itunescpu

2,3% CPU load for iTunes while doing exactly the same. Even the same mp3 was played.

iTunes even takes less memory… oh dear: A long way to go for the Songbird team.

taking Songbird for a spin (again)

Since my last Songbird experiences were not that great I thought it would be a great idea to take the newly released 1.2 version of Songbird for a spin.

It’s said that the new version is faster and more stable. I installed 3 hours ago and I still cannot use it since it’s syncing with iTunes ever since.

songbird

More on that topic when songbird is ready….

Source: http://getsongbird.com/

Google Copy-Wave

Oh dear. Another hyped protocol/platform from Google… oh wait. It’s not from Google. It’ all started in Xerox PARC…

There are several papers that describe what Google now claims to have developed…

copywave
left: Xerox PARC Paper; right: Google Wave

Conclusion: Go and read old Papers. As it turns out almost all newly hyped things have been described in papers from years ago.

Source 1: http://www.waveprotocol.org/whitepapers/operational-transform
Source 2: http://doi.acm.org/10.1145/215585.215706

getting System.ServiceModel.AddressAccessDeniedException in automated WCF Tests

We’re currently running several build processes. So each time someone checks new code in one of the build machines gets the whole package and builds it, runs tests on it and stores the result of this whole process on the Team Foundation Server. Great stuff so far.

Until you start to do things like automated WCF Testing. We’re using the selfhosting capabilities of the WCF to start a ServiceHost and then run tests against it. This works great locally. It does not on the build machines. Even if you promote the Build-Service User to Administrator you won’t get the love.

The error you might get would look something like this:

Capture

The exception contains an URL which tells you to add the Service URL to the machines URL Access Control List. On Windows XP and 2003 you have to install the Windows Support Tools and use the httpcfg command. On Windows Vista and 2008 you should use the already installed netsh commandline tool.

Since we need to get this to work on all current and future build servers I decided to add the netsh call to the build script, which looks like this:

” border=”0″ alt=”” src=”http://www.schrankmonster.de/content/binary/WindowsLiveWriter/get.AddressAccessDeniedExceptioninautoma_9859/Capture2_thumb.png” width=”400″ height=”109″ />

Add this Target before any tests in the .proj file and you’re set.

Source 1: http://go.microsoft.com/fwlink/?LinkId=70353

small and reliable SFTP server for Windows

I had to transfer some data the last days and I wanted to do it fast, encrypted and using only one tcp port. SFTP is one of those protocols that come in handy in these cases.

Since the machine that would host the SFTP service is a Windows machine I reached out to find a free, reliable and easy to install and use SFTP Server.

Bild 1

I found Core FTP mini-sftp-server. It’s a small download of just one .exe file. When you start it up it’ll show the dialog above. You can configure username, password, port and path. Click “Start” and off you go. Works as advertised.

Source: http://www.coreftp.com/server/

Society for Geek Advancement

“”Being a geek means being so interested in something that you don’t care whether or not it’s cool.”

THE SOCIETY FOR GEEK ADVANCEMENT was founded upon the principles that we should all embrace our inner and outer geek and have fun while doing it. As individuals who love learning, innovating and believe in possibility as well as change, the second step of responsibility is to “be the geek that keeps on giving”. As a member of SGA, we work together as a global community to provide the tools and help others realize their true potential too!”

<\/param><\/embed><\/object><\/div>“;” alt=””>

Source: http://geekadvancement.com/

The Samsung UE46B6000 + Apple Mac Mini + Plex

So it’s been some days with the new Mediacenter Setup. And all I can say is: Oh boy that is some serious cool setup. I wouldn’t want to chance anything beside adding a new Sound System (>5.1 FTW!).

The Display itself is thinner than thought:

IMG_5394

I strongly recommend the Mac + Plex + Full HD display setup. Even if you don’t get any HD content from your cable provider you can live-stream or download HD content through the different provider plugins inside Plex. The plugin infrastructure with the built-in “App Store” is just great.

Since Plex is a XBMC based Mediacenter software you have tons of information scrapers regarding series and movies. So you’re eventually huge collection gets indexed and presented in a way you would not get from any other Mediacenter. You get pictures, movie posters, descriptions and many more just by automatic indexing your collection.

IMG_5404_2

MST3k FTW!

Needless to say that HD content is something different. I only had some HD content on normal computer displays in the last years – having it now huge and sharp is different – better.

BTW: It’s on the floor right now because my wife couldn’t decide until now which tv-stand would suffice…

Source 1: http://av.samsung.de/produkte/detail2_main.aspx?guid=b6c1306c-f57d-4ce7-a944-56cc7346ed2e
Source 2: http://www.apple.com/macmini/
Source 3: http://plexapp.com/

new tv set arrived

Finally we got a TV set. Since Samsung announced new LED based sets we ordered a 46 inch tv. It was delivered today (yesterday the Mac mini which will drive the mediacenter arrived). I only had a short test-run scanning for cable stations… so more of that in the following days – especially more of the mediacenter configuration.

IMG_5325

Source: Samsung UE46B6000

new GPS track analyzer found

My beloved GPS analyzer “GPS-Track” has been discontinued :-( I wasn’t able to locate an old version of it so I had to find a new tool which does the trick. On the other hand I upgraded my Windows Mobile phone to a newer version – resulting in the not-running of my previous gps logging tool. So I had to find another new tool.

First the GPS Logging tool:

It’s freeware, written in .NET and worked out of the box with my bluetooth gps. It’s called “GPS Cycle Computer” and has a lot of cool features like Google-Earth KML export, the obligatory GPX support and a great several display modes.

GPS-Cycle-Computer

The GPS Logger exports an .GPX file which then is imported into the Analyzer called “GPS-Track-Analyse.NET”. This tool – obviously designed to analyze hiking – allows you to view the data in different ways, edit waypoints and export it to several other formats.

Bild 1

Source 1: http://www.gps-freeware.de/Vorschau.aspx
Source 2: the previous GPS Tracker Tool I used
Source 3: the new Windows Mobile GPS Logger tool

© schrankmonster blog 2019
Big Impresa designed by Iografica Themes.