This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Generate a DNSSEC DS record based on the incoming DNSKEY record | |
The DNSKEY can be found using for example 'dig': | |
$ dig DNSKEY secure.widodh.nl | |
The output can then be parsed with the following code to generate a DS record | |
for in the parent DNS zone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Use BGP+EVPN for VXLAN with CloudStack instead of Multicast | |
# | |
# Place this file on all KVM hypervisors at /usr/share/modifyvxlan.sh | |
# | |
# More information about BGP and EVPN with FRR: https://vincent.bernat.ch/en/blog/2017-vxlan-bgp-evpn | |
# | |
DSTPORT=4789 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Create a 8GB eMMC image for Tesla Model S/X MCU1 | |
# | |
# Example usage: ./mkteslaemmcimg.sh ./vinXXXXX.img ./develop-2019.20.2.1-16-5659e07dfd.img | |
# | |
set -e | |
FIRMWARE=$2 | |
IMAGE=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Put Tesla MCU1 in factory mode | |
# | |
# Call over diagnostics port with seceth enabled | |
# | |
# Reboot MCU afterwards | |
# | |
VALUE=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
listen [::]:80; | |
server_name localhost; | |
client_max_body_size 0; | |
proxy_buffering off; | |
proxy_set_header Host $host; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Author: Wido den Hollander <wido@widodh.nl> | |
# | |
# Proxy all TCP and UDP IPv4 traffic from 192.168.100.230 to 10.0.100.50 | |
# | |
# This can be used as a (temporary) proxy when you want to renumber a machine and want | |
# to make sure it's still available on it's old address | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# For each running OSD query the BlueStore DB size and entries and calculate avg size per entry | |
# | |
# Author: Wido den Hollander <wido@widodh.nl> | |
# | |
for OSD_ID in $(find /var/run/ceph -name 'ceph-osd.*.asok' -type s -printf "%f\n"|cut -d '.' -f 2); do | |
DB_USED_BYTES=$(ceph daemon osd.$OSD_ID perf dump|jq '.bluefs.db_used_bytes') | |
BLUESTORE_ONODES=$(ceph daemon osd.$OSD_ID perf dump|jq '.bluestore.bluestore_onodes') | |
echo "osd.$OSD_ID: db_used_bytes=$DB_USED_BYTES bluestore_onodes=$BLUESTORE_ONODES db_entry_size=$(($DB_USED_BYTES / BLUESTORE_ONODES))" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# udev rule to set disk schedulers for Ceph | |
# For spinning disks we want the CFQ scheduler so that we can set | |
# priorities on client and recovery I/O threads | |
# | |
# Author: Wido den Hollander <wido@42on.com> | |
# Date: July 2015 | |
# Use deadline for SSDs | |
ACTION=="add|change", KERNEL=="sd[a-z]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="deadline" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Simple script to change lights on Philips Hue using cURL | |
# | |
# Source: http://hkionline.net/posts/using-phillips-hue-from-the-command-line | |
# | |
# Author: Wido den Hollander <wido@denhollander.io> | |
# | |
# YES! Philips Hue also talks IPv6! :-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Generate a random IPv6 address for a specified subnet | |
""" | |
from random import seed, getrandbits | |
from ipaddress import IPv6Network, IPv6Address | |
subnet = '2001:db8:100::/64' |
NewerOlder