Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View JonTheNiceGuy's full-sized avatar

Jon "The Nice Guy" Spriggs JonTheNiceGuy

View GitHub Profile
@JonTheNiceGuy
JonTheNiceGuy / The Rules.md
Last active May 27, 2022 11:30
Transcribed rules for Scotland Yard (lightly edited for clarity), based on the scan at https://boardgamegeek.com/filepage/4035/scotlandyardpdf

Scotland Yard
A compelling detective game

For 3 to 6 Players

The Scene

Mr. X, a most-wanted criminal is on the run in Central London and Scotland Yard's finest detectives are in hot persuit. To escape capture, Mr. X must move cleverly and secretly (Mr. X's whereabouts are revealed only as many as 5 times during the game); to corner Mr. X, the detectives must use ingenuity and cooperation.

One player is Mr. X. All other players are the detectives. Whether one is being chased or doing the chasing, all players travel from location to location by bus, taxi or underground. To take a certain form of transportation, you must be on the correct boarding spot and have the correct fare - no ticket, no ride!

@JonTheNiceGuy
JonTheNiceGuy / AAA_Readme for wp-upgrade.sh.md
Created June 5, 2020 07:20
A simple script to upgrade all wordpress components in cron

wp-update.sh

A simple tool to update and upgrade Wordpress components

A few years ago, I hosted my blog on Dreamhost. They've customized something inside the blog which means it doesn't automatically update itself. I've long since moved this blog off to my own hosting, but I can't figure out which thing it was they changed, and I've got so much content and stuff in here, I don't really want to mess with it.

Anyway, I like keeping my systems up to date, and I hate logging into a blog and finding updates are pending, so I wrote this script. It uses wp-cli which I have installed to /usr/local/bin/wp as per the install guide.

@JonTheNiceGuy
JonTheNiceGuy / ink_level.sh
Last active May 12, 2020 08:17
Canon MG3050 Printer Ink Level reporting tool
#!/bin/bash
rc=0
function matchIP() {
# These regex based on https://stackoverflow.com/a/17871737
if echo "$1" | egrep '^((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])$' >/dev/null 2>/dev/null
then
echo 4
return 4
elif echo "$1" | egrep '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,
4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:

Using Vagrant with Multi-Node MicroK8S to experiment with Kubernetes

This script (using Vagrant) is used to build a pair of Ubuntu based virtual machines that have the MicroK8S setup of Kubernetes.

It also installs docker, and sets up aliases for kubectl in line with the MicroK8S documentation.

Please note that this script relies on the fact that Vagrant transfers files in /vagrant to the host file system, which we can then use to setup the second node.

@JonTheNiceGuy
JonTheNiceGuy / Vagrant + MicroK8S - README.md
Last active February 29, 2024 08:07
Using Vagrant with MicroK8S to experiment with Kubernetes
@JonTheNiceGuy
JonTheNiceGuy / a_readme.md
Created December 17, 2019 10:54
Create CA and Client Certificates on a protected CA Server, and transfer to them to your nodes, using Ansible

Create CA and Client Certificates on a protected CA Server, and transfer to them to your nodes, using Ansible

This is based on https://kapuablog.wordpress.com/2019/11/26/ansible-reading-a-remote-yaml-file/

It has been used in $my_service to generate client certificates on a protected Certificate Authority (CA) server (accessible only to my Ansible Tower/AWX server) and is then distributed to the client nodes.

Thoughts on #SameAs

Preamble

I am not a particularly good coder. As such take these as a suggestion of what could be, not what is happening! If this were to be accepted, it would need to be adopted by all the SSB clients (ssb-server, manyverse, etc). Also, this may be extremely simplistic and may produce far too many messages to the pool very quickly!

I asked on the Scuttlebutt IRC channel, and it was suggested that @MixMix might be interested in this?

Actors

@JonTheNiceGuy
JonTheNiceGuy / ssb_description.sh
Created November 19, 2019 16:14
How to publish an "about" message on Secure Scuttlebutt
ssb_id="$(if command -v jq >/dev/null 2>&1 ; then ssb-server whoami | jq -r .id ; else ssb-server whoami | grep id | cut -d\" -f4 ; fi)"
ssb-server publish --type about --about "$ssb_id" --name "JonTheNiceGuy" --description "Linux advocating geek. Fujitsu Distinguished Engineer since 2018. Blogging @ [jon.sprig.gs](jon.sprig.gs)
[Twitter](https://twitter.com/JonTheNiceGuy)|[FB](https://facebook.com/JonTheNiceGuy)|[LinkedIn](https://linkedin.com/in/JonTheNiceGuy) @ JonTheNiceGuy
🗺️ [Glossop, Derbyshire, UK : Maidenhead Grid: IO93ak](http://levinecentral.com/ham/grid_square?Grid=IO93ak) - Amateur Radio Callsign: [G7VRI](https://hamqth.com/g7vri)
He/Him
SameAs [Blog](@EFWzZK2K+b++CbBszsVkAB+WHlRJtX2kX8ynaJp0nHA=.ed25519), [Mobile](@3SEA7qNZQPiYFCzY6K57f0LTc9l+Bk6cewQc6lbs/Ek=.ed25519), [Laptop 1](@p3gu8eLHxXC0cuvZ0yXSC05ZROB4X7dpxGCEydIHZ0o=.ed25519), [Laptop 2](@3xnWXOEsfSNvazULuT54WL8AxGcUNCRyBPbCWcR/1ow=.ed25519), [Tablet](@ayUZ+IXBH8zX0HLk8A6h9YzIGy+LKy/RDIKJOT/xeVQ=.ed25519), [dispatch.sprig.gs Pub](@xp+Z
@JonTheNiceGuy
JonTheNiceGuy / Vagrantfile
Created August 6, 2019 15:36
Wordpress Development Machine in Vagrant
# Some of this is based on https://peteris.rocks/blog/unattended-installation-of-wordpress-on-ubuntu-server/
# and https://www.hongkiat.com/blog/install-wordpress-locally-vagrant/
Vagrant.configure("2") do |config|
config.vm.define "wordpress" do |wordpress|
wordpress.vm.hostname = "wordpress"
wordpress.vm.provider "virtualbox" do |vb|
vb.name = "wordpress"
end