Saturday, June 16, 2018

Add Custom HTTP Basic Auth Entries to iCloud Keychain

While automatic filling of HTTP basic auth credentials works fine on the Mac, I have had significant trouble getting it to work on iOS devices. This is especially unfortunate, because while on the road I sometimes need to have a look at monitoring systems that have HTTP basic authentication enabled and that use long complex passwords. Should be easy with iCloud keychain, right? Yeah...

Opening the respective site in iOS Safari pops up the basic auth credentials dialog. It also shows the little key icon in the keyboard toolbar which gives access to iCloud keychain entries. However, while on the Mac the username and password fields are correctly populated, on iOS you cannot even see the respective entry.

Turns out, and I assume this is a bug in iOS Safari, the type of keychain entries shown is limited to "Web form password". Safari on the Mac stores the entry as "Internet Password" though, as can be seen in the Keychain Access application on the Mac:

Knowing that, we just need to change the type or create a new entry in the iCloud keychain. That should be easy, right? Well...

Turns out, there is no way to specify the type when adding a new entry via the Keychain Access app. So that does not help. On to changing the existing "Internet Password" item then... But also no luck there. While you seem to be able to change the type in Keychain Access by just changing the value of the "Kind" field, this apparently has no impact on the actual type in the database underneath.

There is a (kludgy) way, though, that works: Edit any other "Web form password" that was created by Safari (when you allow it save a password for a website with a login form) and then edit the URL, username and password fields in Keychain Access. What caught me at first and almost made me think it didn't work was that you need to hit Cmd-S to save the changes made to the entry. For some reason using the "Save Changes" button in the window did not actually do that.

Getting a new web form entry is also quite easy, without having to actually use a real website. I just saved this minimalistic HTML form to a local file to my local drive as "dummy-password.html" and then served it up to Safari with the Python SimpleHTTPServer:

    <form action="http://localhost:8080/doesntmatter" method="post">
    <label for="username"><b>Username</b></label>
    <input name="username" placeholder="Enter Username" required="" type="text" />
    <label for="password"><b>Password</b></label>
    <input name="password" placeholder="Enter Password" required="" type="password" />
    <button type="submit">Login</button>
Then in the same directory where the file is saved start the HTTP server via Terminal:

$ python -m SimpleHTTPServer 8080

Now, in Safari go to http://localhost:8080/dummy-password.html. It will show you simple password form. Enter the credentials you want to save in the keychain and hit the Login button. Even though you will get an error message displayed, because there is nothing the data can actually be sent to, Safari will nevertheless offer to save what you just entered:

Keychain Access will show the new entry as "localhost". Double click and edit the entry. Remember to save with Cmd-S when done. Notice that it seems to not reliably save multiple changed fields at once. I noticed that while the domain part was correctly saved, the changed port was not. So I went in again and changed the port, which finally made it stick.

After a few seconds they entry showed up on my iPhone, too. Heureka!

One final tidbit: The ordering in the list of credentials shown on the iPhone is a little strange. At first I could not find my new entry (which was a little longer than the one shown in the screenshot above). Turns out, Safari orders them by the second level domain, not by the subdomains. It makes sense insofar as that otherwise most sites would be sorted under "w" (www being a very common subdomain). But when you have something like "" you will find your entry sorted under "", not "monitoring".

Monday, February 05, 2018

Amiga 500 Restoration: A501 Memory Expansion

The previous posts were mostly about cosmetics. This one is more technical, dealing with the repair and some preventative maintenance of the A501 memory expansion card. If you are curious to learn more about the retrobrighting of the computer’s case, don’t worry — I’ll get back to that at a later time.

This is the third post in a series about restoring an Amiga 500 back to its former glory. Here are all of them so far. I’ll try to remember to update this in all related entry.

Amiga Memory — The Basics

When the Amiga 500 was first introduced, it came with 512KB of memory. That was already double the amount the original Amiga 1000 had, but still not a whole lot. Especially when developers started to get familiar with the audio and video capabilities of the machine, RAM became a limiting factor in what you could do. Merely copying a single floppy disk with its 880KB required swapping back and forth between the source and destination disks, because there was no way the contents could be loaded into a memory buffer in one go.

