Subscribe via RSS

VC Redist (x86 or x64) 2015 vs 2017

I've got a brand new laptop at work and I didn't bother installing archaic versions of Visual Studio. Instead, VS Community 2017 was installed and, as part of it's due dilligence, it installs the prior VC Redistributibles to allow older applications to run. Think of these as dll-hell packages that provide the supporting libraries (glue) that VC++ compiled programs need to interface with the current Windows OS.

Anyway, when trying to install MySQL Workbench I was presented with the following pane:


Sure, I'll install VC 2015 redist, I'm obviously missing it! Oh wait.. I'm not..


0x80070666 - Another version of this product is already installed. Installation of this version cannot continue. To configure or remove the existing version of this product, use Add/Remove Programs on the Control Panel. Nice. Another version is actually NOT installed... another 'newer' version is, but it's an entire major version apart! Anyway, let's go see what we have installed...


VC Redist 2017, of course... thanks to VS 12017 itself. What happens if I remove it? Good question... regardless you can re-download the 2017 redistributibles here. I therefore removed the 2017 and then successfully installed 2015!


And the world was a happier place... then again, with MySQL Workbench installed I still couldn't see the database I was expecting... but that's another story.


Visual Studio 2017: Error Deploying to Raspberry Pi 3

Any chance you've just opened up sample code to deploy an ARM-based project to a Raspberry Pi and you get this error?

DEP6100 : The following unexpected error occurred during bootstrapping stage 'Connecting to the device 'IP ADDRESS OF PI'.': 
MissingMethodException - 'Microsoft.Tools.Connectivity.RemoteDevice.Ping()'

Did you just install the Windows 10 SDK? My first recommendation is to reboot your machine! ...but actually, you don't really have to do that. Just restart visual studio. And yes, I know you closed it when you were installing the SDK... for some reason even opening it up straight after didn't work. A second restart of just VS2017 worked fine.

Also.. the default screen resolution is wrong on the PI when with a 7" 800x480 LCD. It really screws with the touch-screen input. Thanks to this article, we only have to do the following:

$username = "administrator"
$password = "[YOUR PASSWORD]"
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $username, $securePassword

$pstimeout = New-PSSessionoption -OperationTimeout (1000*60*5)
Enter-PSSession -computer [IP OF RASPBERRY PI 3] -Credential $cred -ErrorAction Stop -SessionOption $pstimeout

Save the above as a script and run it in the PowerShell ISE.

[IP IF MACHINE]: PS C:\> SetDisplayResolution.exe 800 480
Set Display Resolution and Orientation

replace line: gpu_mem=32                  # Set VC to 32MB, ARM DRAM to (1008-32)MB
append line: hdmi_mode=87
append line: hdmi_cvt=800 480 60 6 0 0 0
append line: lcd_rotate=0
Success! - You now need to reboot the device
use "shutdown -r -t 0"



How to convert XML into a class the easy way!

An on-the-side project, that's been going for quite a while now, extracts data from a remote service. For a very long time, this was done via reverse-engineered Java code, of which I then wrapped my own console app around. All worked very well until they changed the login service request format and stopped using the Java altogether.

The new version was just HTML and json and, but the actual payload of the data I cared about was XML. Yes, that's right, XML in a string via JSON. Who would'da thunk? Regardless of the insanity, I was still itching to parse it.

So, the usual Json to C# class generator was used to build the de-serialisable class for the initial packet. I then needed a quick and smart way to convert the XML into a class.

Turns out that there is also an XML to C# converter! Paste in your XML blob and, if correctly formatted, it'll return a class that the XML can be de-serialised into!

And, it worked perfectly. Well, nearly. There was one gotcha! The XML class I was decoding had one field called Text. This is not a valid name inside a deserialised class in C#. So call it a different name in the class but override it via an attribute, as per below.

[XmlRoot(ElementName = "g", Namespace = "")]
public class G
        [XmlElement(ElementName = "rect", Namespace = "")]
        public List<rect> Rect { get; set; }
        [XmlElement(ElementName = "text", Namespace = "")]
        public List<textitem> Texts { get; set; }
        [XmlAttribute(AttributeName = "fill")]
        public string Fill { get; set; }
        [XmlAttribute(AttributeName = "stroke")]
        public string Stroke { get; set; }
        [XmlAttribute(AttributeName = "transform")]
        public string Transform { get; set; }
        [XmlAttribute(AttributeName = "text-anchor")]
        public string Textanchor { get; set; }
        [XmlElement(ElementName = "g", Namespace = "")]
        public G[] subG { get; set; }

Those watching trains on maps in Australia have the above site to thank for the speedy recovery of the service :)


Resetting Windows 10 Passwords

Sure, this isn't something a normal person should be doing, but this scenario required it. I'd just fixed a friend's laptop, or I thought I had, until I got a call 2 weeks later saying there were password issues again. Instantly I thought I'd screwed the BIOS up, but this time it turned out to be an entirely different error!

