Skip to content

Instantly share code, notes, and snippets.

View sumnerboy12's full-sized avatar

Ben Jones sumnerboy12

View GitHub Profile
@zoispag
zoispag / README.md
Last active August 16, 2021 09:57
Collect restic metrics when using resticker

Collect restic metrics when using resticker

Restic is a backup software, written in Go, that stands out for the method of backup that is using, called Content Defined Chunking de-duplication. It supports multiple backends and is really easy to use.

I am using resticker, a straight-forward docker container, to run restic in Production.

It allows to schedule the backups with its built-in cron support, and allows me to send notifications for successful/failed backups.

Resticker currently does not support Prometheus metrics, in order to monitor the status of the backups.

@IdrisCytron
IdrisCytron / ESP32WaterFlow.ino
Created October 1, 2019 09:12
Interface water flow sensor with ESP32 board.
/*
Application:
- Interface water flow sensor with ESP32 board.
Board:
- ESP32 Dev Module
https://my.cytron.io/p-node32-lite-wifi-and-bluetooth-development-kit
Sensor:
- G 1/2 Water Flow Sensor
@EDais
EDais / colourTemperature.js
Created August 30, 2017 14:50
JavaScript port of getRGBFromTemperature
"use strict";
const clamp = (num, min, max) => num < min ? min : num > max ? max : num;
/** Given a temperature (in Kelvin), estimate an RGB equivalent
* @param {number} tmpKelvin - Temperature (in Kelvin) between 1000 and 40000
* @returns {{r:number, g:number, b:number}} - RGB channel intensities (0-255)
* @description Ported from: http://www.tannerhelland.com/4435/convert-temperature-rgb-algorithm-code/
*/
exports.getRGBFromTemperature = function(tmpKelvin) {
@wpottier
wpottier / jail.local
Created June 17, 2016 09:02
Fail2ban -> slack
# ban & send a notification on slack
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
slack[name=%(__name__)s, dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s", sendername="%(sendername)s"]
# Choose default action. To change, just override value of 'action' with the
# interpolation to the chosen action shortcut (e.g. action_mw, action_mwl, etc) in jail.local
# globally (section [DEFAULT]) or per specific section
action = %(action_with_slack_notification)s
object Host "me.owntracks.alr.st" {
import "owntracks-host"
}
object Host "5s.owntracks.alr.st" {
import "owntracks-host"
}
object Host "sm.owntracks.alr.st" {
import "owntracks-host"

Using Let's Encrypt with openHAB

You can use a FREE certificate from [Let's Encrypt] (https://letsencrypt.org/) to secure your [openHAB] (http://www.openhab.org/) installation.

This quick information page is based on detail from https://gist.github.com/jpmens/8029383.

To start, get the Let's Encrypt client as shown here https://letsencrypt.org/howitworks/. I checked it out into /root/letsencrypt.

Pick a password for your keystore. Use the commandline in step 9 of [jpmen's tutorial] (https://gist.github.com/jpmens/8029383) to create jetty passwords and update the jetty.xml.

@Nihisil
Nihisil / jail.local
Last active September 5, 2023 06:20
Send notifications to the Slack from fail2ban
...
action_with_slack_notification = %(banaction)s[name=%(__name__)s, port="%(port)$
slack[name=%(__name__)s]
action = %(action_with_slack_notification)s
...
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@dreamcat4
dreamcat4 / tvheadend.md
Last active October 6, 2023 09:20
How to Install TvHeadend on FreeBSD, FreeNAS / NAS4Free / pfSense, with Finch / Qjail 3.5 - http://dreamcat4.github.io/finch/

NOTICE - TvHeadend Internal Grabbers don't work on FreeBSD yet. There is some work in progress updating the FreeBSD port to enable that.

TvHeadend How-To

How to install TvHeadend. Most of these commands can just be copy-pasted.

Install drivers for your TV Tuner device

@mazzmn
mazzmn / temp4sensor.py
Last active January 8, 2019 16:55
ChannelOneTempMonitor
#!/usr/bin/python
#Based on Adafruit's Raspberry Pi Lesson 11 Temperature sensing tutorial by Simon Monk
#Modified by Tim Massaro 2/2014
#This script now uses a Raspberry Pi, Adafruit PiPlate LCD and
#two DS18B20 temp sensor to monitor the freezer and fridge unit at Channel One Food Shelf
#significant changes
#adapt for 2 sensors
#Display temperature on the LCD
#sendtext messages when temperature is out of range