So one of the more popular additions to any stock Amiga 500 was the A501 memory expansion card. There were a few original Commodore revisions, and a plethora of 3rd party clones. They all get installed in the so-called "trapdoor slot", aptly named, because it is reachable by opening a cover on the underside of the computer. With it installed, the Amiga now has 1MB of RAM to work with — a way better baseline for many tasks. I will not go into detail here on the different kinds and speeds of Amiga RAM here. It is a rather complicated story because depending on several hardware and software factors memory could have different speeds and capabilities, especially when it came to the custom graphics and sound hardware. Suffice it to say though, that even the slowest possible expansion is still better than the rather anemic stock 512KB.

When buying my Amiga from eBay I made sure, that it came with a memory expansion. In my case, it even was an original Commodore A501.

The Real Time Clock

In addition to the extra memory virtually all trapdoor expansion boards also add a battery-buffered real time clock. The Amiga itself — apart from very late models — does not have a clock on board. Without one, whenever the power is turned off, the computer forgets the date and time. When you switch it on the next time, it believes it's sometime early in the 1980s, or whatever the last modification timestamp of your boot disk is (which in my opinion is even worse). The A501 fixes that. It brings a clock chip, a very small amount of memory dedicated to keeping the date and time, and a rechargeable NiCd battery to supply the chip while the computer is off. When the computer is on, it gets charged up again. That way software can read the current time and date from the expansion on boot, sparing the user the tedious task of having to set it manually every time.

Batteries don’t age well...

So far so good. Unfortunately, batteries — especially NiCd ones — tend to leak when they get old. When that happens, the chemicals from inside the battery start to corrode and aggressively dissolve anything they come in contact with. Over time, this effect spreads — almost like an infection — across the memory expansion board, destroying the copper traces, solder joints, etc. Given enough time, it will creep into chips and destroy them from the inside. My original Amiga suffered this fate when its battery leaked unbeknownst to me while it was in storage. When I finally tried to use it again years later, it would not even start up to the Kickstart screen, because the damage had spread and eaten parts of the motherboard.

As I remember, it looked quite similar to this poor thing. The pictures were taken from part 1 of Keith Noneya’s YouTube series on meticulously repairing a heavily damaged A501 board. I recommend watching it. The 2nd picture shows that the copper was completely dissolved around where the battery was connected to the board. 




So with my new arrival — which was functioning according to the eBay seller — one of the first starts I took was to remove the A501 expansion from the computer and inspect it closely for signs of battery leakage, before even turning the computer on. To do so, I had to remove the metal shield the board was encapsulated in:

A501 A

To do so, just with the RF shield covering the computer’s mainboard, a series of metal tabs must be opened. Unfortunately, on the A501 they are not just bent over, but also soldered shut. Obviously, Commodore didn’t want curious customers to peek inside. But with a little patience, and armed with a soldering iron, a simple desoldering pump, and some copper braid, I got it open. The pictures show the position of the tabs, and one close up.

A501 C

A501 D

If you intend to put the board back into the metal case later, make sure not to lose the plastic sheet that is inside, insulating the underside of the board from the metal of the case. Without it, you would get random short circuits between the soldering joints! You can, of course, also just leave the shield off afterward. Most of the 3rd-party clones did not even have one in the first place.

Removing the Leaking Battery

Fortunately, at first glance my board was not in a bad shape, even though the battery had definitely already begun to leak. This is what one side of the contacts looked like:

A501 E

The green crust is corrosion, and it has already spread down along the connectors. So it was clear, it needed to be taken off the board. To do so, I heated the soldering points on the underside of the board thought the copper braid. Carefully taking turns heating each of the joints, with a careful but firm pull on the battery from the upper side, it came off after a few cycles. 

A501 H

Once it was out, some minor damage became obvious, but luckily nothing serious:

A501 I

I cleaned the area with an old toothbrush and Q-tips. To neutralize the alkaline battery fluid residue, I used some vinegar first and cleaned everything up later with and isopropyl alcohol. I took a bit of time to make sure the through-hole and the back of the board were also cleaned. Once everything had dried up, it looked not much different from before, just the crusty bits were gone.

