Subscribe via RSS
10May/180

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 = "http://www.w3.org/2000/svg")]
public class G
{
        [XmlElement(ElementName = "rect", Namespace = "http://www.w3.org/2000/svg")]
        public List<rect> Rect { get; set; }
        [XmlElement(ElementName = "text", Namespace = "http://www.w3.org/2000/svg")]
        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 = "http://www.w3.org/2000/svg")]
        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 :)

4Apr/180

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.

iso2disc

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!

3Apr/180

Mixing and matching Xeon Processors?

So I recently came to acquire this beast. It's a beautiful 13-year-old IBM Intellistation Z 6221 with a 3.2ghz Xeon processor. I really dig the IBM styling... it's also ridiculously modular, not even requiring a screwdriver to rearrange drives. Unfortunately, due to its age, it's only 32-bit. In fact, it came with one (supports two) of the fastest and final 32-bit CPUs of the Xeon family.

DSC02568

DSC02569 DSC02570 DSC02571

The first step was to find extra ram to fill the 4 slots. This would only ever max to 8gb, so I needed 4 2gb DDR PC2100 dimms. Not so easy to find any more and prices are going up... either way they were sourced from eBay. I also, now that I think of it, accidentally sold the black floppy drive because a collector wanted it. It's now silver... and doesn't look too bad... but I'm on the hunt to fix that... Or maybe I'll put a zip drive in there...

Next step was to fill the second CPU slot... Thanks to the modular case, no screws were harmed during the dismantling of this product. As you can see below, the naked socket is neatly protected by a plastic shield that plugs into the heat-sink socket. There is, of course, no heat-sink; as there is no CPU in that second slot by default. You could choose this as an option when purchasing the unit.

DSC02125 DSC02126 DSC02130

It turns out that I had another Xeon desktop, in the form of an HP MLxxx. Although this was only a Xeon 2.7ghz, I'd read online that you may well be able to mix CPU speeds? First thing was to remove the CPU from the HP. This turned out to be very easy as its case was also very modular.

DSC02131 DSC02133 DSC02134

Instantly you can see that the heat-sink is different... the IBM used case-mounted fans with passive CPU-mounted heat-sinks, whereas the HP used heat-sink-mounted-fans. I inserted the CPU into the slot on the IBM's motherboard, but the heat-sink shape was different to the bracket mounted on the IBM motherboard. The heat-sink from the HP would not fit in directly!

DSC02138

I quickly tried to remove the bracket from the HP motherboard, with the intent on transplanting it into the IBM. After a lot of effort, it came off (the screws HP used were nearly torqued in!), but then it wouldn't fit in the IBM! It was too wide and long and actually wouldn't fit between the rows of capacitors. So much for industry standards!?

DSC02147 DSC02148 DSC02150

DSC02152

