Skip to content

Instantly share code, notes, and snippets.

View hdurdle's full-sized avatar
🔒

Howard Durdle hdurdle

🔒
View GitHub Profile
@hdurdle
hdurdle / FoscamFI8918W.pm
Created March 10, 2024 18:21
FoscamFI8918W.pm
# ==========================================================================
#
# ZoneMinder Foscam FI8918W IP Control Protocol Module, $Date: 2009-11-25 09:20:00 +0000 (Wed, 04 Nov 2009) $, $Revision: 0001 $
# Copyright (C) 2001-2008 Philip Coombes
# Modified for use with Foscam FI8918W IP Camera by Dave Harris
# Modified Feb 2011 by Howard Durdle (http://durdl.es/x) to:
# fix horizontal panning, add presets and IR on/off
# use Control Device field to pass username and password
#
# This program is free software; you can redistribute it and/or
@hdurdle
hdurdle / Get-UniFiClients.ps1
Created January 28, 2021 10:12
Get UniFi Client Stations from a UDM Pro
# config
$unifiServerURI = "https://192.168.1.1" # https://192.168.1.1
$unifiUsername = "unifi-login-email"
$unifiPassword = "unifi-login-password"
# # #
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true }
$AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12'
@hdurdle
hdurdle / Get-Best.ps1
Created March 29, 2020 21:18
Powershell to get best quality video and audio using youtube-dl
Param(
[Parameter(Mandatory=$true)]
[string]$url
)
# run in a directory that contains youtube-dl.exe and ffmpeg.exe
$qualityList = `.\youtube-dl.exe -F $url`
$videoOnly = $qualityList | Select-String -Pattern 'video only' -CaseSensitive -SimpleMatch
$best = $videoOnly[$videoOnly.length-1]
<?php
$url = "https://hooks.slack.com/services/[Incoming-Webhook-URL]";
$msg = "Test";
parse_str($_SERVER['QUERY_STRING'], $output);
$msg = $output['message'];
$payload = 'payload={"channel": "#channel", "username": "bot-username", "text": "' . $msg . '"}';
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, TRUE);
@hdurdle
hdurdle / ironpi.py
Created August 21, 2017 12:20
Iron Man Mask Python
from twisted.internet.defer import succeed
from klein import run, route
from squid import *
import time
left_eye = Squid(18, 23, 24)
right_eye = Squid(17, 27, 22)
color='ff0000'
/*
* Activate selected Fibaro pattern or preset colour on switch activation
*
* Author: Howard Durdle
* Based on the Pattern Trigger by Michael Hudson
* Based on the Turn-on-Police-Light-When-Switch-Is-On.groovy smartapp by twack
* https://github.com/twack/smarthings-apps/blob/master/Turn-on-Police-Light-When-Switch-Is-On.groovy
*
*/
var express = require('express');
var bodyParser = require('body-parser');
var fs = require('fs');
var request = require('request');
var app = express();
app.use(bodyParser.json());
app.get('/', function(req, res) {
var request = require('request');
var json = {
id: '1',
jsonrpc: '2.0',
method: 'GUI.ShowNotification',
params: {
title: 'title-test',
message: 'message-test'
}
param (
[Parameter(Mandatory=$true)][string]$client,
[string]$title = "Test Title",
[string]$message = "Test Message"
)
$data = @{
id = '1'
jsonrpc = '2.0'
method='GUI.ShowNotification'
import java.security.MessageDigest
preferences {
input("domoticzIP", "text", title: "Domoticz IP Address", description: "IP Address of the Server")
input("deviceID", "text", title: "Device ID", description: "The device id")
}
metadata {
definition(name: "Domoticz On Off Device", namespace: "hdurdle-smartthings", author: "Howard Durdle") {
capability "Switch"