With the battery removed, the RAM expansion worked. That was a good start. But of course, it could not keep the time while off anymore. So this needed to be fixed next.

Building a Battery Replacement Board

While in theory I could have gotten an identical or at least similar battery type, that one would be prone to leaking over time, too. So I — and others before me — wanted to use a more common and more reliable battery type as a replacement. The omnipresent CR2032 coin cell has  a nominal voltage of 3V. Even though this is less than the original battery’s 3.6V, the OKI clock chip’s specifications say it can keep working down to 2.0V. With a capacity of about 240mAh (as opposed to only 60-80mAh in the original NiCd), it could theoretically keep the clock chip powered for more than 2 or even 3 years. Good enough for my taste, especially because they are cheap and easy to get, should the need arise.

However, because they are not rechargeable, precautions must be taken to keep the Amiga’s charging current away from it. Otherwise you could be in for some nasty fireworks.

My first idea was to just follow Jan Beta’s lead closely and put a coin cell holder directly onto the A501. However, for a few reasons I decided to modify my approach a bit:

  • The battery holder I bought has a very tight spring keeping the battery in place. Getting it out for replacement takes quite a bit of force, and I didn’t want to risk damage to the A501 in the process.

  • In Jan’s video, you can see that the cell holder does not fit on the board too well, making it a bit difficult to get the A501 into the trap door slot. The same was true for the one I had.
  • This being one of the first things I ever soldered in my life, I wanted to limit the risk for the A501 of me damaging accidentally to a minimum.

So I decided to build a little extra circuit on a piece of perfboard. On that, I would place the cell holder, a diode and some additional resistors, which are recommended by a CR2032 manufacturer. This is what it looks like from the top:

A501 J

I measured 5V charging voltage coming from the Amiga. For that, the PDF linked above recommends at least 200Ω of protective resistance. I only had 150Ω resistors at hand, so in total it is now 300Ω. This is only the second “line of defense” — usually the diode ensures that the battery does not get charged by blocking the charging current from the computer. At the bottom there is a 2 point pin header for jumper wires that then go to the A501.

From below, this is what the board looks like. Notice the I flipped the previous picture, so it aligns with the bottom view.A501 K

Finally, after checking everything with the multimeter, I wrapped the edges and the bottom side of the board with insulating tape:

A501 L

On the A501 I needed to add pin headers, too, to allow me to hook up my little creation. Getting two single pins off of the larger piece took a few tries, because the plastic was rather brittle. But with an old fruit knife and some patience, I managed to do it.

A501 M

A501 N

Putting it all together

With the A501 prepared, I could now connect the external battery holder board with two jumper wires.  

 A501 P

And because thankfully there is quite a bit of free space in the Amiga’s case, I could easily mount the battery board right next to the trapdoor. I put a power strip on the inside of the bottom case and just stuck the board on there:

A501 S

A501 R

The isolating tape sticks to the Power Strip pretty tightly, so I am not worried it will easily come loose. The wires are long enough so that I can take out the A501 through the trapdoor and either disconnect them, or reach in and wiggle off the battery board. This should allow me to safely swap the battery in the future.

Battery Backed up Clock (not) found? 

With all this being done, I confidently booted up a Workbench disk. Just to be greeted with this:

A501 T

I must admit, I was a little disappointed. Should all the careful repair work have been in vain, because in the end the clock chip had been damaged by something in the past? At this point in the Amiga’s startup sequence the setclock load command is called. It tries to load the time from the expansion board. Apparently, it either could not find the clock chip at all, or at least could not read from it.

I continued to boot and attempted to save the time, both using the Preferences application, as well as via a Shell and setclock save. Same error message as before: Battery Backed up Clock not found

Browsing through some forums I learned, that apparently the clock chip memory can get in a corrupt state if it is disconnected from the battery. For these cases, the recommended solution was to run setclock reset. This, however, apparently is not supported on (my) Workbench 1.3, so no luck there.

Fortunately, a little later I came across this thread on with a link to Thomas Rapp’s homepage. In the download area, he offers a little utility called RestartClock. It comes in binary and (assembly language) source code in the RestartClock.lha archive. From what I can tell, it calls the underlying OS clock reset function to bring it back into a known state. So I downloaded it onto my Mac, just to face the next problem: How do I get it onto the Amiga?

