Skip to content

Instantly share code, notes, and snippets.

View mattie47's full-sized avatar

Matt mattie47

View GitHub Profile
@mattie47
mattie47 / esp-push-button.ino
Last active February 9, 2020 09:56
ESP-01 Dual Push Button Arduino Sketch
/*
ESP8266 Wi-Fi Button
Article on code: https://techlife.nz/blog/battery-powered-esp-01-push-button/
*/
#include <ESP8266WiFi.h>
#include <PubSubClient.h>
const char* deviceName = "esp-push-button";
#Copy the following into "/etc/systemd/system/cec-remote.service":
[Unit]
Description=HDMI-CEC remote script service.
[Service]
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority
Type=simple
ExecStart=/bin/bash /usr/bin/cec-remote.sh
#!/bin/bash
#Simple script to control your Raspberry Pi with your TV remote using libcec
#
# Copyleft 2017 by Ignacio Nunez Hernanz <nacho _a_t_ ownyourbits _d_o_t_ com>
# GPL licensed (see end of file) * Use at your own risk!
# Some minor modifications by Matt Read.
#
# You can set this to be run in your desktop "startup programs", or
# at the last line of /etc/rc.local, just to say a couple options
#
@mattie47
mattie47 / hdmi-cec-control.sh
Last active September 2, 2019 02:19
Control TV Dashboard using RPI and HDMI-CEC
#!/bin/bash
# Script from https://ubuntu-mate.community/t/controlling-raspberry-pi-with-tv-remote-using-hdmi-cec/4250/4
# Only modified for the tv remote arrow keys.
# Run script using cec-client | ./hdmi-cec-control.sh
export DISPLAY=:0 # Seemed to be needed to run over SSH.
function keychar {
parin1=$1 #first param; abc1
parin2=$2 #second param; 0=a, 1=b, 2=c, 3=1, 4=a, ...
parin2=$((parin2)) #convert to numeric
@mattie47
mattie47 / electronics.md
Created April 7, 2019 22:27
Matt's Aliexpress purchases
@mattie47
mattie47 / Install snmpsim for LibreNMS SNMP testing.md
Last active November 1, 2019 09:17
Attached are some instructions for getting snmpsim working.

snmpsim Installation

snmpsim is built on python and requires several other python libraries.

Prerequisites

apt install python-pip
pip install virtualenv