Archive for the 'Uncategorized' Category

28
Apr
09

Using a VHD to Store stuff in Windows 7

Firstly, I’m not taking the credit for this one. It was Paul Stovell’s idea, but because he’s currently blogless I’m going to post it on mine… :-)

The other day Paul was talking about a way of utilising the new VHD features of Windows 7 to keep all his documents and important stuff in a single location so that he can back them all up by copying one file. He had created a VHD and written a script that mounts it as a drive at start up. I thought this was a great idea, so I reproduced it and am now sharing it.

Firstly, create the VHD either using Virtual PC or the Disk Management console Action > Create VHD. Attach the VHD in Disk Manager then initialise and format it. Detach it and we can start scripting the attach process.

Create a text file named “Attach VHD.txt” with the following contents in %windir%\System32\GroupPolicy\User\Scripts\Logon entering the location of the VHD:

SELECT VDISK file="<Location of VHD>"
ATTACH VDISK
SELECT DISK 4
ASSIGN LETTER=U

NOTE: I’ve used U as the drive letter. You can change this if it will cause a conflict or you just don’t like it.

In the same location, create a batch file named “Attach VHD.cmd” with the following contents:

DISKPART /s "Attach VHD.txt"

Open the group policy editor (Hit Start then type “group policy”) and drill down to User Configuration > Windows Settings > Scripts (Logon).

image

Open the the Logon script properties and add the batch file you just created (it should open the location you created the files in by default).

image

Now, log out and on again. It may take a few seconds, but the autorun screen should pop up when the drive is attached. Open Windows Explorer and you will see a new drive in your tree.

image

That’s it!

I’ve actually now moved all my user folders (i.e. Documents, Music, etc.) to the VHD, but if you don’t want to do that you can just use the libraries to include a folder and set it as the save location.

23
Apr
09

My Visual Studio Colour scheme

Ok, so here’s the current version of my colour scheme

What’s it look like?

image

Hope you like it. :)

30
Mar
09

Where’s them commerce server posts at…?

Ok, so it’s been a while since I spoke about writing some CS07 posts, but I promise they’re still on the way. We’ve finally gotten to the feature complete milestone on our project so there have been many a late night and weekend spent in the office getting things going recently.

Where am I at…? Well, I’m just finishing up a fresh virtual machine build for CS and I’m getting some good content together. Of course, with the new announcement of CS09, a lot has changed. Once I’ve finished up a bit of work on this 07 guff, I’ll hopefully get a chance to put together an 09 VM and put some content out there.

30
Mar
09

Windows Home Server available on MSDN

I’m a bit late to catch on to this one, but earlier this month Microsoft (finally) released WHS for download on MSDN. From the official announcement on the team blog:

MSDN availability will increase awareness of Windows Home Server with a larger community of professional developers and help further grow the ecosystem of software applications built for Windows Home Server.

Well, it’s about bloody time! There’s been a fair bit of public scrutiny over MS’s expectation for third party developers to write addons given that they had not released this earlier. I’m really looking forward to getting my server back up and running again after a much neglected Server 2008 installation.

28
Feb
09

Getting to know and love Microsoft Commerce Server

Over the past few months I’ve being working on quite a large web development project. This project involves the redevelopment and expansion of one of the largest e-commerce systems in Australia and the world. One of the base technologies chosen at the start was Microsoft Commerce Server 2007. This worried a few of us, but we were assured it was nothing like SharePoint ;-) so we were settled.

The team has grown to be quite big and well established. We now have 5 MVPs on board including some absolute superstars Damian Edwards, Tatham Oddie, Paul Glavich, Corneliu Tusnea and Luke Drumm. As a result we have a great grasp of ASP.NET and a great ability of delivering high quality software. The only thing our team was always missing was the Commerce Server knowledge…

At the beginning of the project, we were quite shocked by the amount of effort required to set up and develop with the framework. It was taking us days to get our environments to a functional state. Any changes to the underlying schema were taking at least a day of development then another day of roll-out. However, after a month or two, the sharp shooting pain that used to hit us whenever we needed to do something CS related subsided into a dull acceptance. It was quite sudden and really surprising how quickly a few of us had come to know and revere the beast that is Commerce Server.

Fairly soon after we started development we realised that not many people in Australia (or the planet) have used and/or blogged about their experiences with CS. Even Microsoft Australia were quite limited in their ability to support us because they had no one with any project experience. This was quite a blow because whenever we experienced a problem we didn’t have anyone to turn to for support.

It wasn’t until we had a consultant from Cactus Commerce – a consulting company based in Canada that specialises in e-commerce systems and CS – that we began to take hold of the beast. The two weeks we dealt with them helped us leap ahead and get to a point where we are no longer afraid…

