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 / AAA_Docker Minecraft Server README.md
Created December 15, 2022 10:06
This is an Ansible Playbook to monitor a git repo for players to add (or remove) and then restart the relevant docker containers using `docker-compose`. I use this to manage the players on a minecraft server I run.

Docker Minecraft Server

This is an Ansible Playbook to monitor a git repo for players to add (or remove) and then restart the relevant docker containers using docker-compose. I use this to manage the players on a minecraft server I run.

In this repo, you'll find the actual ansible playbook (playbook.yml), the crontab-able run_playbook.sh (which silences unchanged plays) and the template I'm using (templates=docker-compose.yml). There is also an example vars file (host_vars=localhost=vars.yml) to show the basics of what this file would look like. Note that directory structures in gists are not permitted, so I've replaced / with = in each filename.

@JonTheNiceGuy
JonTheNiceGuy / Turn Off Light After Time.yaml
Last active October 7, 2022 13:23
Deprecated - uses wrong selector
blueprint:
name: Turn off Light after Time has elapsed
description: Given a light entity, watch for it turning on, and then turn it off after a certain period of time.
domain: automation
input:
light:
name: Light
description: Select the light to monitor and control
selector:
entity:
@JonTheNiceGuy
JonTheNiceGuy / AAA_README.md
Created June 28, 2022 13:42
Karabiner for OS X Keyboard Remapping
@JonTheNiceGuy
JonTheNiceGuy / AAA VBA Snippets Readme.md
Last active June 3, 2022 14:25
VBA Snippets for Sharepoint Sync, Base64(sha1(AES(MESSAGE))), HTTP requests and other misc functions :)

This code is largely derived from sources found online. As such, I didn't think it was unreasonable to compile it into a series of extracts to use in your own projects.

In here we have code to perform an off-line sync with sharepoint lists, to perform an HTTP request, to check whether tables exist, and drop them if they do, and to produce Base64 encoded SHA1 signed AES ecrypted (with multiple rounds) text.

Function names:

  • ResyncWithSharepoint(URL)
  • SyncTable(TableName) (Note this depends on the tables having a Sharepoint Link already established with the prefix sp)
  • HttpOK(URL)
  • Sleep(microseconds)
  • ifTableExists(tableName, DatabaseFileName)
@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 / create_cert.yml
Last active January 9, 2022 18:31
A simple ansible playbook to create a new self-signed certificate
---
- hosts: localhost
vars:
- dnsname: your.dns.name
- tmppath: "./tmp/"
- crtpath: "{{ tmppath }}{{ dnsname }}.crt"
- pempath: "{{ tmppath }}{{ dnsname }}.pem"
- csrpath: "{{ tmppath }}{{ dnsname }}.csr"
- pfxpath: "{{ tmppath }}{{ dnsname }}.pfx"
- private_key_password: "password"
@JonTheNiceGuy
JonTheNiceGuy / COMBINED TESTING
Created July 8, 2015 09:46
MS Access VBA to perform AES encryption, Base 64 encoding and create SHA1 hashes
Sub test()
Dim SourceString As String
Dim InterimString As String
Dim DestinationString As String
SourceString = ""
InterimString = ""
DestinationString = ""
Do Until Len(SourceString) > 220
@JonTheNiceGuy
JonTheNiceGuy / Building Labs.md
Created September 26, 2016 19:33
Building Labs - A Basic Overview

Building a Lab network

The basics

Jon@Sprig.gs / @JonTheNiceGuy / @g7vri


Overview

  • Introduction
/---------------------------------------------------- Read the following file. Usually just the last 10 characters, but options
| follow.
| /---------------------------------------------- Follow the file, without stopping when it gets to the end of the "defined"
| | size to read.
| | /------------------------------------------- Define the number of lines to read.
| | | /----------------------------------------- Don't read any lines (-n 0) In this case because you might be following
| | | | binary files!
| | | | /--------------------------------------- $() executes the comand within the braces, and uses "STDOUT" as this value.
| | | | | /------------------------------------- Find lists all the files (or directories) which match the criteria.
| | | | | | /-------------------------------- The path to look for files in. All files

Jekyll Git Status

Installing this plugin

  1. Create a _plugins directory in the root of your Jekyll site.
  2. Place the ruby script into that directory. This can be done by either:
    1. Downloading the "raw" version of the jekyll-git-status.rb into that directory.
    2. Cloning this gist into that directory as a submodule.
    3. Creating a new file, with the extension .rb in that path, and pasting in the content below.