File Transfer without a cable — Back to BASIC

With the Amiga RestartClock executable on my Mac, I was stuck. I did not have a serial (null-modem) cable at hand, which I figured I could use to send the file over. But even if I did, I couldn’t find my  RS232-to-USB dongle. So I needed another way to get the program across the air-gap. At this point the prospect of ordering a cable and waiting for it to arrive did not appeal to me very much 🙂

I remembered how back in the day we used to type in pages and pages of program listings from computer magazines, because only very few (expensive ones) came with floppy disks attached. Granted, most of that was done on my first computer, the Atari 800XL, but I digress… So just typing on the Amiga would probably not take very long.

But not having an assembler for the Amiga at hand meant that I needed to bring over the binary version. What I did have was an Extras 1.3 disk with AmigaBASIC on it. I figured, if I hex-dumped the executable on the Mac, I could write a small BASIC program to output these bytes into a new file. This is the program:

OPEN "ram:RestartClock" FOR OUTPUT AS #1A501 U
WHILE n<400
PRINT ".";
IF x<0 THEN x=x+256
PRINT #1,CHR$(x);

DATA 0,0,3,-13,0,0,0,0,0,0,0,1,0,0,0,0
DATA 0,0,0,0,0,0,0,86,0,0,3,-23,0,0,0,86
DATA 72,-25,-1,-2,65,-7,0,-36,0,0,50,60,3,-1,112,0
DATA 32,-64,81,-55,-1,-4,67,-6,0,-51,44,120,0,4,78,-82

The DATA statements at the bottom contain the dumped bytes of the RestartClock executable. The hex dump was created with 

hexdump -e'"%07.8_ad " 8/1 "%03d " " " 8/1 "%03d " " |"' -e'16/1 "%_p" "|\n"' RestartClock

on the Mac. It took me only about 5 passes of double checking them all after the initial entry. And boy, had I forgotten how slow and unwieldy AmigaBASIC is! I figure that the roundabout two hours I spent on this were evenly split between reading up on the Amiga BASIC syntax and functions, finding and fixing mistakes in the hex dump, and waiting for the painfully slow scrolling in listing window. That’s why with my original Amiga back in the day I gave up on the thing, as I recalled. If memory serves, I moved on to "GFA Basic" back then, which I remember as way more responsive.

Anyway, when run, the program reads the bytes from the data area one by one, and adds them to a new file in the RAM disk, outputting some progress along the way. You can see how long that takes for a mere 400 bytes. The first attempts were way slower still, because they contained more on-screen output.

I crossed my fingers and ran the newly created command in a shell:

A501 W

It looked promising, so I then set the date and time in Preferences, saved, and powered off the computer for a good 2 minutes. I then booted into Workbench again, and what do you know:

A501 X

It worked! I was lucky enough to have a Workbench disk "fresh" enough to not barf at the year 2018. Evidently there are different versions of software and hardware around, exhibiting different more or less annoying bugs related to date and time. I found this “Workbench (Issue 139) [PDF]” magazine from 1998 which has few interesting details on this.

Final Remarks

I certainly could have waited for the new RS232-USB-dongle (which has arrived by now, of course). But I really wanted to solve this right then and there, and in retrospect I am glad I did. The whole procedure reminded me, how something that seems trivial – especially by today’s standards – can require some creative thinking. Still, I wouldn't want to go back to regularly transcribing pages and pages of listings from magazines anymore.

Should you go through the same procedure, I highly recommend saving the generated RestartClock program on the Workbench disk (or somewhere other than just RAM disk). When I had to disconnect the battery from the A501 again for some other repairs, the clock was corrupted and needed to be restarted. At that point I was very happy not to have to go through the hex-dump again 😁.

Friday, January 05, 2018

Amiga 500 Restoration: Retrobrighting I

In part one I described how I got and disassembled an Amiga 500 for a thorough cleaning. This part is about my first attempts to restore the grey/beige color the case had originally had, but over time had turned it an ugly yellow.

