Skip to content

Instantly share code, notes, and snippets.

@matt448
matt448 / can_reciever.ino
Last active August 27, 2021 21:04
Code for example CAN bus receiver.
// demo: CAN-BUS Shield, receive data
#include "mcp_can.h"
#include <SPI.h>
#include <LiquidCrystal.h>
#include <stdio.h>
#define INT8U unsigned char
INT8U Flag_Recv = 0;
INT8U len = 0;
INT8U buf[8];
@matt448
matt448 / can_sender.ino
Last active August 24, 2023 11:23
Arduino code for CAN bus sender example
// demo: CAN-BUS Shield, send data
#include <mcp_can.h>
#include <SPI.h>
//Pot for adjusting value
int sensorPin = A0;
int sensorValue = 0;
int cantxValue = 0;
void setup()
@matt448
matt448 / check_sqs_depth.py
Created October 7, 2013 14:52
Nagios check for monitoring Amazon SQS queue depth
#!/usr/bin/python
##########################################################
#
# Written by Matthew McMillan, matthew.mcmillan@gmail.com
#
# Requires the boto library and a .boto file with read
# permissions to the queues.
#
@matt448
matt448 / check-template-json-webservice.py
Created March 18, 2013 17:06
Template Nagios check for web services that return JSON data.
#!/usr/bin/python
#########################################
# Notes
#########################################
#
#
# Author: Matthew McMillan - matthew.mcmillan@gmail.com
# Blog: http://matthewcmcmillan.blogspot.com
# Code repo: https://github.com/matt448/nagios-checks
@matt448
matt448 / backup_nagios.sh
Created March 13, 2013 14:17
Simple backup script for Nagios on Ubuntu 12.04
#!/bin/bash
DATE=`date +%Y%m%d-%H%M`
sudo tar cfvz nagios_backup_$DATE.tgz /etc/nagios3 /etc/nagios-plugins /etc/nagios /usr/lib/nagios/plugins /usr/share/pnp4nagios/html /var/lib/pnp4nagios/perfdata /var/lib/nagios /var/lib/nagios3