Today so far has been a comedy of errors with some web programming I wanted to do. A confederacy of dunce issues, one after the other.
It started with some work I’d been doing yesterday with the URL shortener code I use for my jmbk.nl links. The web hosting I have for the domain on GoDaddy is a couple of months from its renewal date, but, to be honest, what I’m paying for it (about $7 a month) is not worth it. I’ll move it to Azure, I thought to myself. Let’s see what amount of work it would take. The code is dead simple: a web service on top of SQL Server, so no sweat there. Let’s take a look at the SQL database: should be simple since there’s only one table. I fired up SSMS and did a few queries … but what’s that? A row in the ShortUrl table showing well over 100,000 hits (that is, that particular short URL has been followed that many times), whereas all the others were less than a thousand. Wut?
var linkElement = $("#shortLink"); var realUrl = encodeURIComponent(linkElement.attr("href")); $.getJSON(...);
Lo and behold, this code was getting run for everybody, but the HTML element only existed for me in god mode. In other words,
linkElement was being set to an empty jQuery object, the call to
attr() was therefore succeeding but the return value was
undefined. And that was being converted by
encodeURIComponent() to “undefined”. Yessss!
I changed the code completely so that it’s only loaded in god mode and also – just in case – to check that
linkElement actually existed before making the callback. Brilliant! I updated the site, tested it in Firefox (my usual browser) and also for fun in Microsoft Edge.
I’ve set up all my browsers to have my personal website as the home page in each. So, as soon as I started Edge, it displayed my personal home page … with a malware warning.
So if my site and contents are fine, why is it being reported as a “harmful'” website? Time for more investigation.
I nipped over to MX Toolbox because it has an option to check if a site has been blacklisted. (Aside: I can’t remember why or how I found this site in the first place, it was several years ago. But it’s dead handy.)
Ah ha! It’s not my site that’s been blacklisted, it’s the IP address of the hosting. And that is an Azure hosting IP address: there must be hundreds if not thousands of domains hosted there.
I clicked on the first item (CBL), and that site told me that “IP Address 22.214.171.124 is listed in the CBL. It shows signs of being infected with a spam sending trojan, malicious link or some other form of botnet.” It also reported the domain name of the site where the malware was detected: a PHP-based site. I tell ya: PHP is a great language for writing server software (WordPress is written in it), but you have to be really on top of security updates and make sure you are fully up to date. (One of the features of god mode on my blog is a display of the links people are accessing the site with that cause a 404 “not found” error, and it’s 95%+ script-kiddie probes for various PHP pages or WordPress admin links. I personally wouldn’t touch PHP with a bargepole.)
OK, so all in all it’s a problem for the Azure guys: there’s absolutely bugger all I can do about removing my site from this blacklist. But where to report it? I certainly wasn’t about to invoke a paid Azure support ticket. After a bit I decided to tweet about the issue and included @AzureSupport in the tweet. A few minutes later, someone there sent me a tweet with the proper issue-reporting link, so I reported it there. Let’s see what happens.
Now … where was I?
Over the Christmas break, when traditionally things are a little quieter at work, I do a bit of research into topics that interest me and that might have some bearing on our future products. This year was no exception and I decided to investigate React , Facebook’s library (framework?) for building user interfaces for the web. It’s a fascinating library to be sure (and I’ll talk more on it in another post), but there was one paradigm it uses which I haven’t really talked about before: immutability...READ MORE
OK, call me dense. I had a problem: the new theme I have for this blog has cute little buttons for the social networks I belong to and use; they’re at the bottom of every page. Internally they use Font Awesome to deliver the individual icons. On my desktop browsers: no issue, they look great. On my iPhone? What. The. Heck. Although you can pretty easily scroll to the bottom of the page to look at them, here’s what they are supposed to look like, this from a desktop browser: Social buttons So, four...READ MORE
As I’ve reported on the blog for my Volvo 1800S (aka 64SAINT), it’s being featured in episode 5 of season 20 of My Classic Car with Dennis Gage. The preview has just gone up on YouTube Even the video still features 64SAINT… The full episode will be available on YouTube after it’s aired on various car-related TV channels. So, later in February, I’m guessing. Now playing: The The - Perfect (from Soul Mining )...READ MORE
Over the New Year break, I decided it was time for a change here on the Algorithms for the Masses blog. Not necessarily a full-blown New Year Resolution, more a general feeling that the current theme was old in the tooth, had accumulated a whole bunch of cruft (and how!), and it was time to chuck it in the bin of history. Time for something clean, and, horror, responsive. Having made the decision, it was time to go check out the themes on offer out there in the big wide world. ThemeForest is great...READ MORE