Skip to content

Instantly share code, notes, and snippets.

View dmcallejo's full-sized avatar

dmcallejo dmcallejo

View GitHub Profile
@dmcallejo
dmcallejo / grab-magnets-from-watchdir.custom-cont-init-script
Created January 4, 2022 16:04
Add magnet files from watch dir to transmission (with authentication, for linuxserver.io docker image)
#!/bin/bash
# Filename: grab-magnets-from-watchdir.custom-cont-init-script
# Save this file in /config/custom-cont-init.d/
# This way it will run everytime the container is created and will add the crontab entry and transmission authentication
# Save env files to get authentication
printenv | sed 's/^\(.*\)$/export \1/g' > /root/container.env
# Add entry to crontab, runs every minute
echo '* * * * * . /root/container.env; /config/grab-magnets-from-watchdir.sh' >> /etc/crontabs/root
@TehloWasTaken
TehloWasTaken / homedashboard.md
Created January 5, 2021 21:07
HomeDashboard

Grafana Home Dashboard

Dashboard A requested Github Repo for my Grafana Home Dashboard

To Start

Even though my Grafana Dashboard itself looks pretty and all, my entire setup is a complete mess to be fair. This is my first time ever really screwing around with Grafana and just seeing what I could do with it. Most of this stuff is ran off of my old gaming rig that I installed with Debian and have running as a home server. Next to that I have a few PI's for stuff like Domoticz, and Pi-Hole.

Before I started on this I had no knowledge of antything like Docker of Proxmox, so all of this stuff is just ran on a single box, without any shielding, containerizing or virtualisation. I know that's probably a blasphemy, but I already have plans for a new home server on which I this time will use something like Docker or Proxmox.

@r0mdau
r0mdau / gist:7e5100ff175acf954f05e5124c3d3b7d
Last active May 3, 2023 16:13
Match docker overlay directory with container name
df -hi
apt install jq
cd /var/lib/docker/overlay2/
find . -xdev -type f | cut -d "/" -f 2 | sort | uniq -c | sort -n
docker inspect $(docker ps -qa) | jq -r 'map([.Name, .GraphDriver.Data.MergedDir]) | .[] | "\(.[0])\t\(.[1])"'
docker ps
docker images
@Pindar
Pindar / README.md
Last active February 13, 2023 21:23 — forked from mill1000/README.md
Headless A2DP Audio Streaming on Raspbian Stretch

About

This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.

Motivation

A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:

  • Automatic & Headless - Once setup, the system is entirely automatic. No user iteration is required to pair, connect or start playback. Therefore the Raspberry Pi can be run headless.
  • Simple - This solution has few dependencies, readily available packages and minimal configuration.
  • Up to date

Prerequisites

ALERT deleted_container_rate_on_hosts
IF sum without(instance) (rate(engine_daemon_container_actions_seconds_count{action="delete"}[1m])) > 0.1
FOR 1m
ANNOTATIONS {
summary = "DELETED CONTAINER RATE WARNING ON '{{ $labels.instance }}'",
description = "{{ $labels.instance }} has a HIGH rate of deleted containers. Deleted container rate is {{ humanize $value}}%.",
}
@Darkhogg
Darkhogg / !RebootToOs.md
Last active May 1, 2024 20:38
"Reboot to {OS}" scripts for rEFInd Next Boot selection

Reboot to {OS}

This a collection of notes and files used in my quest to create "Reboot to Windows" and "Reboot to Linux" scripts (and desktop shortcuts) for Linux and Windows respectively that automatically reboot my system and instruct rEFInd to auto-select the appropriate OS entry.

General Information

The key for achieving this is to modify the EFI Variable PreviousBoot with GUID 36d08fa7-cf0b-42f5-8f14-68df73ed3740, which rEFInd uses to store the last entry selected in the menu and, if using the + default entry, will be used to select the default OS. By doing this, we trick rEFInd into booting the OS we choose without having to be physically there to press the keyboard.

@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)