Skip to content

Instantly share code, notes, and snippets.

@oddstr13
oddstr13 / ha_bp_level_alert.yaml
Last active January 18, 2024 22:06
Alert on sensor level
blueprint:
name: Alert on sensor level
domain: automation
author: Odd Stråbø <[email protected]>
input:
sensor_name:
name: Name
selector:
text:
@oddstr13
oddstr13 / install_docker_debuntu.sh
Created November 17, 2020 01:43
Script to quickly install Docker on Debian and Ubuntu based distros
. /etc/os-release
CPU=$(uname -m)
# Order matters, ubuntu is ID_LIKE debian
if [ "${ID}" = "ubuntu" ] || [ "${ID_LIKE}" = "ubuntu" ]; then
DEBUNTU="ubuntu"
RELEASE=$UBUNTU_CODENAME
elif [ "${ID}" = "debian" ] || [ "${ID_LIKE}" = "debian" ]; then
DEBUNTU="debian"
@oddstr13
oddstr13 / arp_responder.py
Last active January 27, 2021 20:37 — forked from SupraJames/arp_responder.py
ARP responder using Python / scapy
#!/usr/bin/env python3
#
# Spoof ARP responses for list of IP Addresses / Networks
# Listens for ARP and responds with own MAC if the target is in list
#
# Allows routing of IP Addresses / subnets to a bridged VM network
# without access to the router config.
#
# Requires scapy (python3-scapy)
# https://scapy.readthedocs.io/en/latest/installation.html
@oddstr13
oddstr13 / Readme.md
Last active May 14, 2020 21:42
Jellyfin Plugin Tools

Put these scripts in a separate directory — I've got them in ~/Projects/Jellyfin/Plugins/.

pull_all.py grabs all repositories from the Jellyfin Org. with the name prefix of jellyfin-plugin-.

build_all.sh runs dotnet clean & publish (release build) on them all.

issues.sh and pullrequests.sh lists the issues and pullrequests of the repos if any.

Dependencies

  • .NET core
@oddstr13
oddstr13 / create-vm.sh
Created January 23, 2020 22:27
PVC Tools
#!/bin/bash
set -e
MIRROR="http://ftp.no.debian.org/debian/"
CEPH_UUID=$(virsh secret-list | grep 'ceph client.libvirt secret' | awk -F' ' '{ print $1 }')
SSH_PUBKEY="ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDEisccxZL36XmW09U8u+96YoDZlUD59lloWGC4zmEGv oddstr13@OddYoga"
read -p 'VM Name > ' VM_NAME
if pvc vm list -r 2>/dev/null | grep -qx "${VM_NAME}"; then
exit 100
fi
#!/bin/bash
set -e
# Set this to your fork of jellyfin-kodi
#REPO="https://github.com/${USER}/jellyfin-kodi.git"
REPO="[email protected]:${USER}/jellyfin-kodi.git"
# Where to store the repository
PROJECT_PATH="${HOME}/Projects/Jellyfin"
import sys
with open(sys.argv[1], "rb") as file:
file.seek(0x1c)
color_depth = file.read(1)[0] | file.read(1)[0] << 8
print("Color depth:", color_depth)
file.seek(0x1e)
compression = file.read(1)[0] | file.read(1)[0] << 8
print("Compression:", compression)
from __future__ import print_function, unicode_literals
import sys
WHITESPACE = [None, ' ', '\n', '\t']
UPPERCASE = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
def processStatement(st):
@oddstr13
oddstr13 / jellyfin-nginx.conf
Created May 16, 2019 18:37
Jellyfin on subdirectory: nginx config
# Jellyfin on domain sub path.
# I have not yet set up SSL (https) on my setup.
# Replace "media" here with the host running Jellyfin
# "localhost" or "127.0.0.1" if it is running on this machine.
upstream jellyfin {
server media:8096;
}
upstream ombi {
define(['inputmanager'], function(inputmanager) {
'use strict';
console.log("keyboardnavigation");
document.addEventListener('keydown', function(e) {
console.log(e);
console.log(e.code);
console.log(e.key);
console.log(e.view);