This is the second post in a series about restoring an Amiga 500 back to its former glory. Here are all of them so far. I’ll try to remember to update this in all related entry.

First Things First

Disclaimer 1: It has been quite a while since my chemistry lessons in school, and even though reading up on the details, combined with what I still remember, left me with some confidence of having roughly understood what’s going on, what follows might be woefully wrong, at is guaranteed to be imprecise. So by no means should you use this as the basis for any upcoming exams 😉. Also, I understand the links provided are not scientific publications, so they themselves might be wrong. If you know better (and can point me to the resources to prove it), I would be happy to hear from you.

Disclaimer 2: Hydrogen-peroxide and products based on it need to be handled with great care. Always wear rubber gloves and, even more important, protective glasses when handling it. I know this might sound like an exaggeration, but I am serious: H2O2 is acidic! Getting it on your skin will cause discoloration and burns. Here’s a picture of my arm where some of the stuff got stuck without me noticing.

Hydrogen-Peroxide Burns on my skin after just a few minutes of accidental exposue

After what could only have been a very few minutes, I felt a stinging pain and could see two burnt spots. It took  quite a while for the pain to subside even after washing off the peroxide. It goes through your skin and starts to make gas bubbles underneath. So if by accident you get some on your skin, quickly rinse if off with clear water!

Getting this stuff in your eyes can cause irreparable damage and even blindness! You have been warned!

Why does plastic turn yellow?

There are quite a few theories out there why the plastic many older electronic devices — including the Amiga — were made of turn yellow over time. Not all of them do, some keep their color well, while others look quite grotesque. The one I bought from eBay looked like this when I got it (and yes, the photo is rather close to what it looked like in person).

Amiga 500, yellowed plastic, straight from ebay

As far as I could figure it out, external influences like heat and UV light gradually break up molecular bonds in the polymers comprising the plastic, leaving free radicals. The presence of bromide flame retardants, often cited as the main culprit, may or may not play a role in this process, but if my layman’s reading of this paper is correct, plastic can change its color regardless. In any case, the changed molecular structure changes the physical properties in several ways. For one, the material can become more brittle, but also, the wavelengths of the light it reflects shift. It seems, free radicals like yellow best, so that’s what they tend to reflect most 😉 (and yes, that smiley is there on purpose).

Fortunately, these chemicals processes can apparently be at least partially reversed by re-adding hydrogen for the free radicals to bond with. Unfortunately just soaking the plastic in water won’t help, because the hydrogen in water is very happily bonded (with oxygen) already. It’s not as simple as one might expect, but in the end, there are always two hydrogen atoms, and one oxygen atom, sticking together; hence: H2O). What's needed is “bachelor” hydrogen, ready to enter a bond with the yellow-loving free radicals.

A rather cheap transport vessel for extra hydrogen is hydrogen-peroxide (H2O2). While it looks similar to regular water, it is less stable and — if pure — usually decomposes into regular water over time. Given the chance, however, the additional hydrogen may also decide to connect with the free radicals in the plastic, bringing it closer to its original structure, and thereby color.

So put in very simple terms, getting plastic de-yellowed should work by just soaking it in hydrogen-peroxide, ideally adding some energy to encourage the chemical to split off the extra hydrogen to facilitate the reaction. 

A Bucket full of H2O2?

Turns out, an Amiga’s case is surprisingly big, meaning that if I wanted to submerge it in hydrogen-peroxide, I would need a large enough container to put the top and bottom cases in, and also quit a bit of hydrogen-peroxide. This would be the ideal solution, because it would ensure the whole surface being in contact with the chemical, hopefully leading to a very even discoloration.

It certainly can be done (see this video on YouTube), but for my first attempts it didn’t seem very practical. Not only did I  not have a suitable container at hand, but (in contrast to The 8-Bit Guy whose video it is) I also don’t live in Texas with an abundance of sunlight. Instead, live in somewhat cloudy Germany. Trying this shortly before Christmas also wasn’t exactly the ideal time of the year in terms of daylight hours.

So I postponed the liquid hydrogen-peroxide plan for a little while.

First tests: Bleaching the power supply with a standard hair bleaching product

