Skip to content

Instantly share code, notes, and snippets.

View halfordfan's full-sized avatar

Toby Creek halfordfan

View GitHub Profile
@halfordfan
halfordfan / checkmkgateway
Created April 23, 2024 19:47
A phpshellsession file for use with pfSsh.php to monitor gateways using the CheckMK agent
/*
* Based on status_gateways.php
* Place in /etc/phpshellsessions
*
* part of pfSense (https://www.pfsense.org)
* Copyright (c) 2004-2013 BSD Perimeter
* Copyright (c) 2013-2016 Electric Sheep Fencing
* Copyright (c) 2014-2023 Rubicon Communications, LLC (Netgate)
* Copyright (c) 2010 Seth Mos <seth.mos@dds.nl>
* Modified 2024 Toby Creek for use with pfSsh.php and CheckMK
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Migration Layer</title>
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.7.1/dist/leaflet.css" integrity="sha512-xodZBNTC5n17Xt2atTPuE1HxjVMSvLVW9ocqUKLsCC5CXdbqCmblAshOMAS6/keqq/sMZMZ19scR4PsZChSR7A==" crossorigin=""/>
<style>
html,body{
margin: 0;
@halfordfan
halfordfan / crashplan.php
Last active July 15, 2024 13:16
A local Check MK plugin for monitoring CrashPlan for Small Business on Linux
#!/usr/bin/php
<?php
/*
* Crashplan local plugin written for Check MK
* By Toby Creek
*
* Installation:
* 1. Copy to /usr/lib/check_mk_agent/plugins/crashplan
* 2. chmod +x
@halfordfan
halfordfan / smashing.py
Last active July 14, 2020 21:10
Python class to POST data to Smashing dashboards
import mysql.connector
import json
import pycurl
try:
from StringIO import StringIO
except:
from io import StringIO
class Smashing:
@halfordfan
halfordfan / php_job_1m.php
Last active October 1, 2020 03:17
A PHP library for sending data to Smashing
#!/usr/bin/php
<?php
// Don't forget to make me executable using chmod +x.
# BEGIN LAB HOURS
require_once 'smashing_functions.php';
$json=@array();
$json['items'][0]['label']="Monday";
@halfordfan
halfordfan / google_geo.coffee
Created March 25, 2019 13:53
Google Geo widget for Smashing
class Dashing.GoogleGeo extends Dashing.Widget
@accessor 'current', ->
return @get('displayedValue') if @get('displayedValue')
points = @get('points')
if points
points[points.length - 1].y
ready: ->