Skip to content

Instantly share code, notes, and snippets.

View JonTheNiceGuy's full-sized avatar

Jon "The Nice Guy" Spriggs JonTheNiceGuy

View GitHub Profile
spriggsj@Minilith:~/HTIW/one$ ~/showoff/bin/showoff serve
WARN: pdf generation disabled - install pdfkit
-------------------------
Your ShowOff presentation is now starting up.
To view it plainly, visit [ http://localhost:9090 ]
To run it from presenter view, go to: [ http://localhost:9090/presenter ]
@JonTheNiceGuy
JonTheNiceGuy / Redirect.php
Created March 21, 2014 21:54
This script is deployed on jon.sprig.gs/redirect.php and those are linked to from /var/www/t -> /var/www/redirect.php etc.
<?php
switch($_SERVER['REQUEST_URI']) {
case '/t/':
case '/@/':
case '/twitter/':
redirect("https://twitter.com/JonTheNiceGuy");
break;
case '/fb/':
case '/facebook/':
redirect("https://www.facebook.com/JonTheNiceGuy");
@JonTheNiceGuy
JonTheNiceGuy / ec2_start.php
Created June 5, 2014 20:19
This code snippet lets you start an EC2 instance using the PHP SDK (and means you don't need to spin up a JVM for it)
<?php
// This code is released under a CC-Zero license
// https://creativecommons.org/publicdomain/zero/1.0/
// You need the AWS SDK - get the zip file from here:
// http://pear.amazonwebservices.com/get/aws.zip
// And then unpack it to this directory.
require dirname(__FILE__) . '/aws-autoloader.php';
// Use the Ec2Client libraries by referring just to Ec2Client

Keybase proof

I hereby claim:

  • I am JonTheNiceGuy on github.
  • I am jontheniceguy (https://keybase.io/jontheniceguy) on keybase.
  • I have a public key whose fingerprint is 165D CE43 94BA 1D2B 5C40 77D8 46C7 BB36 7C28 E565

To claim this, I am signing this object:

@JonTheNiceGuy
JonTheNiceGuy / compare.sh
Created December 23, 2014 13:37
Migrate audio files to OGG format
#!/bin/sh
if [ -z "$2" ]; then
dpath=/media/usb0/Multimedia/Audio/
else
dpath="$2"
fi
if [ -z "$3" ]; then
spath="`pwd`"
else
spath="$3"
@JonTheNiceGuy
JonTheNiceGuy / Links
Last active August 29, 2015 14:13
I am who I am...
@JonTheNiceGuy
JonTheNiceGuy / ddns-update-multi-source
Last active May 1, 2019 00:28
This is a DDNS updater for the freedns.afraid.org service. It updates the DNS entries for two separate connected IP networks (for example, if you have work and personal ADSL) by amending the routing on the box. Note, you'll still need proper routing once it's inside your network!
#! /bin/sh
# Authored by Jon Spriggs (jon@sprig.gs) on 2015-03-10
# Based on the DDNS script at afraid.org
#!/bin/bash
# ALTERNATE ROUTE
# This is the path for the second DDNS update to take
NEW_ROUTE=192.168.1.1
# TUNNELBROKER.NET CONFIGURATION
@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 / Regex To Match Interface Details
Last active March 24, 2020 15:21
Regex to match Interface details
IPSO Trunked Non-VRRP (run ifconfig -a)
lname\s+([^>]+)\s+flags[^>]+>\s+vlan-id\s+(\d+)\s+inet mtu \d+\s+(inet ([\d+\.\d+\.\d+\.\d+]+)|([\d+\.\d+\.\d+\.\d+]+))\/(\d+)\s+broadcast\s+\S+[^>]+>\s+ether\s+(\S+)
ifname 1
vlan 2
ip 4 or 5
subnet 6
mac 7
IPSO Trunked VRRP (run ifconfig -a)
@JonTheNiceGuy
JonTheNiceGuy / Vagrantfile
Created August 12, 2015 13:57
Make your Vagrantfile pull from a common puppetserver rather than using local modules
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.hostname = "demo.lan"
config.vm.network "public_network", ip: "192.0.2.1", bridge: "eth0", :use_dhcp_assigned_default_route => true