James Flower

.NET Developer working on the web and cloud

Will WebAssembly (Wasm) replace JavaScript?

Posted on
5 min read

Ever since JavaScript was created in 1995 it has formed a key part of providing interactive experiences on websites. However, since WebAssembly (Wasm) support is now available in major browsers, will it be able to hold out against the competition, or will WebAssembly replace JavaScript as the essential tool for client-side development on the web? I think there are several factors that will drive or slow developers to adopt WebAssembly as a JavaScript replacement. These are, the current l

Read more...

Duplicate Validation Messages with FluentValidation in ASP.NET Core 6 MVC

Posted on
6 min read

Validation is an important step when handling data from a request in ASP.NET Core 6. FluentValidation is a popular .NET library which can make validation your models easier. It allows you to define your validation rules in a single place and integrate custom logic for your validation, which would require you to make a new filter if you used data annotations. However, in ASP.NET Core 6 MVC there was a change in the project template that could result in seeing data annotation produced vali

Read more...

Install a Self-Hosted VPN with PiVPN on a Raspberry Pi

Posted on
6 min read

The Raspberry Pi is a very useful and versatile computer you can use to host and run a variety of services from your own home. An example of this is Pi-hole which allows you to implement network-wide ad-blocking for all your devices. However, when you’re away from your network (for example on a mobile device or laptop) you won’t get the benefits of this ad-blocking. You also won’t be able to connect to other services running on your network. PiVPN can help with this by allowing you

Read more...

Add Git Information (and more) to Windows Terminal (or PowerShell)

Posted on
5 min read

I’m a fan of Windows Terminal – it makes it easier for me to manage my terminal windows in a tabbed interface and makes it easy to access a terminal for either my Windows machine or the WSL guest in one interface. But sometimes, it is useful to add a bit more context to your terminal window, besides just your current working directory. This additional information might be the current Git branch (or other Git repository details), execution time of commands, system resource usage, or a wid

Read more...

Using Cloudflare Access and tunnels to create an RDP jump host

Posted on
7 min read

Cloudflare Tunnels are a useful way of allowing private services to be accessed remotely, without exposing the devices to inbound connections. This can be combined with Cloudflare Access to provide a secure way of accessing services such as remote desktop. These services can be used to setup a bastion inside a private network. The bastion will then permit a connection to be made to a destination device on the private network. Setting up the Cloudflare Access Application The fi

Read more...

Network-wide Ad Blocking with Pi-hole

Posted on
6 min read

Ads can sometimes be a bit frustrating, or turn up in places we don’t expect. For example, ads on subscription-based services. Serving ads can also consume a substantial amount of bandwidth on some sites. There are a variety of ad blocking browser extensions you can install (such as Adblock Plus or uBlock) on your computer to block ads. However, you have to install these on each device you use, and some devices like TVs and games consoles, don’t support extensions. It would be much

Read more...

Configuring a Vue.js SPA with Environment Variables

Posted on
4 min read

In a previous blog post I showed how to set up ASP.NET Core Web API to support a Vue.js client SPA. In this post I will show how to extend on that example so that the Vue.js SPA supports a development and production configuration. Since I am extending the previous example, I am assuming the API is available at http://localhost:5000 when in development and for this example I will assume that the production API is available at https://example.com. Creating the configuration files

Read more...

Removing Sensitive Information from Git with git-filter-repo

Posted on
4 min read

Git has become the de facto standard in source control. Over 90% of respondents to the 2021 Stack Overflow Developer Survey indicated that they use Git. However, sometimes mistakes can be made and sensitive or secret information accidentally end up in the commit history. Thankfully, tools such as git-filter-repo exist to help rewrite history (the history of a git repository anyway)! In this post, I am going to go through using git-filter-repo to scrub a password or secret from a git repo

Read more...

Supporting Multiple WS-Federation Authentication Schemes in ASP.NET Core

Posted on
5 min read

ASP.NET Core allows you to add support for multiple authentication schemes, such as social auth providers or WS-Federation. This support can be added with or without ASP.NET Identity Core. Users can then use these schemes to authenticate with your web application. While adding support for social authentication providers (such as Twitter and Facebook) is useful, sometimes applications need to support for multiple authentication schemes of the same type. An example of this would be support

Read more...

Install Docker Engine without Docker Desktop on Windows

Posted on
4 min read

Docker have recently announced changes to their pricing and subscriptions which require a paid subscription for users outside of personal, education and small business use. It seems that this license change only applies to Docker Desktop which is the GUI client for Windows and Mac. The good news is that you can install the Docker Engine on Windows using Windows Subsystem for Linux 2! The bad news is that you won’t have easy access to the GUI to manage containers; you’ll have to use the C

Read more...