I decided to perform the first bleaching experiments on a test object that is typically not the focus of a lot of attention: The power brick. I figured that if something went wrong and the results weren’t good, it would be the part I would least be annoyed by if it didn’t look perfect. It’s usually hidden under the table anyway.

So first of all, I took it apart (turns out, it was quite dirty on the inside, so it was also a welcome chance to clean it) to get the plastic parts ready.

Amiga Power Brick Top and Bottom Case, disassembled, yellow, on plastic wrap foil before bleaching

The underside was considerably less yellow than the top, supporting the theory that exposure to light (or lack thereof) plays an important role in the chemical reactions described above.

I bought the strongest hair bleaching product I could find in a local store. Even though the brick would have fit in a large pot and could have been submerged, I decided to try out this equivalent of the “Salon Creme” used in the 8-Bit Guy video.

I don’t have the packaging anymore, but as far as I remember it did not specify the exact concentration of hydrogen-peroxide anyway. I figured that even the strongest one would probably not exceed the product shown in the video. I was a little concerned, because the list of ingredients contained some additional stuff, including ammonia, perfume and others, but that’s exactly why I picked the power supply as a “guinea pig”. One box of this product sells for around 3€ or 4€ , so it wasn’t a big investment either.

Schwarzkopf commercial hair bleaching product. Amiga Power Brick case part, yellowed, laying next to it.

I mixed the ingredients as per the instructions, producing a white creme that didn’t even smell too bad. I then laid out the case parts on plastic wrap and started applying the creme generously. Once done, I wrapped the plastic film around to prevent the mixture from drying out.

Hair bleaching creme, being applied on the power brick case with a brush. Gloved hands.

Hair bleaching creme, being applied on the power brick case with a brush. Close up.

Power brick case, with hair bleaching creme applied, being wrapped up in plastic. Close up.

Top and bottom power brick case parts, with bleaching creme, fully wrapped.

For the very first attempt, I just let it sit over night, without any light or heat added. I wanted to find out, how much of a reaction I would get without any additional energy. After about 12 hours I unwrapped and rinsed both parts to see… nothing. At least there was no obviously discernible difference between before and after. I won’t rule out that letting this sit for much longer would have produced some change, but I was not patient enough to try. So instead, I repeated the whole thing the next day — with a fresh batch of the white creme.

This time, once both parts were covered and wrapped, I put them into the oven, heated to around 50°C. I deemed this a safe temperature, because I figured a power supply could reach it by itself on a summer day. Apparently my oven is not designed to maintain such a low temperature constantly. I had put in a thermometer next to the plastic parts. Turns out, the actual temperature and the one displayed by the oven itself were quite different. It only reached 50°C on average when the knob was dialed to around 65°C, oscillating by about 10°C in either direction.

Power brick case parts, bleaching creme applied, wrapped in plastic. In the oven, thermometer showing circa 55°C. Trapdoor cover.

The part in the middle is the trapdoor cover for the memory expansion port. It was put in for comparison. It showed almost no yellowing in the first place, and I wanted to see what effect the bleaching would have on original color plastic.

I left it in there for a few hours, regularly checking the temperature and looking for obvious changes. Very quickly the creme increased in volume, getting foamy — similar to shaving foam. Over time, bigger gas bubbles formed. After about 4 hours the bubbles started to disappear. It looked as if the remainder of the creme was beginning to dry out, turning into a something I can only describe as “crisp looking". At that point I decided to take the parts out of the oven.

Even through the plastic film, I could feel that the creme had indeed begun to turn into tiny crystals. I assume, the plastic wrap was not a good enough seal against the constant stream of warm air. So the water in there eventually evaporated. It’s not easy to see in the photos, but I tried highlighting the effect:

Close up of bleaching creme crystals.

I rinsed everything with warm water, using a brush to remove all sticky residue.

Rinsing the power brick top case, using a brush to remove residue.

(Alert readers might have noticed that I am not wearing gloves here. This is because I had forgotten to take a photo earlier and posed again, but only after having thrown the gloves away already).

Even before the parts had completely dried, the effect was already obvious. I had put a small piece of scotch tape on the side of one of the pieces to make the before-and-after comparison easier. 

