Easily Measure Code Coverage in React

This guide will teach you how to easily measure code coverage in React for a project generated with create-react-app. This article is going to use https://github.com/chrishart0/gsd-aws-cdk-serverless-example as an example. Either follow along with your own code or fork that repo. The example repo is a mono repo with a Lambda function backend and a ReactJS front end, we are going to be focusing on the contents of the frontend directory....

March 18, 2022 · 3 min · chart

Sun Tzu's The Art of DevOps: I

If Sun Tzu was practicing modern development methodologies, Sun Tzu’s The Art of DevOps… “Cloud Infrastructure are like unto water; for water in its natural course runs away from high places and hastens downwards… Water shapes its course according to the nature of the ground over which it flows; the infrastructure engineer works out his resource allocation in relation to the load which he is facing. Therefore, just as water retains no constant shape, so in the cloud, there are no hard-coded compute allocations....

March 16, 2022 · 2 min · chart

AWS CDK: Place a Lambda function in specific subnets

I struggled for a while today to figure out how to place a lambda function inside of a given SubnetType of a VPC generated in the same CDK stack. To specify subnets for a lambda function it needs a SubnetSelection object passed in. I expected to find a method of ec2.VPC() which would give me an output with the type SubnetSelection but this doesn’t exist. After some reading of other people’s posts online I found an example which showed what I needed to do:...

January 27, 2021 · 1 min · chart

Quick bash script for testing URL status code

Here is a quick script I have written in Bash to get URL status codes. An application in a container I have been working was failing to retrieve a file from somewhere on the internet. I needed to determine if the issue was with the container(possibly networking related) or the application. I threw together this little reusable script utilizing curl.

December 17, 2020 · 1 min · chart

Using DinkToPDF on Alpine Linux

One of my recent projects has been containerizing a .NET Core 2.1 application which uses DinkToPDF for producing PDFs. I always default to Alpine for my containers. Here I’ll describe using DinkToPDF on Alpine Linux. At the time of writing, the current version of Alpine in 3.12, that is what I started with. My Alpine Linux Environment I am doing my testing in a container built from mcr.microsoft.com/dotnet/core/aspnet:2.1-alpine3.12 The Issue with DinkToPDF This error was getting throw each time I tried to use Dink....

December 16, 2020 · 3 min · chart

Install AWS SAM CLI on Linux without Homebew

The official AWS installation docs for Linux tell you to install Homebew so that you can install the AWS SAM CLI. This is just plain dumb. You should not need to install a new package manager just to install one tool. Below are the steps to follow so that you do not have to. Prerequisites Ensure Python 3 is install Ensure PIP 3 is installed Ensure AWS CLI v2 is installed and configured...

July 17, 2020 · 1 min · chart