stevefenton.co.uk stevefenton.co.uk

AJAX Request Interceptor

This is a little funky script to intercept AJAX requests and raise a simple custom event for everything else in your app to listen to. To use this, you just need to listen for a custom event named `AjaxDetected`. The method, url, and any data is passed in the event detail. document.body.addEventListener('AjaxDetected', function (e) { console.log(e.detail.method, e.detail.url, e.detail.data); }, false); This event is raised by...

stevefenton.co.uk stevefenton.co.uk

Lookup DNS on a Specific Nameserver with NSLOOKUP

The nslookup command is really easy to use. You just type nslookup [host-name] and you get an answer. But what do you do when it looks like it is working, but your monitoring is detecting intermittent issues connecting to a website? The answer is, you check each nameserver individually to make sure they are all giving out the same answer. Find the Nameservers with NSLOOKUP Let’s look up the nameservers for our website. We’ll...

stevefenton.co.uk stevefenton.co.uk

Use PowerShell to Send All Regex Matches to a New File

Yesterday I had to look at a list of stuff on a third-party website and match it up to a list of stuff we control. It took quite a bit of time and some Excel shenanigans to complete the task and as I know it’s going to crop up again, I decided to employ PowerShell to do it in the future. Rather than go through the whole process, we’ll just look at the common bit that you might want to use, which is grabbing a file (in my case an...