Power brick after bleaching. Scotch tape on a small patch for reference, still showing the previous more yellow color.

So the bleaching had obviously worked, which can be seen even better in the next photo, with the mouse as a reference. However, the creme drying out had the ugly side effect of getting an uneven, quite blotchy overall appearance. 

Power Brick after bleaching, next to unbleached mouse for color reference.

Lessons learned (so far)

After the two attempts with the hair bleaching creme, I came to the following conclusions:

  • There is obviously enough hydrogen-peroxide in the cheap hair product to counteract the yellowing.
  • Additional energy is needed to achieve an effect in a more reasonable amount of time.
  • UV light is not the only source of said energy — moderate heat works, too.
  • Letting the hair creme dry produces crystalline particles. That causes ugly spots and an overall uneven result. Some of that might also be attributed to uneven application of the creme.
  • The trap door cover hardly changed at all, so the effect on “original” color plastic appears negligible.

In general I'd call this first try a partial success, but there is clearly room for improvement. It was a good idea not to start top case right away. I would have considered a result like this a degradation, not an improvement. So more experimentation was needed. I decided the hair bleaching product was not very well suited for my needs. I don’t know if the same would happen with the all such products, but at least this one's formula seems to produce the dry crystals.

Bleaching the mouse — A bucket pan full of H2O2!

I decided to let the power supply alone for the time being. Instead I replicated the 8-Bit Guy’s setup with liquid hydrogen-peroxide solution on the stove top to “cook” the key caps and the mouse, which I had taken apart and cleaned in the meantime, too.

Some googling suggested hat hydrogen-peroxide solution could be bought in pharmacies in concentrations between 3% and 30%. Apparently most of the stronger hair bleaching products contain around 12%.  

I went to three different pharmacies. In the first two, without only very vague explanations, they offered maximum concentrations of 3% and 6% respectively. Only in the third one did they explain to me, that around the beginning of 2017 there was a change in regulations, requiring sellers to document who bought the stuff and for what purpose, for anything 12% and higher. To avoid the paper work, most pharmacies just stopped selling these concentrations to anyone but business customers. I have no idea why they didn’t just tell me in the first two, but even if they had had it on sale, the prices would have ranged somewhere between outrageous and ridiculous (30€ per liter, at 6%)!

Fortunately I found an online shop that conveniently offered a “six-pack” of 1 liter bottles of 11,9% 😏 H2O2 solution for a very reasonable total price of 20€, including shipping.

H2O2 bottle. 

I decided to start with the mouse, using the same temperature as for the power brick, just this time completely submerging the plastic in the solution on the stove top.

Mouse shell in H2O2 solution, in a pan. Thermometer showing circa 60°C.

Controlling the temperature turned out to be even more challenging. To prevent the solution (and the plastic along with it) from overheating, I had to turn the stove to its lowest setting and move the pot way off-centre, so that only a small portion of it was actually receiving any heat from below.

Pan on stove top, moved way off center for less heat exposure.

With this arrangement — the extractor hood above set to full, and the kitchen window wide open — I waited, checking the temperature and the plastic color regularly. After the first hour, virtually nothing had happened, but little bubbles forming. However, by the time about two and a half hours had passed, the yellowing started to disappear visibly.

After 4 hours the plastic had changed its color enough for me to consider it “original” again, so I turned off the stove and took the mouse out of the hot liquid with some pliers. I rinsed all parts with lots of warm water. 

Mouse top shell being rinsed, held by kitchen pliers. Underside view.Mouse top shell being rinsed, held by kitchen pliers. Top view.

Finally, see this before and after comparison. The first picture was taken right before the procedure began, second one right after rinsing. There is some moisture left between the mouse buttons, so it looks a little darker there in the photo — it actually isn’t.

Mouse shell parts, before bleaching, on white paper for reference.

Mouse shell parts, right after bleaching, on white paper for reference.

The improvement was pretty exciting and got it very close to what I would consider original color. Turns out, though, that even after taking the parts out of the solution, rinsing and drying, the bleaching reaction did not stop immediately. When i looked the next morning, the mouse had become quite a bit lighter still, even lighter than ideally I would have wanted. It does not look bad, it is just not as beige as the Amiga originally was:

