Skip to content

Instantly share code, notes, and snippets.

View kbabioch's full-sized avatar

Karol Babioch kbabioch

View GitHub Profile
@kbabioch
kbabioch / check_myip
Created April 22, 2017 20:07
Checks whether the given hostname matches the own external IP address. The external IP address is determined by querying https://myip.babioch.de.
#! /bin/sh
# Copyright (c) 2017 Karol Babioch <karol@babioch.de>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@a-dma
a-dma / yubitouch.sh
Last active March 10, 2022 14:43
Bash script for setting or clearing touch requirements for cryptographic operations in the OpenPGP application on a YubiKey 4.
#!/bin/bash
# Bash script for setting or clearing touch requirements for
# cryptographic operations the OpenPGP application on a YubiKey 4.
#
# Author: Alessio Di Mauro <alessio@yubico.com>
GCA=$(which gpg-connect-agent)
DO=0
UIF=0
@Bouni
Bouni / dump-luxtronik.py
Created October 26, 2021 05:21
Dump all readings from a Luxtronik heatpump
from luxtronik import Luxtronik
l = Luxtronik('192.168.88.11', 8889)
print("="*80)
print ('{:^80}'.format(' Parameters '))
print("="*80)
for n, p in l.parameters.parameters.items():
print(f"Number: {n:<5} Name: {p.name:<60} Type: {p.__class__.__name__:<20} Value: {p.value}")
@thomasfr
thomasfr / iptables.sh
Last active February 13, 2024 15:44
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active March 3, 2024 22:21
Ansible variable precedence (order, hierarchy)
@kbabioch
kbabioch / wireguard
Last active March 12, 2024 14:35
LSBInitScript for Wireguard: This is a leightweight init script for Wireguard. While Wireguard itself requires only minimal overhead to setup and start, it still requires some script invocations (e.g. during boot).
#! /bin/bash
# Copyright (c) 2021 Karol Babioch <karol@babioch.de>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,