Skip to content

Instantly share code, notes, and snippets.

docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'
@bruvv
bruvv / sync_trv_with_external_temp_sensor.yaml
Last active February 8, 2024 20:05
Sync TRV with external sensor blueprint
blueprint:
name: Sync TRV temperature
description: Sync external temperature sensor with TRV temperature
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 November 29, 2020 00:04
synology lets encrypt wildecard auto renewal.sh
#!/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 August 9, 2020 15:38
Fix iMac with fusion drives not sleeping

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

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

#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
@bruvv
bruvv / iptables.sh
Last active October 22, 2023 11:53
#!/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
www.marktplaats.nl##li.hz-Listing:has-text(/Bezoek website/)
www.marktplaats.nl##li.hz-Listing:has-text(/Heel Nederland/)
www.marktplaats.nl##li.hz-Listing:has-text(/Buitenland/)
www.marktplaats.nl##li.hz-Listing:has-text(/BVA Auctions/)
www.marktplaats.nl##li.hz-Listing:has-text(/Hollandia Autolease/)
www.marktplaats.nl###adsense-root
www.marktplaats.nl##div.hz-Banner--fluid.hz-Banner
www.marktplaats.nl##.hz-Listings__container--cas
www.marktplaats.nl###adsense-container
www.marktplaats.nl##.hz-SuggestedSearches-popularKeywordPageLink
#!/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 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 ./