DSC 0243

Oh shit... who the hell are LizerdSquad? Is that a typo? Not many google results for this cute little hack. I asked my friend if he'd opened any suspicious emails lately and body-language told me 'yes'. Anyway... google to the rescue. Top Password has a good article on using Kali Linux to reset such a password.

I found a blank USB key and created a bootable drive of the base Kali Linux i386 'light' image.


Booting was easy enough... ESC to select the USB key as the boot device.

DSC 0244 DSC 0246 DSC 0247

DSC 0248

Or was it? After choosing 'forensic' mode, the system tried to boot until I was simply presented with a blank screen. Seems my video driver isn't supported? Fail-safe mode worked... but then I didn't have the chntpw command on the terminal! No amount of 'su' or 'sudo' got the tool. Does the 'forensic' mode mount other disks to provide the toolkit?

Trying a different approach...

Keep fighting Kali? Better just use this: A bootable ISO of the chntpw tool. And it worked perfectly! I burned it to the USB key using the 'MBR' option via the same tool as above. From startup, it booted straight into console mode. Whilst loading it even went further to find and diagnose the Windows partition.

DSC 0253 DSC 0254 DSC 0255

This laptop has a single user and a simple windows setup, so the default options were all correct already! Very nicely programmed. I chose through to clear the password and ... bingo!

DSC 0257

Don't worry about the 'tmp' error on the final save.

DSC 0258

Mission accomplished. Rebooting the machine just gave me a 'sign in' button instead of password entry box and we were at the desktop!


Replacing the BIOS in an HP 250 G5 Laptop

After visiting the flea markets in Melbourne a lot, I've made quite a few friends. These include fellow shoppers and the odd store-holder. One of these store-holders at Oakleigh, in the South East of Melbourne, pulled me aside 3 weeks ago to ask if I was any good at repairing technology.

I hesitated at first... I love repairing (and breaking) my own things... but I am not so sure of destroying other people's equipment. Anyway, the issue was a laptop BIOS password that could not be bypassed. I mean, how hard could it possibly be?

The Laptop

This was to be a slow process. The markets are only held every Sunday and I was pretty busy during the week, so I could only pick the unit up the next weekend. Turns out the problem child was a run-of-the-mill HP laptop which, as soon as powered on, asked for a Power On Password.


DSC02318 DSC02319 DSC02320

A quick google showed that a visit to BIOS Password Recovery for Laptops would help. All I had to do was paste in that magic code (enter three wrong passwords) and receive the master password. Unfortunately, passwords beginning with an 'i' just can't be done like this!

A Call To Support

For all intents and purposes, HP support online is actually fantastic. I was quickly informed that this unit was out-of-warranty and a real call to the telephone support would be required. I quickly tried the 'online chat' support first and the system was actually really helpful. They take in your details and then attempt to throw you to their own KB articles.

Fortunately, my problem was impossible to fix online... otherwise everyone would just be getting past this security measure making it not-so-secure. I was then asked to provide the original invoice, a letter indicating the postal address of the owner and a hand-written note from the owner requesting a formal password reset.

Unfortunately, the owner could not produce the original invoice. The item was purchased online a long time ago and he had been unable to get it printed again. From my point of view, the online retailer was definitely not going to help me. There would be too much back-and-forth... I therefore googled a little further and realised there was another way to solve this problem.

Hardware Hack

This is my specialty. Why bother with the to'ing and fro'ing when you can just crack the machine open and replace the BIOS chip. I mean, usually these things are slotted... so how hard can it be?


Oh shit... It's a tiny 8-pin SMD IC just near the metal shielding and it's nicely soldered in place.


You'll find pre-flashed BIOS chips for sale on eBay. This one came from Latvia and even had the very latest BIOS installed. It came with a great set of instructions too.


Remove the current chip. I know, I know... I said above that I'm not down with wrecking other people's hardware... but here I got frustrated trying to remove this chip and just cut the legs. It's the easiest method and well... I would've been screwed if it didn't work!


From here, tin the pads and then place the new chip in place in the correct orientation! Then just tap the legs with the soldering iron and set the item in place.

DSC02331 DSC02336 DSC02338

And then... apply power!


Yes yes... as per the instructions, the CMOS settings need to be saved. When past the screen above, his ESC and then F10... set the date/time and then go to the final menu and save.


Well shit... it just worked! Now to clean it up and hand it back.


Windows 7 doesn’t boot after installing on Hyper-V

Thanks to my fresh windows 10 install, I had to re-install Hyper-V. No real issues... made a new machine and booted a Win7 ISO. All well... installed quick... reboot just gave me a black screen with a flashing cursor.

Googling came up with this link... Lots of rubbish replies... but there was another one of those gems. Those one-liners that save the world.

Boot your installation media and go to command prompt via recovery, it said. Just type the following, it said:

bootsect.exe /nt60 all /force