We are now at a point where CS schema modifications take an hour to develop and roll out and Pipeline Components take minutes to put together. So, over the coming weeks I’ll be trying to share as much of the basic knowledge I’ve gained as possible. I’ll be writing about everything from connecting to CS in-proc versus web services to making schema modifications easily and writing Pipeline Components the right way in the hope that someone will get some benefit out of it.

25
Feb
09

I’m still here…

Yes, my blog has been exceedingly quiet over the past few months. I’ve gotten into the bad habit of queuing unfinished blog posts. That’s over, I’m clearing them out and starting fresh. Time to come back to life… :-)

18
Dec
08

Thank you Outlook for this informative message…

image

‘nuf said.

13
Nov
08

Defrag in 7

[Continuing on my rant of new little features I'm discovering in Windows 7...]

I’m quite sure I wasn’t the only one who was disappointed the first time I ran defrag in Vista to see they had taken my precious UI away from me…

Sure, I agree that the user doesn’t really need to know what is happening under the covers, just that the file system is being taken care of. I also agree that users should be able to easily schedule the defrag as part of a maintenance routine. However, in simplifying the UI they took away the user’s ability to determine the status of the process. This in my eyes was the major issue and was why I started using Auslogics Disk Defrag, which does a (speedy and) great job.

From the new look of defrag in 7, it looks like they heard the various cries of outrage… They’ve given us a new UI that allows us to configure a schedule AND to watch the status of a currently running defrag. They’ve also provided an Analyse button that determines the fragmentation of the drive.

image 

A step back in the right direction here…

13
Nov
08

Some SDS basics

I just thought I’d share some basic notes on SQL Data Services that I took while reading through a few pages on MSDN and doing a few of the labs. Head to SQL Data Services (SDS) on MSDN for all the documentation, or hit the portal SDS portal for the SDK and heaps more.

 

  • Authority – the unique name of the service. This is how the service is referenced, e.g. an authority name of ducas-authority would be represented by the DNS ducas-authority.data.database.windows.net. Authorities can only contain lowercase letters (a-z), numbers (0-9) and hyphens.

 

  • Container – a store for data/entities. These are “buckets” of objects that can be used without worrying about any schema. In this release cross-container queries are not supported.

 

  • Entity – an object with user-defined properties and values that is stored inside a container. Entities can be blog or non-blob both of which have metadata properties. A non-blob entity will have Id, Version and Kind properties and a blob entity will also have the Content property. Non-blob entites have flexible properties that are of the scalar types string, binary, boolean, decimal and date time.

 

  • URI Space – when using REST for SDS, you deal with Service, Authority, Container and Entity URIs. Querying the URIs will return POX that defines the results.
    • The Service URI that allows you to create and query your Authorities is https://data.database.windows.net/v1.
    • The Authority URI depends on your authority name and can be used to create or query for containers – https://<authority-name>.data.database.windows.net/v1.
    • The Container URI allows you to create and query entities in the container – https://<authority-name>.data.database.windows.net/v1/<container-name>.
    • The Entity URI allows you to retrieve, update and delete an entity – https://<authority-name>.data.database.windows.net/v1/<container-name>/<entity-id>.

 

  • Queries – iterate over a scope and return a POX representation of the results. The general syntax for querying entities is “from e in entities [where condition] [orderby property1] select e”. Flexible properties are stored in a property collection and most be quiered using a string indexer (e.g. e["Age"] == 32) whereas metadata properties are on the object (e.g. e.Id == “someId”).
    • Using SOAP, the authority scope must be defined. Use the proxy’s Get method to get an entity or Query method to query the scope.
    • Using REST, the URI must be well formed for the scope of the query. The actual query is appended to the URI, e.g. https://myAuth.data.database.windows.net/v1/c1?q=’from e in entities select e’.
    • The default page size of a result set is 500 entities.
    • Take can be used to specify the number of results to return (as long as it’s less than 500) – (from e in entities orderby e["Author"], e.Id select e).Take(10)
    • OfKind can be used as a shortcut to specifying the Kind of an entity – from o in entities where o.Kind == “Order” is the same as from o in entities.OfKind(“Order”)
    • Joins can be performed on entities in the same container by specifying multiple from clauses – from c in entities.OfKind(“Customer”) where c["Name"] == “Customer 1″ from o in entities.OfKind(“Order”) where o["CustomerId"] == c.Id select o
13
Nov
08

Disk Cleanup in 7

One of the most useful tools for cleaning some fairly chunky temporary files in Vista is the built-in Disk Cleanup tool. This has made it to 7 with a couple of changes.

First, you no longer get the choice to clean up your own or all files when the tool starts. Instead, after you choose the driver, there is a button for cleaning up system files, much like viewing all processes in Task Manager.

image

When you hit the button, it restarts the tool as an admin.

Now, if only I could figure out what this set of files is then I could make an educated decision to delete them…

image

Oh well… delete! :-)