Category Archives: computing

iOS Safari’s WebSockets implementation doesn’t work with self signed certs

I’m building a Node application hosted on a Raspberry Pi, that will not be connected to the internet. A user will interface with the application through the browser on their phone. The application calls the browser for its GPS coordinates using the HTML Geolocation API.

In iOS, the HTML Geolocation API only works for HTTPS sites. I found an excellent post on Stackoverflow for creating a self signed cert that works in most browsers. I created the cert, added it to my desktop and phone. HTTPS worked great.

I first tried the Node ws websocket library, and the Node application would call out to the browser to fetch GPS coordinates when it needed them.

The application worked great in Firefox and Chrome, but it would not work in the iOS browser. If I dropped to HTTP (vs HTTPS) and WS (vs WSS), it worked fine. For some reason, the iOS browser accepted the cert for HTTPS, but not WSS. Unfortunately, I needed HTTPS to use Geolocation.

I couldn’t get it to work. I ended up moving my application to Socket.IO, which has a fallback method to HTTPS polling if a websocket connection cannot be established. This worked for my scenario. If you need a websocket like capability and have to use self signed certificates on iOS, try Socket.IO.

Alexa skill, written in Node JS, Using Express, with ask-sdk-express-adapter

In 2018, after reading an article on Hackaday, I picked up an Amazon Echo Dot to experiment with building voice interfaces. It was surprisingly easy, and with no experience, I got something up and running in a couple hours.

I haven’t looked at this in a while, and had another project in mind. Looking at the Alexa development documentation today, all the examples leverage Amazon’s Lambda’s compute service. For my project, I didn’t want to use Lambda, I just wanted to use Express on Node JS. Amazon has NPM library for this, ask-sdk-express-adapter, but I couldn’t find ANY end-to-end example, and I struggled for a bit to get it to work. I think it took me longer the 2nd time around!

SO – here’s a simple example, hopefully it’s got the right keywords for anyone who’s stumbling on the same problem. Keywords:

  • node js
  • javascript
  • ask-sdk-express-adapter
  • express
  • sample code
  • example code
  • alexa
const express = require('express');
const { ExpressAdapter } = require('ask-sdk-express-adapter');
const Alexa = require('ask-sdk-core');
const app = express();
const skillBuilder = Alexa.SkillBuilders.custom();

var PORT = process.env.port || 8080;

const LaunchRequestHandler = {
    canHandle(handlerInput) {
        return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
    handle(handlerInput) {
        const speechText = 'Hello World - Your skill has launched';

        return handlerInput.responseBuilder
            .withSimpleCard('Hello World', speechText)


const skill = skillBuilder.create();

const adapter = new ExpressAdapter(skill, false, false);'/', adapter.getRequestHandlers());


Hope that helps!

Playing around with Hugo and different ways of hosting content

When I initially built out this blog, I:

  • wanted a content management tool. I didn’t want to be writing pages in HTML
  • wanted to host it myself. Geocities came and went. I wanted ownership of my hosting.
  • wanted a VM on the Internet anyway. I wanted something always up, that I could host services on. I had hosted PCs on the Internet at home, but with cloud services, I just didn’t need this anymore
  • wanted very low costs
  • needed to support extremely low readership.

So, I built out a tiny VM on AWS I can deploy services on, and it costs next to nothing.

But my content is static. It really makes more sense to host the files on S3, and use a static content generator. It’s much more secure, I don’t have to worry about keeping OSs and applications patched, and it could scale if ever required.

So over Christmas break, I built with Hugo, hosted on S3, fronted by CloudFront, which seemed to be the only way to host content from S3 on my domain with HTTPS. With Hugo (and any other static site generator), you create your content, it applies a template, and creates the links – it reminds me of working with Fog Creek Software’s defunct CityDesk almost 20 years ago. This AWS Hugo Hosting article was really helpful for the AWS setup. I still can’t figure out how to use Hugo’s Image Processing features, but I didn’t need them. The new site is accessible from the ‘Articles’ section up top. I’m not sure if I’ll move everything over or what I’ll do that moving forward.

Detect web skimming with web automation

I was listening to the Darknet Diaries Magecart episode before the holidays and was thinking, “Magecart attacks should be pretty easy to detect with web automation”, so I wrote up how I would do it. If you run a web property that processes sensitive data, it might be of interest. Check it out here:

I have been thinking about changing how I host this site, and decided to try it out for this article – more on this later.

Fixing ink blobs on epson xp-830 prints

Black ink blobs dropped randomly on pages

My Epson XP-830 started dropping black ink globs on my prints, which would smudge and wreck photos. As I had recently installed $150 worth of ink, I didn’t want to just go out and get a new printer. I also liked the compact format of this printer, and wouldn’t just buy the same one, as this was starting to look like a doorstop after its 2nd set of cartridges. I wasn’t concerned about breaking the printer at this point, because I was ready to throw it out.

I managed to resolve the issue – I’ve decided to write about what I did, and perhaps some will find this article and I’ll save a few printers from an early trip to the landfill. I expect this will work for any Epson XP printer.

First, I ordered a print head cleaning kit from Amazon (kit, Amazon link). In hindsight, I don’t actually think this was an issue with my print heads, but I did a number of things all at once, so I don’t know exactly which step resolved my issue. I recommend watching their video before ordering the kit.

The first step was getting the print head out of its right-side dock. Go to the menu, click maintenance, and then click Ink Cartridge Replacement.

Click proceed.

At this point, the print head will have moved to its change cartridge position. Disconnect the power.

I used card stock and paper towels to clean all of the ink I saw in the areas identified by red arrows

At this point, I took out the cartridges, and I wrapped them in plastic wrap, following the guidance of the Print Head Hospital.

I did clean the heads, as instructed in the Print Head Hospital video, but I think what really made the difference for the black ink globs was the following: using cheap papertowels and cardstock, I cleaned up all the ink in the areas highlighted by arrows in the above image. I cleaned under the print head by cutting a ~1″ piece of cardstock, wrapping it with a paper towel, and running it underneath the assembly as shown at the 3:40 mark in the Print Head Hospital video, and repeated until the paper towel would come out clean.

I plugged the printer back in, re-installed the cartridges, ran the regular print head cleaning cycle 3 times (until the test page came out fine), and am now getting perfect prints.

Good luck – hope this helps.

Building SIO2Arduino to enable an Atari 800XL to use SD Cards

Last winter, I built an SIO2Arduino circuit – it is an adapter, that enables the Atari to use disk images loaded on to a regular SD card.

My build of the SIO2Arduino SD Card Adapter
My build of the SIO2Arduino SD Card Adapter

To the Atari, the SD card works just like a floppy drive.  It’s was built following the instructions found here:

With a program called SDRIVE, I can select a disk image on the SD card, and then load it:

Selecting an Atari image on the SD card using the SDRIVE program
Selecting an Atari image on the SD card using the SDRIVE program

I never did get the adapter working perfectly – I can load certain disk images, such as ballblazer, but not others, like Karateka.  I think it would take a lot more investigation, and perhaps digging into code, to figure out how to fix this issue.

ballblazer running on Atari from SD Card
ballblazer running on Atari from SD Card

Until I get a suitable TV, this is likely as far as I’m taking this particular project.

Fragile Media

Am I the only one who worries about data?


In grade 5 (this was in the 80s), I was one of perhaps two kids that typed up my projects in a word processor.  Night before a project was due, WordPerfect 4.2 froze on me, and the 286 I was running it on wouldn’t boot again, and my work was lost.  I had actually printed it, and handed in a marked up draft.  But an important lesson was learned, very early – keep backups.  Note here how resilient the daisy-wheel printed draft was, and how fragile the PC was.

Flash forward to current day.  Most of the work I produce belongs to my employer – I see that data as their responsibility – what they lose costs them, they can back up the work I produce as they choose.

But of interest to me in my personal life is MY data.  And I have lots.  I have lost my fair share of hard drives, floppies, and CD/DVDs over the years.  But I’ve been lucky – apart from:
1) MS Basic 2 games written as a primary school student on a C64
2) email from pre-2001, lost due to silly University data retention policies (and they were silly – I bet that Alumni department wishes they could reach me by email now)
I haven’t lost anything due to reasonable backups.  But I’ve never dealt with fire, loss, or theft.

