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
@JonTheNiceGuy
JonTheNiceGuy / Vagrantfile
Created Aug 6, 2019
Wordpress Development Machine in Vagrant
View Vagrantfile
# 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
View AAA_Readme for Sanitized Outlook Event Forwarding.md

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
JonTheNiceGuy / AAA_Readme for KPSync.md
Created Apr 25, 2019
Three-way sync on Keepass files, using Keepass2 and KPScript on a Linux based system.
View AAA_Readme for KPSync.md

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 TZ_DB.md

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
JonTheNiceGuy / AA_Manipulating yaml tree data using Ansible.md
Last active Feb 21, 2019
Manipulating yaml tree data using Ansible
View AA_Manipulating yaml tree data using Ansible.md

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
JonTheNiceGuy / create_cert.yml
Last active Aug 12, 2019
A simple ansible playbook to create a new self-signed certificate
View create_cert.yml
---
- 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 / AAA_Redirector_README.md
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.
View AAA_Redirector_README.md

Redirector

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

@JonTheNiceGuy
JonTheNiceGuy / AAA_Cachet_on_Docker_with_Ansible.md
Last active Jun 27, 2018
A "simple" shared-hosting Ansible setup for Cachet
View AAA_Cachet_on_Docker_with_Ansible.md

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
JonTheNiceGuy / AA_K5_Simple_Scripts.md
Last active Jun 26, 2018
The following scripts are tools I use on a regular basis to run simple activities on the K5 platform.
View AA_K5_Simple_Scripts.md

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
JonTheNiceGuy / gmm.sh
Created Dec 5, 2017
Start a Google MusicManager session in another account
View gmm.sh
#!/bin/bash
while ! ping -c 1 8.8.8.8 2>/dev/null >/dev/null ; do
echo Waiting for network...
done
ssh -X bloggsf@localhost -i ~/.ssh/gmm.id_rsa /opt/google/musicmanager/google-musicmanager
You can’t perform that action at this time.