Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am OliPassey on github.
  • I am olipassey (https://keybase.io/olipassey) on keybase.
  • I have a public key whose fingerprint is 1DB5 7688 CC72 3857 8C08 9F0D EE43 7C0C B9F6 206B

To claim this, I am signing this object:

@OliPassey
OliPassey / setup_selenium.sh
Last active November 1, 2017 14:58 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
@OliPassey
OliPassey / DHT22_temphum_hostedgraphite.py
Last active January 2, 2018 21:48 — forked from dashbad/temp_hum_influx.py
Push DHT22 raspberry Pi readings to Hosted Graphite
#!/usr/bin/python
# Copyright (c) 2014 Adafruit Industries
# Author: Tony DiCola
# Forked & Amended: Oli Passey & Steven Gould (2017)
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@OliPassey
OliPassey / switchMonitor.py
Last active March 22, 2018 12:53
Monitor Cisco "sh env" in Hosted Graphite
# Copyright (c) 2018 Steven Gould
# Author: Steven Gould
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
@OliPassey
OliPassey / alexnotify.php
Last active April 16, 2018 21:01
Simple PHP script to send push notifications to Alexa / Amazon Echo via NotifyMe
// Takes CLI arguments, or $_GET requests (in the form `http://host.name/path/filename.php?notification=whaddup`).
<?php
if (isset($argv) && count($argv) > 1) {
array_shift($argv);
$notificationText = implode(' ', $argv);
} else if (isset($_GET['notification'])) {
$notificationText = $_GET['notification'];
} else {
var CronJob = require('cron').CronJob;
var job = new CronJob({
cronTime: '00 */5 * * * *',
onTick: function() {
const puppeteer = require('puppeteer');
(async () => {
const browser = await puppeteer.launch();
const page = await browser.newPage();
await page.setViewport({width: 1920, height: 1080});
<?php
// Testing sending via pushbullet channels, rather than direct to devices.
$pb_api_key = "ADD-YOUR-PB-API-KEY";
// Capture incoming data and try to detect JSON
if($json = json_decode(file_get_contents("php://input"), true)) {
print_r($json);
$data = $json;
} else if(isset($_GET["mode"]) && $_GET["mode"] == "test") {
@OliPassey
OliPassey / setup-mysql.sh
Last active August 14, 2018 12:03 — forked from sheikhwaqas/setup-mysql.sh
Install MySQL Server on Ubuntu (Non-Interactive Installation)
# Download and Install the Latest Updates for the OS
apt-get update && apt-get upgrade -y
# Set the Server Timezone to CST
echo "Europe/London" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# Enable Ubuntu Firewall and allow SSH & MySQL Ports
ufw enable
ufw allow 22
@OliPassey
OliPassey / L2DB-InfluxDB.vb
Last active May 13, 2019 14:50
Send metrics from HomeSeer to InfluxDB for display in Grafana
'VB.Net script to write Homeseer 3 values to InfluxDB
'Created by Brian based on code found on the Homeseer forums. No warranty. Use at your own risk.
'Uncomment the log statements if you're having problems to try to track down the error.
'Script amended by reidfo for Linux Compatibility & greater error / log handling
'Script amended by Rob2791 to include TCP Connection Limit lift to 20
'Posted to GitHub by OliPassey for VersionControl - please feel free to PR, Fork, etc
'Original release and forum discussion: https://forums.homeseer.com/forum/homeseer-products-services/system-software-controllers/hs3-hs3pro-software/hs3-hs3pro-discussion/107992-a-script-to-log-device-changes-to-influxdb-for-use-with-grafana
'Installation Instrustions:
'Call this script by runiing &hs.runScriptFunc("L2DB-influxdbV4.vb","Main",0,False,False)
'VB.Net script to write Homeseer 3 values to InfluxDB
'from this post of the Homeseer forums: https://forums.homeseer.com/showthread.php?t=194145
'Use at your own risk. Edited by Marty.
'Uncomment (hs.WriteLog) the log statements if you're having problems to try to track down the error.
'V4 sends to new Raspberry Pi 2 which runs only influx and grafana, note the IP address and database name