Skip to content

Instantly share code, notes, and snippets.

@ItsQuadrus
ItsQuadrus / sensors_ntfy.sh
Created May 12, 2024 18:17
This script retrieves temperature readings from specified sensors, compares them to a threshold, and sends a notification to a specified ntfy.sh channel with the priority level indicating the severity. I recommend adding it to your crontab.
#!/bin/bash
channel="https://ntfy.sh/YOURTOPICHERE"
sensors=(
"nvme-pci-0900:Composite"
# Add as many sensors as you want here
)
threshold=55
@ItsQuadrus
ItsQuadrus / ubuntu-remove-telemetry.sh
Last active April 17, 2024 20:16 — forked from CodeSigils/ubuntu-remove-telemetry.sh
Remove Ubuntu telemetry
#!/usr/bin/env bash
################ Description: ###################
# This script will disable all opt-out under
# Ubuntu 22.04 (Codename: Jammy Jellyfish).
# At first the telemetry domains will be resolved
# to the local host and second all telemetry services
# will be removed from the system.
# The following work has a system-wide effect not just
@ItsQuadrus
ItsQuadrus / logging_config.py
Created July 27, 2023 18:24
Easy and simple color logging for Python
"""
IMPORT THIS IN YOUR CODE LIKE THIS:
from logging_config import logger
logger.info("It works!")
"""
import logging
# Create a named logger
logger = logging.getLogger("My_Logger")