Ok... whatever... I mean how quickly can these things heat up? I'll just hold it in place for a quick test... before I mangle the heatsink to fit. Nope. Turns out the IBM wont even power up with this CPU in the second slot. Is this a fail-safe mechanism because the CPUs aren't matched? Is this CPU a dud? (I hadn't tried it prior...) Dunno.

Make sure the CPUs match!

Off to eBay, I found an identical SL72Y processor in England. It took a few weeks, but it arrived. Again, prior to hacking up the heatsink to fit, I thought I would install the CPU quickly as a test to see if the machine would POST.

DSC02562

Oh wait... it wouldn't just slot in... oh wait... look at those bent pins! I still don't know if it was the beer or the fact that it came off its little foam pad already-bent, but it required about 30 minutes of pain-staking twiddling with a pair of tweezers to get the damn thing in. DO NOT RUSH THIS PROCESS. At one point I thought all was lost as it just wouldn't mount... but after a lot of adjusting it went in.

DSC02556 DSC02564 DSC02566

A bit of hacking was then required to fit the HP heat-sink. I had to hack pieces out of the braces that screw down to the motherboard. I then had to bend a few fins on the actual heat-sink so they wouldn't ground-on or damage the rows of capacitors placed so nice-and-close to the CPUs. And then... it just freakin' worked... and the machine finally loaded Chrome at a proper speed on Linux Mate 18. Now to find a more-appropriate OS to run on this slightly ancient hardware!

Filed under: Retro No Comments
22Mar/180

Modding an original PlayStation

I hadn't played one of these since... maybe... 1996 when my neighbour and I got Abe through his quest. I found this unit at an op-shop recently for AUD$40 and couldn't resist.

DSC01581

The first thing to do was a tear-down + clean. Of course, a friend then told me he had a spare modchip for it.. so... why not do a proper job whilst the unit was still open.

DSC01583

In true Sony-style, the units disassemble perfectly easily and are neat and tidy inside.

DSC01585

Once you're down to the motherboard, it's simply a matter of determining where to wire the chip. To do this, you'll need to know which chip you have and which model motherboard. Mine was a Multi-Mode 3 and I installed it onto a PU-23 motherboard. I followed the instructions here.

DSC01586 DSC01590 DSC01593

Flatten the chip so that you can glue it on top of an IC later.

DSC01596 DSC01604 DSC01599

Then just run all the wires with as-little-slack-as-possible. This just means you wont have any issues with wires getting in the way of screws later.

DSC01605

Test when the case is open, test when the case is closed and test again later. When testing, the CD tray mechanism requires the case to be held firmly together so that spacing is correct for laser alignment.

DSC02450

Last time I was in BKK, I purchased a selection of random Japanese games. Pachinko, Abe's A'go go(Odyssey), Myst and Tekken 3. Turns out they all work perfectly.

DSC02462

Abe's A Go Go is actually a random text-replacement version of the english version. The cutscenes are still in english with subtitles.

DSC02464 DSC02466 DSC02467

DSC02469

And then you get a random ticker at the top with instructions for non-english speakers... Anyway... time to go and play the rest.

Filed under: Retro No Comments
21Mar/183

Amstrad CPC464 Restoration

I was hoping this would be a plug-and-play, but a machine this old was always going to be a challenge. I received this unit as part of a lot with the other 6128s and have finally received a tape to test on it.

DSC02424

DSC02425 DSC02426 DSC02428

From the outside, the item was a little dusty. That white piece, which looks like a pivot of some sort, fell out when I rotated the unit to see underneath. Never a good sign... Either way, I plugged in the unit and power it up (it happily uses the same RGB and power setup as per the 6128). To my surprise, I got straight to the main BASIC screen! To try my luck further, I loaded my demo tape and typed RUN"...

DSC02433

All good so far... then I noticed that only the left spindle was spinning on the tape player. The right wasn't collecting any of the read tape... I had a hunch where it was going......... yep.

DSC02432

Time to pop it open.

DSC02434

Dusty... OK... I can handle that... what I can't handle is a spring (from somewhere?) magnetised to the speaker. The ad-hoc shotty taping-and-soldering was also a little bit of a surprise.

DSC02435

Regardless, looking at the tape player mechanism I quickly found two dead rubber components. The band to the tape counter had perished...

DSC02436

So had the rubber ring that drives the right spindle. This makes perfect sense and explains why the machine tried to consume my tape.

DSC02438

Finding spares

There's a few options online for spare parts. eBay was my first choice and I have the two main belts on the way from Germany. This'll take a while. I actually really only need the band for the tape counter, but it won't hurt to replace the main drive belt also.

The second part is a concern. It's a tight ring and my initial searching has come up with zero results. Might have to head to the hobby shop today and find a car tyre or o-ring. Meanwhile, did someome say o-ring?

Drive 'wheel'

Not having much luck with o-rings, I went to my local hobby store and bought some Fleischmann HS Scale traction tyres (00544001) (actual picture here). I bought 4 in total and just layered them up on the wheel. I was a little worried about alignment as any friction would cause the tape speed to change.

DSC02541

DSC02544

It has seemed to have worked.. but now the main drive belt is slipping. I'm going to assume it's loose and therefore not getting the required amount of traction. More waiting until the next set of spares arrives!

Drive and Counter belts

The set was ordered from eBay and arrived from the UK in good time. As expected, two belts in a bag. Much stronger and more flexible than the belts they were to replace.

DSC02573

There's one screw underneath to remove and then you just slide the belt over the wheels. Make sure you not twist the belt when installing. It's not 'extremely' tight, so it's pretty easy to install.

DSC02574

Read Errors

Back to testing. The tape drive started operating perfectly, so I attempted to load the cassette once more.

DSC02579

Yosh! We're getting somewhere... but then...

DSC02581 DSC02583 DSC02585

Read Error Codes indicate failures whilst reading from tapes. Sometimes this is a dirty head, other times the head is out of alignment. I wiped down the head with an alcohol swab and then started to attempt alignment. Not really knowing what I was doing, I hooked up the audio to 'listen' to the data and twisted the alignment screw until the audio was loudest and clearest.

DSC02591

After a lot of errors, I seemed to have it stable, so I restarted the machine and tried again. It got all the way to Block 11! Then it just wouldn't continue. I hung around until I could make it say 'abba'.

DSC02598

Was the tape dead? All of a sudden I had a hunch it could be the power supply... so I swapped to an old AT power supply... but it didn't seem to be able to provide enough current...

DSC02600

And then I accidently plugged in 12v...

DSC02601

Take your time when playing with old electronics... I've now received the dreaded Grey Screen of Death and that means any of the internal ICs could be toast. I might muck around and try and swap the socketed ones between the 6128... but otherwise... I might have just lost the battle. $%$#%#$%#%.

There's a lot of good information here on over-voltage. Seems I've cooked the lot.

Chips on the board

I'm putting this here in case I ever feel game enough to do a full board chip replacement.

Chip Purpose Quantity Status
AY-3-8912 Sound 1
AMSTRAD 40009 32K ROM; O/S and BASIC 1
74LS145P BCD-to-Decimal Decoder 1
74HC153P Dual 4-input multiplexer 4 Found, not ordered.
HD46505SP Video PPI 1
D8255AC-5 CRTC 1
74HC273P D FLIP-FLOP 1 Found, not ordered.
Z8400AB1 Z80A 4Mhz CPU 1 Found, not ordered.
74HC32P Quad 2-input OR gate 1
74HC244P Octal buffer/line driver; 3-state 1 Found, not ordered.
74HC373P 8-BIT DRIVER 1 Found, not ordered.
M3764-20RS (Or 4614?) RAM 8 Found, not ordered.
74HCU04 Hex unbuffered inverter 1
AMSTRAD 40010/40007 Gate-Array 1
Filed under: Retro 3 Comments
20Mar/180

Barcode Scanner: Cheating in Style.

I picked up a random hand-held barcode scanner from the markets a few months back and it's been sitting on the shelf waiting for a proper reason to exist. Whilst playing a marathon game of Bubble Bobble on the MSX (and losing, we just couldn't beat the boss), I google'd for cheats. They were all enterable via the keyboard on the main screen... but then it occurred to me... A barcode scanner on a PC would be the best way to quickly type in cheats for your game of choice.

