Updated: 26 September 2025
Notes
- https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API
- Cloudflare:
HTTP_CF_IPCOUNTRY
HTTP_CF_IPCITY
HTTP_CF_CONNECTING_IP
- Peek the client timezone / locale
Freelance software engineer United Kingdom
Updated: 26 September 2025
HTTP_CF_IPCOUNTRY
HTTP_CF_IPCITY
HTTP_CF_CONNECTING_IP
Updated: 17 September 2025
The Selling Partner API is a REST-based API that helps Amazon selling partners (i.e. sellers or vendors) programmatically access their data on orders, shipments, payments, and much more.
https://developer-docs.amazon.com/sp-api/
Amazon Business APIs are REST-based APIs. These APIs help Amazon Business customers programmatically access data on their orders, shipments, payments, and much more. They can also be used to create customized Amazon Business-like discovery and shopping experiences on authorized and Amazon-approved third-party sites.
https://developer-docs.amazon.com/amazon-business/
Amazon’s Product Advertising API, is a web service that gives application programmers access to Amazon’s product catalog data. It enables products to be listed and/or sold through third-party websites and applications.
Updated: 22 July 2025
See https://ubuntu.com/tutorials/how-to-install-a-windows-11-vm-using-lxd#1-overview
Install LXD snap
sudo snap install lxd --channel=latest/stable
lxd --version # 6.3 at the time of writing
Install the LXD imagebuilder
sudo snap install lxd-imagebuilder --classic --edge
Initialise lxd and accept all the defaults
lxd init
If your Win11 VM has no internet access, it may be necessary to adjust the Firewall rules of the LXD bridge network.
See https://www.cloudwizard.nl/lxd-ufw-configuration-ubuntu-22-04/
This was necessary with an Ubuntu 24.04.2 LXD host, April 2024
sudo ufw allow in on lxdbr0
sudo ufw route allow in on lxdbr0
sudo ufw route allow out on lxdbr0
sudo ufw disable && sudo ufw enable
From the directory where the Windows ISO file has been downloaded
sudo lxd-imagebuilder repack-windows Win11_24H2_English_x64.iso win11.lxd.iso
Create the empty vm
lxc init win11c --vm --empty
Using 80GiB here instead of 50GiB
lxc config device override win11c root size=80GiB
Set CPU and RAM
lxc config set win11c limits.cpu=4 limits.memory=8GiB
Set TPM
lxc config device add win11c vtpm tpm path=/dev/tpm0
Insert the ISO
lxc config device add win11c install disk source=/home/chris/win11.lxd.iso boot.priority=10
Start the container. Hit Enter key (immediately) inside the console (on this first occasion only) to boot from the ISO
lxc start win11c --console=vga
Reconnect via the console, each time Windows reboots
lxc console win11c --type vga
Choose Windows 11 Pro N
Skip setting device name
Choose ‘Set up for work or school’
Select ‘Sign in options’
Select ‘Domain join instead’
Choose ‘Join domain’
Remove the install ISO disk
lxc config device remove win11c install
Drivers might need to be updated. In my case only one display resolution was available. See https://discuss.linuxcontainers.org/t/how-to-increase-display-resolution-of-windows-vm/23508
Download virtio-win.iso
from https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.271-1/
Add the downloaded ISO as a device to the VM
lxc config device add win11c thedrivers disk source=/home/chris/Downloads/virtio-win-0.1.271.iso
Go to the CD Drive in Windows and run virtio-win-gt-x64.msi
Updated: 10 January 2025
The bash script. Outputs a sorted and unique list of email addresses
#!/bin/bash
curl --silent https://lots-of-emails.example.com | \
grep -Po --file=email-regex.txt | sort | uniq
The --file
option to grep reads the pattern to find from a file.
See here for an example email matching regex.
Updated: 16 December 2024
I’m kicking-off an open-source project to create a Git Graph GUI tool, which has a feature set and functionality perfect for my requirements. If you would like to assist, please email me and / or create a pull request.
My project is Sourcegit Stripdown, a fork of https://github.com/sourcegit-scm/sourcegit. The objective is to remove from the upstream all the functionality which can be performed from the command line and leave only:
The project uses the .NET Avalonia UI framework and the C# programming language.
Updated: 09 September 2025
The number of options for getting started with Latex on Ubuntu is little overwhelming! This is what I did:
Install texlive
at approx 250MB
sudo apt install texlive
You might also need texlive-latex-extra
sudo apt install texlive-latex-extra
Then, from this answer on StackOverflow, create file test.tex
\documentclass[a4paper,12pt]{article}
\begin{document}
The foundations of the rigorous study of \emph{analysis}
were laid in the nineteenth century, notably by the
mathematicians Cauchy and Weierstrass. Central to the
study of this subject are the formal definitions of
\emph{limits} and \emph{continuity}.
Let $D$ be a subset of $\bf R$ and let
$f \colon D \to \mathbf{R}$ be a real-valued function on
$D$. The function $f$ is said to be \emph{continuous} on
$D$ if, for all $\epsilon > 0$ and for all $x \in D$,
there exists some $\delta > 0$ (which may depend on $x$)
such that if $y \in D$ satisfies
\[ |y - x| < \delta \]
then
\[ |f(y) - f(x)| < \epsilon. \]
One may readily verify that if $f$ and $g$ are continuous
functions on $D$ then the functions $f+g$, $f-g$ and
$f.g$ are continuous. If in addition $g$ is everywhere
non-zero then $f/g$ is continuous.
\end{document}
Create a .dvi
file
latex test.tex
xdvi is an open-source computer program for displaying TeX-produced .dvi files under the X Window System on Linux.
Optionally, view the output file with xdvi
xdvi test.dvi &
Produce a pdf
pdflatex test.tex
Updated: 11 August 2024
I often create and edit Customer demo apps, with Docker. I’ve found it very useful to serve all of these apps behind one Nginx reverse proxy webserver. The notes below show how I achieve this with the Digital Ocean Nginx config tool and deployment of the config with git.
Each demo needs a URL which can be given to the Customer. I tend to use subdomains of my business domain e.g. http://a-demo.christaylordeveloper.co.uk. For each subdomain I configure an A-record, pointing at the IP address of the LEMP server.
/etc/nginx/
directoryAt some point you will need to add, edit or remove the Docker applications:
nginxconf.txt
. This restores your configuration into the Digital Ocean tool.Updated: 27 July 2024
sudo yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
sudo rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
sudo yum install -y mysql-community-client
Updated: 06 July 2024
Updated: 08 April 2024
See https://www.atlassian.com/git/tutorials/dotfiles
See https://news.ycombinator.com/item?id=11070797
Create a bare repo in directory dfs
git init --bare $HOME/dfs/.gitdfs
Create a handy alias in your .bashrc
file
gitdfs='git --git-dir=$HOME/dfs/.gitdfs --work-tree=$HOME'
Set a flag for this repo only, which hides untracked files
gitdfs config --local status.showUntrackedFiles no
Now, any file in $HOME
can be versioned with normal commands
gitdfs status
gitdfs add .vimrc
gitdfs commit -m "Track my .vimrc file"
gitdfs push
Show the files tracked so far
gitdfs ls-tree -r the_branch --name-only