I have little use for physical media.  I live in an apartment and have little use or physical storage space for prints.  So I’ve prioritized – I have little work or correspondence to back up – all of the physical stuff sits in the top drawer of a small filing cabinet.  I hope for the best for important documents.

Photos of events are shared online – not much use for prints.  Or is there?  I had been copying camera flash cards to a hard drive and optical media.  The optical media is brand name and stored in a dark place, but I still don’t trust it.  I’ve seen photos of myself as a child – I think my daughter deserves the same.  “Oh, Nameless Manufacturer put out a bunch of drives with buggy firmware in 2009 which ate your first step photos” isn’t going to cut it for me as an excuse.

What about music?  I’m still pretty old school – the indie record store across the street shut its doors last year – but I still buy CDs.  Prior to a 2009 hard drive crash, I never backed up my MP3s thinking, “I’ve got the original on CD”.  But I don’t have the time I did as a student – ripping 100s of CDs takes A LOT OF TIME.  As for iTunes – I had fun as a teen flipping thru my dad’s LPs – I don’t think any child born in 2010 will get the chance to hear the music of their parent’s youth (I can imagine “I bought that album BEFORE Apple removed DRM” or “the Avril Lavigne hard drive must have crashed in 2005”).

Hard drives are pretty cheap these days – the last time I bought a drive, I bought two, and set one up to copy over to the other once a week.  The stuff on the 2nd drive never gets deleted – so if I accidentally delete a folder on my working drive, I can get it back on the the 2nd (point in time back ups).  I run Linux at home, and use a little app called Back In Time to accomplish this task.  The last time I looked at this from the Windows side, there was an application called “Dantz Retrospect” that seemed to get a lot of these things right – it seemed like the perfect solution for a small office (I think they’ve since been bought out by EMC).

Of course, as important as making backups is making sure you can restore them.  I have to say, I’m not that forward thinking.  I think I need my own IT employee at home to think this thru.

Backups is actually something I think Apple does best for home users (but, perhaps, still not well) – I think Time Machine is probably the best thing to happen to the masses who don’t really have the time or interest in worrying about this stuff.

This still doesn’t cover loss due to fire or theft.  Fortunately, online storage is pretty inexpensive these days – cheap enough for the data I create, still too expensive and slow for the music and video I consume.  With Linux, I use s3fs to backup my work to Amazon’s S3 online storage service – it costs me a couple dollars a month.  On the Windows side, I haven’t tried either of these solutions but did come across JungleDisk for Amazon S3 backups and in previous searches.

What I don’t understand is why this is still a problem?  Thirty years of personal computing and no one has fixed this.  We’ve got a long way to go.  Anyone think the “cloud” will solve this 🙂