Blog Posts by Andrew B. Collier / @datawookie


Dynamic User Pages

Month of Gatsby
People socialising in an art deco style.
Suppose you want to redirect paths beginning with @ to a specific user page. For example, the @datawookie path would take you to the user page for handle datawookie. There are probably a few ways to do this, but one approach would be to use dynamic routing. 🚀 TL;DR Show me the code. Look at the 27-dynamic-users branch. This site is deployed here. First let’s set up the user page at src/pages/user. Read More →

Python Security Audit

A Romain centurion guarding a cage of snakes.

Is my code secure? This is something that we should all be thinking (if not worrying) about. A thorough security audit would be the ideal, but what if you don’t have the skills or resources for that? Well, there are some tools that will at least get you part way there.

Read More →

.NET and MySQL in Docker

In the interests of full disclosure, I know very little (very little indeed!) about .NET. But I do enjoy figuring things out. In this post I’ve documented what I learned when trying to connect a simple .NET application to MySQL using Docker Compose. We’re going to try to do this using Docker as far as possible, which will allow me to avoid having to set up .NET on my local machine. Read More →

WordPress Headless CMS

Month of Gatsby
An art deco style image of a garden party with an imposing house in the background.

Not everbody is comfortable crafting web pages directly in JavaScript, HTML or even Markdown. Often content writers are more productive in an environment like WordPress. What if you want to develop your site using Gatsby but allow content writers to still carft their content in WordPress? No problem! You can use WordPress simply as a Content Management System (CMS), then pull the content through into your Gatsby site.

In this post we’ll look at how to set up a Headless WordPress CMS as a source of content for Gatsby.

Read More →

Minecraft Paper Server

A Minecraft character wearing glasses. The landscape and clothing of the character are patterned with newspaper.

The original Java Edition of the Minecraft Server that we installed previously inmplements all of the basic server functionality required for multiplayer Minecraft. But perhaps this is not enough. What if you want to customise the server by installing plugins? In that case you need to install a more sophisticated server forked off the original. The PaperMC Minecraft Server provides a lot of bells and whistles not present in the original.

Read More →

Weekly Digest & Annual Review

A large library with vaulted ceiling.

A quick review of the year.

  • I published 55 posts (including this one).
  • I spent a lot of time working with GatsbyJS for one of my clients. At first I was quite out of my depth, but I slowly figured out more or less how it works. I documented some of my learning in a series of posts.
  • My most popular post is still about Shared Memory & Docker. The runner up looks at how to Install GitLab Runner with Docker.
  • I spent some time compiling data on kayak specifications in the hope of producing a definitive table. It’s a work in progress but it’s already getting quite a lot of interest.

Now onto a few interesting articles from this week, mostly announcements of new versions.

Read More →

Chrome & ChromeDriver in Docker

A whale leaping out of the ocean in the style of Vincent van Gogh.

When I containerised Selenium crawlers in the past I normally used a remote driver connection from the crawler to Selenium, running a separate Docker image with Selenium and accessing it via port 4444. This has proven to be a robust design. However, it does mean two containers rather than just one, leading to a higher maintenance burden and elevated resource requirements.

What about simply embedding Chrome and ChromeDriver directly into the crawler image? It requires a bit more work, but it’s worth it. The critical point is ensuring compatible versions of Chrome and ChromeDriver.

Read More →

SSH Tunnel: Dynamic Port Forwarding

SSH Tunnel: Dynamic Port Forwarding

With a local or remote SSH tunnel the ports on both the local and remote machines must be specified at the time of creating the tunnel. But what if you need something more flexible? That’s where Dynamic Port Forwarding comes into play.

Read More →

SSH Tunnel: Remote Port Forwarding

A tunnel with large yellow earth-moving equipment.

Local and remote SSH tunnels serve the same fundamental purpose: they make it possible to securely send data across an unsecured network. The implementation details are subtly different though. A local SSH tunnel acts like a secure bridge from a local machine to a remote server. It’s ideal for accessing services on the remote server which aren’t publicly exposed. Conversely, a remote SSH tunnel reverses this direction, forwarding traffic from the remote server back to a local machine (or another machine).

The critical distinction between the two is the direction of the connection between the remote and local machines.

Read More →