The Scanner

This thing is a hand-held model with stand. It's a DataLogic QuickScan QD2100 and the drivers can be found here.

DSC02417

DSC02408 DSC02410 DSC02412

Note that the device will install perfectly well on windows and show up as a HID Compliant Keyboard.


scanner device

Once installed, any barcodes scanned will be input via a virtual keyboard, along with a carriage return! To fix this, I'd assumed we'd install drivers and configure the device via software. It turns out instead that we'll need to directly configure the scanner itself via programming barcodes. Grab the manual here and browse to page 90. Read the instructions that they've mentioned:

  1. Go to page 91 and scan the top programming code.
  2. Scan the Set Global Suffix code
  3. Scroll all the way to page 291 and scan the 0 code twice
  4. Scroll all the way back up and scan the programming code again to exit

Making Barcodes

There's a ton of online sites that'll do this for you. My first hit was Barcodes Inc's online barcode generator. From here, even from the screen, you can zap the codes and test the device. It should all work pretty flawlessly.

Doom

I must admit, as soon as this idea came to mind, this was the game that I thought of first. Yes, it's dos-based and this scanner isn't... but that doesn't stop me from using it under DosBox.


GOD Mode

All Guns/Keys/Ammo/Armor

Show location details

Temporary automap

Temporary radiation suit

Temporary light

Temporary invisibility

Temporary invulnerability

Temporary berserk

Change map detail

Chainsaw

Walk through walls

All Guns/Ammo/Armor

What's Next?

You could use this to automate processes: Run-through an entire game maybe? Play music? Probably nothing at-all worthwhile... but nonetheless still fun!

Filed under: Retro No Comments
16Mar/189

Reveal MusicSTAR MIDI Piano Keyboard

Picked this up at a local tip shop a while ago for cheapcheap and have finally gotten around to checking it out. It's a short MIDI Keyboard from Reveal, model number MKB02. It turns out the company no longer exists; but Creative did try to save them back in the day.

Anyway, the keyboard is really nice. It has the standard IO: Power plug, power switch and MIDI out. On top you'll find buttons to adjust pitch and octaves.

DSC02397

