Category Archives: Uncategorized

Wix installer added to C9ServiceManager project

I’ve now finished the wix installer and tested the result for C9ServiceManager. All looks good with install and uninstall.

There’s still work to be done on the code that executes inside the service and some of the configuration reading from the registry. Hoping to get to that tonight.

I’m adding an interop samples project to github to hold working samples of some of the things I’m playing with on the C# to native interop front. There are too many APIs that aren’t exposed to .NET but contain important functionality. I’m currently investigating options on that front and coding up some sample approaches.

I expect this project to be a ‘living’ repository of code pieces in that area for some time to come.

Once Again a Linux Box

I have a history of bringing up a home Linux machine and then finding a need for that hardware doing something windows-y in short order.

I’ve just added a new SSD to one of my NUC machines and installed Ubuntu 17 on it. I’m expecting that I’ll likely move this to a new NUC at some point in the future as I do have windows work for the current NUC (but can live without it for now).

I’m looking at doing some microservices and MongoDB work in the sandbox in the near future and I’d like to have a working (non-VM) Linux install to host some code and as a built platform for Linux preferring tools. Worst case I wind up switching the SSDs back and forth as my needs vary.

For now I’ll need to get this install configured when I have time and look at putting MongoDB on it at a minimum. I’ll probably add Node and few other bits (assuming they don’t just come out of the box these days) to make this machine broadly useful.

Looking at C++/CLI Again and Other Things

Looking forward at sandbox projects I want to work on I find that there are many missing things in the C# world that can only be accessed from native code. The support in PInvoke and COM interop is undewhelming and C++/CLI seems to promise a relatively seamless interaction between the two worlds. I’ve just ordered a newer book on the technology and expect to read through it when it arrives.

I’ve added an installer to my current sandbox project (a service that manages the state of other services based on time of day). I’m having some issues with my local Wix install and won’t be pushing the update to github until I can successfully build the installer.

Over to C# Interop and Some Native Code

It has been a little while since I’ve gone diving into Win32. I’m looking in there a bit now though. I’ve been using mklink on the command line to create NTFS symbolic links for various purposes. Once those show up (and volume mounts), file management tools suddenly need real confidence that they’re looking at real duplicate files and not multiple links into the same file.

This quickly leads into areas of the Win32 API that haven’t been directly exposed in C#. The

GetFileInformationByHandleEx() with FILE_ID_INFO

API exposes the required information. There are other bits of information in the GetFileInfo* APIs that may also be important. I’m looking at Interop again as a way to gateway this sort of information across.

I’m not all that happy with PInvoke as it narrows everything down to a C style interface. The COM interop mechanisms are clunky and tied to coclass rather than interfaces in ways that seem to subvert the basic design tenets of COM. C++/CLI is close to the sort of connection I’d like, but is complex and I question whether it will remain stable in the long term as it is a bit of a fringe technology.

At this point I’m refreshing my memory and considering. I’d very much like to build a capable and safe tool for managing (and cleaning up) duplicate data. File uniqueness is going to be one of the key features here…

Bouncing around…MongoDB, Angular and C#

Bouncing around a bit this weekend…doing a more detailed read-through of the book I’ve got on Angular  as this seems like one of the better ways to create modern user interfaces, digging though my MongoDB stuff  a recent acquisition and looking to wrap up the sample service I’ve been working on. Add in finishing up my resume update (I try to keep my credential up to date and use layoffs at work as a reminder…had one this summer so  it is about time) and I’ve got a pretty full weekend.

Lots to learn as I come up to speed on the web side of things in a more serious way than I have in the past. I’ll continue sharing any interesting sandbox projects on github.

Looking at pfSense as a Firewall

I’ve got a small, multiple-ethernet port computer arriving from Amazon today (a QOTOM Core i5).

I’ve been running SOHO boundary routers for the last many years and finding that they’re somewhat inflexible, eventually stop being updated and often frustrating in the features that they omit.

I’ve had a new boundary router sitting on the shelf for about a year that I still can’t get my ISP connection to provide an address to. It works fine as an upstream off of my internal network though. There isn’t enough diagnostic information readily available to figure out what is happening and shutting my external connection down for extended experiment breaks isn’t really a happy thing either.

I’m expecting to install pfSense on the machine when I get it. I’ll have to come up to speed on the configuration for pfSense, but I expect that once I’ve got it in place, the project will continue providing updates over a much longer span than other options. I’m also hoping that inbound VPN capability can be set up without extra cost client packages and other entanglements…

I’ll update once I’ve got the hardware in hand and have started in on the setup process.

Nice to find that there’s a C# port of iText open source

Looking around at PDF processing code out there. iText kept showing up but it is a Java library and these days I’m focusing on .NET (at least for a while). Found that there is a C# iText on github. Not sure when I’ll get around to messing with it, but being able to work with PDF these days is a very useful capability (and I’m not doing anything closed source in the sandbox anyway)…

The humble GUID/UUID…

Guids come up periodically. They’re the one obvious choice when a truly unique identifier is needed but you can’t have some application specific central registry (akin to Dicom-3 identifiers).

They look like somewhat random strings of hex digits with dash separators but there is additional structure in there.

The originated with OSF-DCE (the one unix distributed computing environment). Microsoft borrowed parts of OSF-DCE when building COM and DCOM. Guids came along for the ride in this and became part of the windows infrastructure.

In a recent discussion, a piece of code that loaded up ‘fake’ Guids as small integers with zero fill came up. I refreshed my memory (they’re now defined in RFC4122) and came to the conclusion that these aren’t well formed UUIDs at all. There are a couple of short bit fields within the body of a GUID that define the version and type of the GUID. These can’t be zero unless all bits are zero (the null GUID).

 

Starting to look at NUnit

I want to implement some unit tests for the servicemanager service. Not particularly necessary for something this small, but I want to get a look at NUnit and this little service exists in part as an excuse to try some new technologies out on a small scale.

I’ve been using the Microsoft test facilities at work lately and have not been overly impressed. I’m hoping that NUnit will serve better and it runs under the professional rather than enterprise version of the tools.

I’m a bit torn on the dependency injection front. I have components that use system facilites (SCM, registry and such)…in fact most of what this little service does leans that way. Adding in half-baked mock-ups of SCM and registry classes for injection purposes doesn’t make me happy but building limited capability wrappers that expose only what I need now so that I can intercept things doesn’t make much sense either.

I’m still finding my happy place on the DI/Unit test front it seems.

Full unit test of happy and unhappy path with robust, broad based DI looks to me to add two to three times the amount of work that was required to implement the baseline component. Low fidelity mocks leave the code with half-baked unit tests as mock failures either hide deficiencies or generate their own set of phantom errors. Still hunting a state of grace on this front.

Adding support assembly to ServiceManagerService

I’m pulling much of the existing guts of the service manager service out into a separate assembly. I’m expecting this to make for a cleaner design and make testing of the various components easier.

Currently building out the configuration retrieval component. Not expecting this to be a thing of beauty at this point, but should be serviceable and make it easier to build the active part of the service code to always respond to the current state of things.

Once this is done I’ll have to build out a service access and state management component to effect the requested changes.

The real challenge will follow as I need to add a Wix installer to create an MSI to get this onto other systems.

Web UI will likely wait for a later time. It needs to be self-hosted but I’m still not sure what the right toolkit is. I also should figure out how to secure it as this will have full access to some very sensitive items.