Sunday, 29 May 2016

Preventing the low disc space warning on a HP Touchsmart

The HP Touchsmart comes with a 16.4GB recovery partition. Unfortunately Windows keeps warning you there is no space left. The HP site gives some useless instructions to delete files - but there are no spare, safe files to delete. Fortunately Microsoft enable you to turn off the warning:

https://support.microsoft.com/en-us/kb/555622

Determining the Windows Product ID & Product Key from an existing copy of Windows

The command

systeminfo

will tell you the Product ID.

The command

wmic path softwarelicensingservice get OA3xOriginalProductKey

will tell you the Product Key.

Sunday, 24 April 2016

TurboCAD 20 online activation

You can pick up a copy of TurboCAD 20 for a good price online and it offers some good features if you are after a simple CAD program.

After 30 days it will ask for activation, and you can do either online or via the telephone.
If you can't wait or afford to call US Office Hours, you can try and do an online activation.

Unfortunately the button on the GUI doesn't work.

However, you can do it yourself via the browser.
Navigate to Link: http://activate.imsisoft.com/ and this will allow you to enter your serial number and an email address. It will display an activation code and email it to you also.

Sunday, 10 April 2016

Brother 9450CDN Toner Life End message

Sometimes the Brother 9450CDN reports a Toner Life End message when there is still toner left in the cartridge.

It appears there are two solutions: #1 is to tape a bit of black tape over the window of the toner cartridge, or over the hole for the sensor in the toner tray. I left the tape on just in case it would do good in the future.

The other method is:

  1. With power on, open the toner access main door. You will get a “Cover is Open” message on the LCD.
  2. Press the “Clear/Back” button and you will be taken to the toner “Reset Menu”
  3. You can then scroll through the reset options for the printer’s toner cartridges:
    1. B.TNR-S – Black toner small cartridge (TN-110)
    2. B.TNR-H – Black toner high-capacity cartridge (TN-115)
    3. C.TNR-S – Cyan toner small cartridge (TN-110)
    4. C.TNR-H – Cyan toner high-capacity cartridge (TN-115)
    5. M.TNR-S – Magenta toner small cartridge (TN-110)
    6. M.TNR-H – Magenta toner high-capacity cartridge (TN-115)
    7. Y.TNR-S – Yellow toner small cartridge (TN-110)
    8. Y.TNR-H – Yellow toner high-capacity cartridge (TN-115)
  4. Select the cartridge size you have and the colour you want to reset, and press OK. Since I had small cartridges, I used the S options for all three colours.
  5. Each cartridge must be reset individually. Press “1” to reset.
  6. Press “Clear/Back” to get out of the menu, then close the door.

Sunday, 20 March 2016

BlackVue 650 - Please check the SD card

The DR650GW-2CH like the DR600GW and the Blackvue DR750LW-2CH cannot recognise exFAT format SDXC cards, in order to get the Blackvue DR650GW-2CH to boot up successfully with a 64GB Micro SDXC card inserted you need to format card to FAT32.

To fix this problem, use the BlackVue viewer app and the format function within it.

Thursday, 4 February 2016

At Least Once Messaging, Atomic operations and SQL Server

In a NServiceBus system with at-least-once-messaging, there is always the chance that two handlers are executed with identical copies of a message. Handlers should be idempotent and protect against the same message producing different outcomes.

When we move deeper down to the repository layer, it raises interesting implications. If we have an Upsert style Stored Procedure (Update/Insert), then should this protect against high concurrency situations?

Take the excerpt below from a financial system:

IF NOT EXISTS (SELECT ReceiptId FROM [dbo].[PaymentLedger] WHERE ReceiptId=@ReceiptId)

      BEGIN

            INSERT INTO [dbo].[PaymentLedger]

The Select then Insert/Update semantic above is not protected against concurrent access and this has a [low] potential of happening with our messaging infrastructure.
If two handlers process a copy of the same message we have the potential to do two inserts into the PaymentLedger table.

This article discusses the problem and suggests a fix.
Even the merge command is not immune from this problem. It also demonstrates a good method for replicating the problem by scheduling a SQL command.

We can rely upon the caller above us to protect us from this scenario. However if we want the Stored Procedure to be explicitly safe against high-volume concurrency then the transaction really should be applied at the SQL level and not reply upon the client applying it.
We may not trust our client because

  • may have not applied an idempotency check correctly
  • our endpoints often don’t wrap the SQL in a transaction 
  • or have disabled distributed transactions. 

An example fix is to modify the SQL as follows:
BEGIN TRAN 
IF NOT EXISTS (SELECT ReceiptId FROM [dbo].[PaymentLedger] WITH (UPDLOCK, SERIALIZABLE) WHERE ReceiptId=@ReceiptId)
BEGIN
      INSERT INTO [dbo].[PaymentLedger]
      ....
END
COMMIT TRAN

This change will affect performance very slightly by reducing the throughput of these inserts/updates.

Friday, 29 January 2016

ASP.NET MVC WebApi returned a 404 on a Windows 2003 R2 32-bit server

We promoted an ASP.NET MVC WebAPI project from Dev to Production.
It was working fine in dev and we XCOPYd the files from Dev to Production.
All of the IIS settings were comparable - or so we thought - so what can go wrong?

Well, the famous 404 error can. We were getting a 404 on all requests to the Web API.

We tried various things, like setting the
<modules runAllManagedModulesForAllRequests="true" />
element.

We did an aspnet_regiis.exe -i.

I checked we didn't have to allow 32-bit applications on a 64-bit machine.

We tried setting up a wildcard script map.

None of these worked. Nothing was showing in Event Viewer.

In the end we went to the IIS logs. We noticed the 404 code, but also a subcode 2 and sc-substatus of 1260. This article showed that it was a lockdown policy that prevented the request and the 1260 code indicated ERROR_ACCESS_DISABLED_BY_POLICY.
This was because under the Web Service Extensions branch in IIS Manager, the ASP.NET v4.0.30319 was set to prohibited.

Lesson learned - check the IIS log and look at the detailed error codes. The 404 has a subcode and the statuscode yields even more information.