And, well, shit... it worked perfectly.


Windows 7 64-Bit to Windows 10 Upgrade Error

New year, new OS install. Windows 10 was lagging badly and took around 20 minutes to boot... sure... it was probably PLEX just trying to checksum 4TB of media, but I was sick of it. So, fresh install of Win7 on that 1TB SSD I installed into my previous Vaio. All went well with Windows 7, apart from crappy installation media... but upgrading to Windows 10 took a lot of effort.

Actually, Windows 7 had enough trouble with its own updates. I think that, nowadays, due to the sheer amount of updates that'll try and download and install (at once) on a fresh Windows 7 installation, it's nearly impossible to have them actually all install and succeed.

Therefore the windows updates process took around 10 reboots, with the progress counter getting to 70% and unwinding with an error... but each time more updates would succeed, so it just seemed that they needed intermittent reboots which aren't automated.

Anyway, once I finally had a Windows 7 desktop with an who-knows-how-successful SP1 install, I did the lovely accessibility Windows 10 update. I am hard of seeing, you see?

I came straight away into this error...


The program can't start because api-ms-win-core-libraryloader-l1-1-1.dll is missing from your computer. Try reinstalling the program to fix this problem. Re-installing what program? I'm running an installer! :)

After a large amount of googling... I stumbled across a one-liner in this post. Someone briefly mentions swapping wimgapi.dll from your c:\windows\system32\ folder into the c:\windows10upgrade folder... it then just worked!


Well.. I hope it will... at least it's installing...


Windows 7 Setup asks for a CD/DVD Drive Device Driver

I have gotten a little sad recently. My Windows 10 machine now takes 10 good minutes to get to a usable desktop. Sure, Plex is trying to wrangle 4TB of media and ... well ... there's 3 other years of crap on the main partition ... but it's now beyond a joke.

To get anywhere near back to normal, I'll need to re-install the licensed version of Windows 7 and follow the standard sneaky upgrade path.

I therefore grabbed the installation disk and booted from it. Not too far in and I was already at a road-block. Excuse the image quality... my ultra-wide screen doesn't like the installers basic 4:3 resolution!


A required CD/DVD drive device driver is missing? Ok.. sure... maybe you don't like the RAID setup in this Dell Precision T3500. I proceeded to kill 20 minutes rebooting to a usable desktop and trying to guess what drivers to download and install... I grabbed a myriad and burned them all to a CD. Rebooting, I swapped this in and tried to load the INFs.


Wait... Windows Setup can see the hard drives it's supposedly missing? Wait... it can also see the DVD drive?... wait... what's going on here? What's it actually complaining about? Ohhhhhhhhh... it hates the installation media? Why didn't you just say that the first time?

I then re-burnt the DVD at a slower speed (as per instructions) and got a little further...


Finally... I found a real DVD (DL RW Disc)... burnt it... all worked. Moral of the story? Use proper DVDs. Maybe DVD+R as the DVD-Rs that I burnt above were totally unreliable!


MINI VGA2HDMI Converter Issues

I bought this converter on eBay to get my Dreamcast plugged into my new TV which does not have VGA input. All worked really well during the first fortnight of usage.


4+ weeks into usage saw really bad performance from the device: screen distortion, black screens, incorrect resolutions and really crappy sound.

DSC00027 DSC00028 DSC00030

Wiggling plugs had minimal effect, so it was time to pop it open. There isn't much to these things as it's all SMD and on a single board. I couldn't see any (overly) bad soldering or problem spots, so I guessed it would be heat causing the issues.


I improvised a makeshift heatsink and the device started operating perfectly once more.


It actually occurred to me that, since I was powering the device off the TV's USB port, the device had been powered up each time the TV was on; not just when the Dreamcast was on. I assume these things just aren't built rugged enough to be used 100% of the time?

Anyway... I can only recommend to all that you pop open your devices and put heatsinks inside them for stable usage!


Javascript numbers with leading zeroes

Here is yet another public service announcement. I've recently been coding times for this post to track train timetables. Whilst doing so, I had the times in my array fully padded out to make everything easier to read.

i.e. for the southbound passenger timetable, I had the following:

var southbound_pax = [

All of my testing had been done after 10am, so everything worked fine. This morning I get in and check the timings and it's all really wrong. I whipped up a quick test as I'd seen strange values in the arrays.

> var number_array = [0000, 0001, 0002, 0003, 0004, 0005, 0006, 0007, 0008, 0009, 0010, 0011, 0012];

> number_array
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 8, 9, 10]

Wait, what?... we're good until 0009. Then it goes nuts? A heavy bit of googling produced this warning on w3schools:

Never write a number with a leading zero (like 07).
Some JavaScript versions interpret numbers as octal if they are written with a leading zero.

Ohh.... riiiight... some... Did anyone else know of this feature?
Effectively, if it's octal, then 0009 should throw an error, right? Not just silently work and then flip back to '8' at 0010. Grrr...