Wednesday, 29 September 2010

Attach and Detach VHD files from the command line

Very simple and quick way to attach or detach a VHD file on demand, from the command line – use diskpart;

A) Create a diskpart script to attach your VHD;

Enter the following into a new text document (for the sake of argument, let’s call this attach-script.txt)

select vdisk file="your.vhd"
attach vdisk

B) Create a batch file to execute the diskpart script;

Invoke diskpart with the /s parameter as follows in your batch file (again, let’s call this attach.bat)

diskpart /s attach-script.txt

C) Create a diskpart script to detach your VHD;

Should be as follows (calling this detach-script.txt)

select vdisk file=”your.vhd”
attach vdisk

Create a batch file to execute the diskpart script;

As before, call diskpart with /s (detach.bat)

diskpart /s detach-script.txt

And your done…. just execute attach or detach as needed to mount/unmount your vhd file….

Getting a free lunch? Bitbucket is now free.

I’ve always been told there’s no such thing as a free lunch, but an email I received this morning appears to contradict this mantra!

I switched to Mercurial for my own personal/project source control earlier this year, abandoning subversion after many a happy year. When I made the switch, rather than host mercurial myself and have to worry about back-ups and the like, I signed up for a 10 repository plan with bitbucket, which was a meagre £10 a month. I had to do some creative merging of repositories to get all my projects into 10, but I was more than happy with the platform.

This morning however, I received a free lunch - an email that my plan was now free. They’ve teamed up with Atlassian and are now offering unlimited private and public repositories with 5 users for free!! I’ve not been able to find a catch :)

More info here:

Thursday, 2 September 2010

MVC2 validation samples

I’ve posted a project on codeplex here: to demonstrate using standard out of the box MVC2 validation with jQuery for both server and client side, including posting through a normal http form with full page post and through ajax – loading the form into the page with ajax and submitting it using jQuery, with full integration to the validation framework. This is to support my recent posts on the topic;