Mouse shell. Upper case. 12 hours after bleaching, much brighter. On white paper for reference.

More lessons learned

With the mouse done, here are a few more take aways:

  • The submersion method yields very even effects — just as expected.
  • Pick as small a pot as you can — you’ll need less liquid to cover the parts.
  • You want really good ventilation. Standing right next to the pot for a while made my eyes burn. My wife complained about her throat getting sore.
  • Controlling the temperature is not trivial. This is a consequence of the small amount of liquid and the comparatively low desired temperature (in contrast to what the stove is designed for: cook food) Hence, a thermometer is a must have.
  • The bleaching continues for quite a bit, even when the plastic is taken out of the solution. Factor that in and take parts out sooner rather than later.
  • Don’t reach into the hot solution with your fingers 😉
  • Rinse off with warm, not cold, water. I am not sure this is really necessary, but I figured it would be better than exposing the plastic to a temperature shock.

Armed with this new knowledge, I was confident it would also work for the key caps.

Bleaching the key caps

As laid out in part one, the key caps had already undergone a session of soaking and scrubbing in warm soap water. So they were ready for their bleaching bath.

The setup was exactly the same as for the mouse. Just enough hydrogen-peroxide solution to cover them all. However, due their shape and size, the key caps tended to float, so at least those closer to the surface were not fully covered all the time. To ensure they would still get the most even treatment possible, I used kitchen pliers to turn them all upside down.

Key caps in hydrogen peroxide solution, in a pan. Face down. Small bubbles.

Notice that I removed the metal braces from the larger keys — I did not want to risk corroding them. Some keys would turn around on their own, especially with the little bubbles forming, so I needed to slightly shake the the pot every once in a while to get rid of them and then ensure all caps were face-down again.

With the experience gained from bleaching the mouse I took the keys out about 45 minutes earlier, after just a little more than three hours.

Key caps being poured into a sieve, for rinsing.

In the pictures you can clearly see the special keys having a nice contrast with the letters and numbers. Here are the before-and-after shots, In the top right corner you see the floppy drive eject button, which I threw in, too.

Yellowed Key Caps, before bleaching. Laid out on white paper for reference.Key Caps, right after bleaching. Laid out on white paper for reference.

Interestingly, similar to what I observed with the trap door bay, plastic parts that did not suffer from yellowing before did not seem as receptive to the bleach. You can clearly see this in this detail shot of the space bar.

Key Caps, right after bleaching. Close up angle on different discoloration of the space bar. On white paper for reference.

I let everything dry on a cloth over night, before putting the caps back into the keyboard. There are only very few things to look out for when doing this. First of all, remember that there are two special (smaller) springs that go under the space bar, in addition to the center one which is the same size all others.

Space bar, being put back onto they keyboard, springs on the underside. Close up.

When putting back the metal braces under the larger keys, I noticed that they would not move as easily as before. This is because the bath in the soap water had washed away the grease that makes sure there is no noticeable friction. So I added some synthetic fat to lubricate the points where the braces a hooked into the white receptacles under the keys. For this I used the stuff that came with my coffee machine, because it does not damage plastic over time. WD-40 would not be well suited here. If you go through this procedure, make sure you use such a non-aggressive lubricant.

Return key. Underside. Lubricated metal brace receptacles highlighted.

Lastly, just as some keys had takes more force to pry off the keyboard base plate, some also took more pressure to go back in. At first I thought be springs were not equally sized after all, when I saw several keys stand out about 2 millimeters higher than their neighbors. But pushing them down just a little more decidedly made them audibly click back into place.

Keyboard with a few key caps placed back. Mostly empty still.

I started with the larger keys, because that way you have enough room to work with the metal braces. When all keys were back in place, I put they keyboard back into the case to see how it looked. At that two things became very obvious: First, even though they had spent almost an hour less in the solution than the mouse, the “after-bleaching” was still significant. The regular keys had become almost white, with the contrast to the darker keys significantly less pronounced. But more importantly, it was now very clear that I would now have to come up with a good way to treat the top and bottom case parts 😯.

Bleached keyboard, in still yellowed Amiga case.

A report of how that went will have to wait until next time 🙂.