DSC02398 DSC02399 DSC02401

Mine didn't come with an AC adapter, so I purchased the closest 9v 200ma supply I could find.

DSC02406

I was concerned whilst hooking this up as to the polarity of the plug. Usually you get the little symbol somewhere on the unit to dictate where positive is. Every other MIDI device I've seen lately has positive on the outside... but this does seem to be a Japanese thing.

The best way to solve this was to crack the unit open... it's a keyboard nonetheless, so it probably needed an internal clean anyway!

DSC02391 DSC02395 DSC02393

That last photo is of the IO board. The best bit? The power runs in from the DC jack into a friggen bridge rectifier! Why am I so happy/excited about this? It means the polarity doesn't even matter! It more-or-less treats the input as AC and converts it to its own polarity. How good is that!? All devices should do this.

DSC02396

Anyway, the next step was to simply hook it all together into my SC-55. Of course... it just worked perfectly!

Filed under: Retro 9 Comments
14Mar/180

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.

DSC02317

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?

DSC02322

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

DSC02326

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.

DSC02329

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!

DSC02330

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!

DSC02339

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.

DSC02341

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

2Mar/180

A Western Victorian Daytrip: Ararat

There was a model railway show on in Ararat... sure, I could've taken the MR2, but I'm getting old and lazy and therefore shouldered with the geezers onto vintage trains instead.

Getting to Ararat via The Overland

OK, I lied about vintage... well... nearly. The Overland could nearly be defined as vintage. The carriages are from the 1960s, but have been kept reasonably up-to-date. It's an easy trip from Melbourne to Adelaide on this service, or so I believe... I've only been as far as Ararat on it. Ararat needs 3.5 hours, whereas it's a whole daytrip to get to Adelaide.

DSC02171

The consist is loco-hauled and Pacific National gets the honours. Unfortunately, The Overland is provided with a standard NR Class locomotive and isn't offered a livery of its own (unlike The Ghan and The Indian Pacific.) So, due to loco-hauled-goodness, the rake of passenger cars is pulled from the freight yards by a wrong-way-round locomotive into Southern Cross Station. From there, the loco detaches from the rear-end and runs around to the front-end.

DSC02158 DSC02159 DSC02160

DSC02170

From here, we just wait for the XPT to slug off to Sydney prior to receiving a green light. Inside the train, you're presented with a very run-of-the-mill economy class cabin. It's not ugly, it's not uncomfortable... and it's not modern. Actually... with the standard gauge track to Adelaide being what it is (a freight track) the seats really do help! Unfortunately, the carriages are leaf-sprung and so I can only recommend holding on to whatever you can if you're trying to get to the dunny or the bar car.

DSC02172

DSC02174 DSC02176 DSC02175

DSC02177

And yes... I said bar car! Unfortunately it was 8am... so I didn't bother sampling the great wine and beer that Australia has to offer. I did enjoy the view though... it's looking very dry out west!

Ararat

We arrived a few minutes late into a very warm Ararat. The Overland doesn't hang around after dropping-off/picking-up... the engine revved nicely and got out of there in no time.

DSC02181

Straight away there were things to see as VicTrack is currently upgrading the line between Ararat and Maryborough to Standard Gauge. Actually, as I write this, both a grain and a fruit train have traversed the line (at around 20km/h) with revenue services! Two ballast trains were in the yard, but we weren't too sure what they were going to do.

DSC02189

DSC02190 DSC02193 DSC02196

DSC02202

Oh yeah... we were here for a model railway show... it was dismal. I mean, credit where due, thank you to Ararat for putting on a show! But there were only 4 layouts and a few shops. Still, one of my favourites was there!

DSC02228

DSC02249 DSC02251 DSC02234

I need to work on model railway photography! But anyway... what else to do in Ararat? Well... we brought a DJI Phantom with us...

DSC02275

DSC02279 DSC02282 DSC02288

DSC02292

And wanted to catch both BG and SG trains... but we chose a stupid position as I'd gotten confused with the BG and SG and the new SG to Maryborough! Either way, the trains came in and were captured.

DSC02295

DSC02303

Getting Home

That V/Locity that rolled in above took us home at a leisurely rate of 160km/h when possible and on very smooth track. It even sounded a lot healthier than the NR class that towed us in on the more-narrow tracks. There's actually nothing to mention about the trip as V/Line do an amazing job with regional Victoria.

Filed under: AUS No Comments
16Jan/180

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.