Skip to content

Instantly share code, notes, and snippets.

@hollie
hollie / gist:2300e1c6df804d29d24adcdaaecd44b0
Created Sep 5, 2021
Example I2C code on SAMD21 for Martin
View gist:2300e1c6df804d29d24adcdaaecd44b0
// vi:ts=4
// ----------------------------------------------------------------------------
// HelloWorld - simple demonstration of lcd
// Created by Bill Perry 2016-07-02
// bperrybap@opensource.billsworld.billandterrie.com
//
// This example code is unlicensed and is released into the public domain
#include <Wire.h>
#include <hd44780.h> // main hd44780 header
@hollie
hollie / ssl_check.yaml
Last active May 29, 2021
SSL check blueprint
View ssl_check.yaml
blueprint:
name: Certificate Expiration by bkbilly
description: 'This automation blueprint notifies when a SSL certificate is about to expire'
domain: automation
input:
certificate_input:
name: Certificate
description: The certificate timestamp
selector:
entity:
@hollie
hollie / test-https.pl
Created Apr 24, 2020
Test script to check if HTTPS works with the current perl installation
View test-https.pl
#! /usr/bin/env perl
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $req = HTTP::Request->new(GET => 'https://google.com');
my $res = $ua->request($req);
if ($res->is_success) {
print $res->as_string;
@hollie
hollie / test_sync_time.pl
Created Apr 19, 2020
Sync time script for AlphaClock 5 over BT serial port
View test_sync_time.pl
#! /usr/bin/env perl
use strict;
use warnings;
use 5.010;
use Device::SerialPort;
my $name = 'Foo';
my $bt_address = 'D5:89:1F:09:51:15';
say "PID $$";
View keybase.md

Keybase proof

I hereby claim:

  • I am hollie on github.
  • I am hollie (https://keybase.io/hollie) on keybase.
  • I have a public key ASAbq7hLiVYGF4gV-ea_MFGFpfZ1pWad7kWVT5ZolKudxwo

To claim this, I am signing this object:

@hollie
hollie / xpl_test.pl
Last active Dec 10, 2016
Example code for MisterHouse: react to xPL-enabled motion detector
View xpl_test.pl
# In items.mht:
# XPL_SENSOR, hollie-jeenodes.nessie:room31, motion_berging, Berging, motion
# in user code
if ($motion_berging->state_changed()) {
my $state = $motion_berging->state();
if ($plafond_berging->get_set_by() =~ /^web/ && $plafond_berging->state() ne 'off') {
# Was set on by web interface, don't react to motion detector right now to allow forcing the light to steady 'on' via web interface
@hollie
hollie / mh_temp.user_code
Created Mar 20, 2016
v4.1 + fix Eloy generated user code
View mh_temp.user_code
# List of X10_Item objects
use vars qw($backyard_light $bedroom_light1 $bedroom_light2 $garage_light $test_light1 $test_light2);
# List of X10_Appliance objects
use vars qw($fountain);
# List of Voice_Cmd objects
use vars qw($my_test1 $organizer_check $restart_tts $test_speak_mode $test_speech_flags $test_volume $v_clear_cache $v_debug $v_debug_toggle $v_fountain $v_garage_light $v_get_ical_data $v_http_control $v_list_debug_options $v_list_serial_items $v_list_voice_cmds $v_list_x10_items $v_listen $v_mhdl_page $v_mode $v_mode_toggle $v_read_tables $v_reboot $v_reboot_abort $v_reload_code $v_reload_code2 $v_repeat_last_spoken $v_restart_mh $v_set_password $v_show_debug $v_speed_benchmark $v_test_light2 $v_test_lights $v_undo_last_change $v_update_docs $v_uptime $v_version $v_voice_cmds_help $v_what_speed);
# List of Timer objects
@hollie
hollie / mh_temp.user_code
Created Mar 20, 2016
v4.1 generated user code
View mh_temp.user_code
# List of X10_Item objects
use vars qw($backyard_light $bedroom_light1 $bedroom_light2 $garage_light $test_light1 $test_light2);
# List of X10_Appliance objects
use vars qw($fountain);
# List of Voice_Cmd objects
use vars qw($my_test1 $organizer_check $restart_tts $test_speak_mode $test_speech_flags $test_volume $v_clear_cache $v_debug $v_debug_toggle $v_fountain $v_garage_light $v_get_ical_data $v_http_control $v_list_debug_options $v_list_serial_items $v_list_voice_cmds $v_list_x10_items $v_listen $v_mhdl_page $v_mode $v_mode_toggle $v_read_tables $v_reboot $v_reboot_abort $v_reload_code $v_reload_code2 $v_repeat_last_spoken $v_restart_mh $v_set_password $v_show_debug $v_speed_benchmark $v_test_light2 $v_test_lights $v_undo_last_change $v_update_docs $v_uptime $v_version $v_voice_cmds_help $v_what_speed);
# List of Timer objects
@hollie
hollie / mh_temp.user_code
Created Mar 20, 2016
v4.0 generated usercode
View mh_temp.user_code
# List of X10_Item objects
use vars qw($backyard_light $bedroom_light1 $bedroom_light2 $garage_light $test_light1 $test_light2);
# List of X10_Appliance objects
use vars qw($fountain);
# List of Voice_Cmd objects
use vars qw($my_test1 $organizer_check $restart_tts $test_speak_mode $test_speech_flags $test_volume $v_clear_cache $v_debug $v_debug_toggle $v_fountain $v_garage_light $v_get_ical_data $v_http_control $v_list_debug_options $v_list_serial_items $v_list_voice_cmds $v_list_x10_items $v_listen $v_mhdl_page $v_mode $v_mode_toggle $v_read_tables $v_reboot $v_reboot_abort $v_reload_code $v_reload_code2 $v_repeat_last_spoken $v_restart_mh $v_set_password $v_show_debug $v_speed_benchmark $v_test_light2 $v_test_lights $v_undo_last_change $v_update_docs $v_uptime $v_version $v_voice_cmds_help $v_what_speed);
# List of Timer objects
@hollie
hollie / kustweer.pl
Created Nov 11, 2015
Scrape the 'kustweerbericht' local weather page and convert it to speech
View kustweer.pl
#Category=Weather
# noloop=start
my $kwb_file = "$config_parms{data_dir}/web/kwb.html";
my $kwb_voice = "/Volumes/Media/speech/kustweer.wave";
my $last_fetched_kwb; # To keep track of the last type of fetched weather report
my $weerbeeld;
my $kwb_player = "keuken"; # Default player
$v_get_kwb = new Voice_Cmd "[korte,volledige] weerbericht";