Skip to content

Instantly share code, notes, and snippets.

Jon "The Nice Guy" Spriggs JonTheNiceGuy

Block or report user

Report or block JonTheNiceGuy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View AAA_Readme for Sanitized Outlook Event

Sanitized Outlook Event Forwarding

This is an example of what I use with my work calendar, when I need to forward something to my personal calendar.

This macro does not include any of the meeting content (who will be there, what the content is), but is just to block out the time to prevent your personal and professional lives from overlapping. This macro will create a new appointment for the time window, optionally including the subject (or replace it with [WORK]) and optionally including the location (or replace it with [WORK]).

After the invite has been sent, it deletes the invite, so it doesn't look like you've got two meetings at the same time.

JonTheNiceGuy / AAA_Readme for
Created Apr 25, 2019
Three-way sync on Keepass files, using Keepass2 and KPScript on a Linux based system.
View AAA_Readme for

This script is used if you want to do a three-way sync between (for example) Dropbox, Nextcloud and Syncthing (depending on your personal deployment capabilities).

It should be relatively easy to determine what tweaks are needed to reduce this to a 2-way sync, or up to a 4, 5 or even 6 way sync.

View AA_Mapping between FGT TZ and

Mapping the FortiGate Timezone Field with the TZ Database

This yml file shows the relationship between the tz_database values for regions (e.g. Europe/London) and the Fortigate "system global timezone" value (e.g. 25 = Europe/London).

The TZ Database names are taken from a Wikipedia entry on TZ values, and the Fortigate values are found by me splitting the strings (on comma's) from when I have tried auto-completing the timezone field on a Fortigate model.

It is not a perfect list! Updates welcome!!

JonTheNiceGuy / AA_Manipulating yaml tree data using
Last active Feb 21, 2019
Manipulating yaml tree data using Ansible
View AA_Manipulating yaml tree data using

Manipulating yaml tree data using Ansible

I sometimes need to convert from a dictionary tree (like in data.yml) to a specific json formatted output file using Ansible.

In this case, I've used a combination of set_fact, a for loop and a combine filter to build my output. I'm also using a regex_search to make sure I'm only getting records where the data I'm interested in is there!

Hope it's useful to people!

JonTheNiceGuy / create_cert.yml
Last active Jun 6, 2019
A simple ansible playbook to create a new self-signed certificate
View create_cert.yml
- hosts: localhost
- dnsname:
- tmppath: "./tmp/"
- crtpath: "{{ tmppath }}{{ dnsname }}.crt"
- pempath: "{{ tmppath }}{{ dnsname }}.pem"
- csrpath: "{{ tmppath }}{{ dnsname }}.csr"
- pfxpath: "{{ tmppath }}{{ dnsname }}.pfx"
- private_key_password: "password"
JonTheNiceGuy /
Created Jul 27, 2018
This script is a simple script to redirect you from your site to other locations. It's a very basic short-link generator.


This script is a simple script to redirect you from your site to other locations. It's a very basic short-link generator.

JonTheNiceGuy /
Last active Jun 27, 2018
A "simple" shared-hosting Ansible setup for Cachet

Cachet on Docker with Ansible

This is not a "best-practice" example of doing any of these tasks. The nginx stuff could probably do with being moved into roles, and I could probably move the variables into a file handling that... however, as a POC, it works.

JonTheNiceGuy /
Last active Jun 26, 2018
The following scripts are tools I use on a regular basis to run simple activities on the K5 platform.

The following scripts are tools I use on a regular basis to run simple activities on the K5 platform. They can fairly easily be modified to work with OpenStack (and, probably in many cases, will work without modifications).

These are all written by me in my spare time, and are released under the WTFPL.

JonTheNiceGuy /
Created Dec 5, 2017
Start a Google MusicManager session in another account
while ! ping -c 1 2>/dev/null >/dev/null ; do
echo Waiting for network...
ssh -X bloggsf@localhost -i ~/.ssh/gmm.id_rsa /opt/google/musicmanager/google-musicmanager
JonTheNiceGuy /
Last active Dec 5, 2017
Run GUI commands as other users, without having to SSH to that user account.

runas for Unix-like Systems

Download these two files, and place them in /usr/local/bin. Chmod them to 755, and chown them to root:root.

Then, perform the following command:

runas -u someuser command


You can’t perform that action at this time.