Skip to content

Instantly share code, notes, and snippets.

View tillz's full-sized avatar

Till Zimmermann tillz

  • Hameln, Germany
View GitHub Profile
@tillz
tillz / bash_profile.sh
Created July 5, 2021 12:00
Add SSH public key in VirtualBox Guest as keystrokes
# I often setup virtual machines as pure headless machines with different linux distros.
# However, as the virtualbox GUI doesn't support c&p, scp and so on, ssh access is desired.
# As most distros forbid password-based login for the root account (which is great under normal conditions!)
# it'd be neccessary to either type in the hosts ssh key manually or use a temporary account.
# This simple bash macro (which assumes the personal ssh-keypair lies at `~/.ssh/id_rsa.pub`) types in a command
# and copies over the ssh key using simulated keypresses (May not work if host and guest have different keymaps!)
# Only argument is the UUID or machine name of the desired machine.
# After the key is typed in, please manually check the typed in command and press enter
function addsshkey() {
@tillz
tillz / execute_on_openwrt.sh
Created September 26, 2020 10:04
OpenWRT/Lede AP: Drop FritzBox Homeplug Broadcasts
#!/bin/sh
# Notes: AVM's FritzBox-Routers normally generate broadcast Homeplug-AV
# pakets nearly every second (used to allow for PnP-setup of these devices).
# As these pakets are responsible for a significant amount of Airtime,
# these should be blocked.
# Additionally, broadcast pakets on wifi prevent many devices from sleeping,
# and need to be transferred in legacy-rates, further bloating up the amount of wasted airtime.
# This script assumes the OpenWRT APs are 'dumb APs', whith a L2-Bridge between
# the wired and the wireless interfaces, were ebtables can block pakets based
# on their ethertype. (To check: ifconfig should only show wlan*, eth*, br-lan and lo interfaces)
@tillz
tillz / connect_test.c
Created September 19, 2019 09:34
connect_test.c mosquitto threaded - MWE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <mosquitto.h>
// compile with
// gcc -o connect_test -lmosquitto -pthread connect_test.c
// run with
// ./connect_test
@tillz
tillz / GeoJSON Wahlkreise Bundestagswahl 2013
Created May 23, 2013 23:45
GeoJSON Wahlkreise Bundestagswahl 2013
This file has been truncated, but you can view the full file.
#####GeoJSON Feature Collection der Bundestagswahlkreise zur Wahl des 18. Deutschen Bundestages. Die Daten sind #maschinenlesbar und koennen unter Angabe des untenstehenden Copyright-Hinweises verwendet werden. Ein Beispiel, die #Daten auf eine Deutschlandkarte zu Projizieren ist zum Beispiel unter Geojsonlint.com zu finden (Oben> Feature #Collection, dann einfuegen, auf "Validate" klicken und waaaaarten)
#
#
#© Bundeswahlleiter, Statistisches Bundesamt, Wiesbaden 2012,
#Wahlkreiskarte für die Wahl zum 18. Deutschen Bundestag
#Grundlage der Geoinformationen © Geobasis-DE / BKG (2011)
#Bitte versehen Sie bei jedweder Weiterverwendung in digitaler oder gedruckter Form das entsprechende Produkt mit #einem Copyright-Vermerk gemäß dem obigen Wortlaut.
#####
#Ab der uebernaechsten Zeile beginnt die GeoJSON Datei
#####