Skip to content

Instantly share code, notes, and snippets.

Avatar

bruvv

  • Netherlands
View GitHub Profile
@bruvv
bruvv / sync_trv_with_external_temp_sensor.yaml
Last active Apr 10, 2021
Sync TRV with external sensor blueprint
View sync_trv_with_external_temp_sensor.yaml
blueprint:
name: Sync TRV tempature
description: Sync external tempature sensor with TRV tempature
domain: automation
input:
ieeeaddressoftrv:
name: IEEE Address
description: This is the address of the TRV found in your zigbee database example 0x459877fffe1f2e83
external_temp:
name: Select the external temp sensor
@bruvv
bruvv / gist:3075b64b0aa90139ab1be3223c367ccd
Last active Nov 29, 2020
synology lets encrypt wildecard auto renewal.sh
View gist:3075b64b0aa90139ab1be3223c367ccd
#!/bin/bash
# 1. replace "site.nl" with your domain name
# 2. schedule this script to be run once per three months in Task Scheduler
echo "======================================================================"
echo "Certificate Renewal"
echo "======================================================================"
./acme.sh --force --renew -d *.site.nl --dns --yes-I-know-dns-manual-mode-enough-go-ahead-please --log
echo ""
@bruvv
bruvv / fixsleep.md
Last active Aug 9, 2020
Fix iMac with fusion drives not sleeping
View fixsleep.md

Create bootscript.sh:

#!/bin/bash
# make sure to run this program as root and make it run at boot
ps -ef | grep UserEventAgent | grep -v grep | awk '{print $2}'| sudo xargs kill sleep 15
ps -ef | grep UserEventAgent | grep -v grep | awk '{print $2}'| sudo xargs kill sleep 15
ps -ef | grep UserEventAgent | grep -v grep | awk '{print $2}'| sudo xargs kill sleep 15
View synology wildcard https ssl certificate.md

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
View bad ip's iptables.md

#bad users/computers/hacks/warez/shit

iptables -A INPUT -s 188.166.242.233 -j DROP
iptables -A INPUT -s 188.166.217.243 -j DROP
iptables -A INPUT -s 174.138.30.38 -j DROP
iptables -A INPUT -s 165.22.247.172 -j DROP
iptables -A INPUT -s 167.71.195.239 -j DROP
iptables -A INPUT -s 139.59.247.248 -j DROP
iptables -A INPUT -s 139.59.235.100 -j DROP
iptables -A INPUT -s 165.22.251.215 -j DROP
View iptables.sh
#!/bin/bash
# flush the nat and mangle tables, flush all chains (-F), and delete all non-default chains (-X)
iptables -F
iptables -X
iptables -t mangle -F
ip6tables -X
ip6tables -t mangle -F
ip6tables -F
# accept all
View ublock filters
! 3/31/2018, 3:08:49 PM https://www.marktplaats.nl/mymp/verkopen/index.html
!#www.marktplaats.nl##.search-result.row:has-text(Topadvertentie)
!#www.marktplaats.nl##.search-result.row:has-text(Dagtopper)
!#www.marktplaats.nl##.search-result.row:has-text(Bezorgt in)
!#www.marktplaats.nl##.search-result.row:has-text(Heel Nederland)
!#www.marktplaats.nl##.search-result.row:has-text(bezoek website)
!#www.marktplaats.nl##.mp-Listing--list-item.mp-Listing:has-text(Dagtopper)
!#www.marktplaats.nl##.mp-Listing--list-item.mp-Listing:has-text(Bezorgt in)
!#www.marktplaats.nl##.mp-Listing--list-item.mp-Listing:has-text(Heel Nederland)
!#www.marktplaats.nl##.mp-Listing--list-item.mp-Listing:has-text(Topadvertentie)
View pihole Auto-update script.sh
#!/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 / linux_commands.md
Last active Apr 9, 2021
Linux wordlist commands for WPA/WPA2 hash
View linux_commands.md

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 ./
@bruvv
bruvv / PIHOLE+UNBOUND.md
Last active May 10, 2021
Setup Pihole + Unbound + DNS over TLS on ubuntu 20.02 LTS
View PIHOLE+UNBOUND.md

Swap

First enable swap just incase

sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
sudo cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
sudo sysctl vm.swappiness=10