Skip to content

Instantly share code, notes, and snippets.

View jffz's full-sized avatar

Geoffrey Bachelot jffz

View GitHub Profile
@jffz
jffz / frigate.yml
Created September 23, 2022 07:11
5 cams (fhd - 4k) - 6 core lxc no cora
database:
path: /frigate.db
mqtt:
host: [redacted]
topic_prefix: frigate
client_id: frigate
user: [redacted]
password: [redacted]
detectors:
cpu1:
---------------------------
-- Default awesome theme --
---------------------------
local theme_assets = require("beautiful.theme_assets")
local xresources = require("beautiful.xresources")
local dpi = xresources.apply_dpi
local gfs = require("gears.filesystem")
local themes_path = gfs.get_themes_dir()
#!/usr/bin/python3
import argparse
CURR = "/sys/class/backlight/intel_backlight/brightness"
MAX = "/sys/class/backlight/intel_backlight/max_brightness"
def current_brightness():
with open(CURR, 'r') as f:
#!/usr/bin/env python
import time
import json
import paho.mqtt.client as mqtt
import socket
MQTT_BROKER = "192.168.1.5"
MQTT_TOPIC = "hiveos"
TAIL_FILE = "/var/log/hive-agent.log"
MQTT_USER = ""
@jffz
jffz / hiveos2mqtt.sh
Last active January 12, 2024 21:43
Publish hiveos logs to mqtt broker
#!/bin/bash
# MQTT settings
BROKER=""
TOPIC=""
USER=""
PASS=""
# Ensure mosquitto-clients is installed
dpkg -s mosquitto-clients >/dev/null 2>&1 || apt update && apt install -y mosquitto-clients
{
"info": {
"_postman_id": "be8810c1-7715-461c-bc34-1a6bc6360387",
"name": "Sonoff_mini",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "sonoff_on",
"request": {
@jffz
jffz / template.j2
Created September 10, 2019 13:25
[Ansible] Use facts to lookup variables in jinja2 template
{% for item in ssh[(ansible_distribution | lower)][(ansible_distribution_major_version | int)] %}
- {{ item }}
{% endfor %}
#!/bin/sh
# Get out of town if something errors
# set -e
# Get info on the monitors
HDMI1_STATUS=$(</sys/class/drm/card0/card0-HDMI-A-1/status )
HDMI2_STATUS=$(</sys/class/drm/card0/card0-HDMI-A-2/status )
DP1_STATUS=$(</sys/class/drm/card0/card0-DP-1/status )
DP2_STATUS=$(</sys/class/drm/card0/card0-DP-2/status )
from discord.ext import commands
import discord
import shlex
log = logging.getLogger(__name__)
class Embed_Commands:
def __init__(self, bot):
self.bot = bot
from discord.ext import commands
import discord
import youtube_dl
import asyncio
import logging
log = logging.getLogger(__name__)
# Suppress noise about console usage from errors
youtube_dl.utils.bug_reports_message = lambda: ''