Skip to content

Instantly share code, notes, and snippets.

Oli Passey OliPassey

Block or report user

Report or block OliPassey

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
View front-end.html
<h1>Stay On Brand - Templated Img Gen</h1>
<h2>Sliders:</h2>
<p><strong>Template 1</strong> - 2 Line Headline &amp; 6 Lines of Text</p>
<p><img src="https://olipassey.me.uk/xmas.php" alt="" width="750" height="300" /></p>
<p>Headline:<input name="Headline" type="text" /></p>
<p>Sub-heading:<input name="Sub-heading" type="text" /></p>
<p>Text 1:<input name="Text1" type="text" /></p>
<p>Text 2:<input name="Text2" type="text" /></p>
<p>Text 3:<input name="Text3" type="text" /></p>
<p>Text 4:<input name="Text4" type="text" /></p>
View xmas.php
<?php
$my_img = imagecreatefrompng ( "x_feature_template.png" );
$background = imagecolorallocate( $my_img, 149, 152, 192 );
$text_colour = imagecolorallocate( $my_img, 18, 12, 45 );
$button_text_colour = imagecolorallocate( $my_img, 197, 184, 114 );
$font_bold = 'palatino.ttf';
$font_medium = 'palatino.ttf';
@OliPassey
OliPassey / hyperion.config.json
Last active Aug 28, 2019
Config file for Hyperion Remote AirCookie/WLED WS2812b NodeMCU
View hyperion.config.json
// Automatically generated configuration file for Hyperion ambilight daemon
// Notice: All values are explained with comments at our wiki: wiki.hyperion-project.org (config area)
// Generated by: HyperCon (The Hyperion deamon configuration file builder)
// Created with HyperCon V1.03.3 (22.10.2017)
{
// DEVICE CONFIGURATION
"device" :
{
"name" : "MyHyperionConfig",
View L2DB-InfluxDB-Cron.vb
'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
@OliPassey
OliPassey / L2DB-InfluxDB.vb
Last active May 13, 2019
Send metrics from HomeSeer to InfluxDB for display in Grafana
View L2DB-InfluxDB.vb
'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:
View grafana-webhook-to-pushbullet-channel.php
<?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 / grafana-webhook-to-pushbullet.php
Last active Jul 3, 2018
add pushbullet notifications to grafana alerts via custom webhook (multi-user support)
View grafana-webhook-to-pushbullet.php
# Copyright (c) 2018 Oli Passey & Steven Gould
# Author: Oli Passey & Steven Gould
# More information: https://olipassey.me.uk
# 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:
@OliPassey
OliPassey / setup-mysql.sh
Last active Aug 14, 2018 — forked from sheikhwaqas/setup-mysql.sh
Install MySQL Server on Ubuntu (Non-Interactive Installation)
View setup-mysql.sh
# 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
View puppeteer--multiple-screenshots.js
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});
View puppeteer-screenshots.js
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});
You can’t perform that action at this time.