Skip to content

Instantly share code, notes, and snippets.

View bruvv's full-sized avatar

Niels bruvv

  • Netherlands
View GitHub Profile
@bruvv
bruvv / chromecast.xml
Created March 30, 2018 13:26
Chromecast Ultra profile for plex 2018 (4k support)
<?xml version="1.0" encoding="utf-8"?>
<Client name="Chromecast">
<TranscodeTargets>
<VideoProfile protocol="http" container="matroska" codec="h264,h265,hevc" audioCodec="eac3,ac3,aac,mp3" context="streaming" />
<VideoProfile protocol="http" container="mkv" codec="h264,h265,hevc" audioCodec="eac3,ac3,aac,mp3" context="streaming" />
<VideoProfile protocol="http" container="mp4" codec="h264,h265,hevc" audioCodec="eac3,ac3,aac,mp3" context="streaming" />
<MusicProfile container="matroska" codec="mp3" />
<MusicProfile container="mkv" codec="mp3" />
<PhotoProfile container="jpeg" />
<SubtitleProfile container="ass" codec="ass" />
server:
module-config: "subnetcache validator iterator"
chroot: "/usr/local/etc/unbound"
directory: "/usr/local/etc/unbound"
username: "unbound"
port: 5353
do-ip4: yes
do-ip6: no
do-udp: yes
do-tcp: yes
@bruvv
bruvv / linux_commands.md
Last active April 9, 2021 16:45
Linux wordlist commands for WPA/WPA2 hash

Merging

rm -f stage*
rm -vf CREADME CHANGELOG* readme* README* stage*
echo "Number of files:" `find . -type f | wc -l`
cat * > tmp/aio-"${PWD##*/}".lst 
rm -f *.txt && mv tmp/aio-"${PWD##*/}".lst ./
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'
#!/bin/bash
location=<your backup location>
date=`date "+%Y%m%d"`
for name in $(docker ps --format '{{.Names}}'); do
#Backup location per container
backup_location=$location"/"$name
#Make the directory when it doesn't exist
@bruvv
bruvv / KPN IPV6 with UDM (pro).md
Last active September 21, 2021 10:43
Fix KPN ipv6 with UDM (pro)
#!/usr/bin/env bash
echo "[i] Updating Pi-hole"
pihole -up
echo "[i] Updating lists"
if [ ! -f /etc/pihole/whitelist.txt ] ; then
sudo touch /etc/pihole/whitelist.txt
fi
sudo sort -u -o /etc/pihole/whitelist.txt /etc/pihole/whitelist.txt
if [ ! -f /etc/pihole/blacklist.txt ] ; then
@bruvv
bruvv / free_ports.sh
Created May 1, 2022 09:05 — forked from hjbotha/free_ports.sh
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6/7. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
# Run this script as root
@bruvv
bruvv / home-assistant_plant-moisture-notification.yaml
Created May 6, 2023 19:24
Home Assistant Blueprint: Low battery level detection & notification for all battery sensors based on https://community.home-assistant.io/t/plant-moisture-notification/369425
blueprint:
name: Low moisture level detection & notification for all plant sensors
description: Regularly test all plant sensors with 'moisture' crossing
under their threshold.
domain: automation
input:
threshold:
name: Water warning level threshold
description: Water sensors below threshold are assumed to be low-Water (as
well as binary battery sensors with value 'on').

We are going to use the acme.sh script to accomplish this. For authentication of the domain name, we will use the DNS option. First login to your Synology with ssh as the admin user and then sudo -i to get root access. When you login into the Synology with ssh you will end up in the /root path. I assume for the rest of the guide we run everything from that path. Now we need to get the script and change the permissions so it is executable.

wget https://raw.githubusercontent.com/Neilpang/acme.sh/master/acme.sh
chmod a+x acme.sh

Next we issue the certificate:

./acme.sh --issue -d *.website.come --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please