Skip to content

Instantly share code, notes, and snippets.

@jwalzer
jwalzer / wrap_qemu.bash
Created August 24, 2020 20:37
wrap qemu and filter out a conflicting parameters -- see description
#!/bin/bash
REAL_QEMU="$0.real"
ARGS=""
while [[ -n "$1" ]]
do
case "$1" in
-machine)
TS="$(date +%s.%3N)"
output_statistics() {
cat <<EOT
# HELP node_birdlg_lastpolldate_sec Last polling date of the lsb_info script
# TYPE node_birdlg_lastpolldate_sec counter
# HELP node_birdlg_lastpollduration_sec Duration of the lsb_info script
# TYPE node_birdlg_lastpollduration_sec gauge
EOT
@jwalzer
jwalzer / Grafana LG Bird Dashboard.json
Created July 29, 2020 17:35
Grafana Dashboard for looking into advertised routes
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
#!/bin/bash
DEBUG=false
prefix=
preamble_printed=
PREAMBLE() {
[ "$preamble_printed" != 1 ] || return 0
cat << EOF
#!/bin/bash
set -e -u -o pipefail
declare -A containers
declare -A paths
[[ -r /etc/default/docker_wrapper ]] && . /etc/default/docker_wrapper
callname="${0##*/}"
#!/bin/bash
set -e -u -o pipefail
declare -A containers
declare -A paths
[[ -r /etc/default/docker_wrapper ]] && . /etc/default/docker_wrapper
callname="${0##*/}"
@jwalzer
jwalzer / diskchecker.pl
Created May 14, 2019 07:38 — forked from bradfitz/diskchecker.pl
diskchecker.pl
#!/usr/bin/perl
#
# Brad's el-ghetto do-our-storage-stacks-lie?-script
#
sub usage {
die <<'END';
Usage: diskchecker.pl -s <server[:port]> verify <file>
diskchecker.pl -s <server[:port]> create <file> <size_in_MB>
diskchecker.pl -l [port]
@jwalzer
jwalzer / build.sh
Created April 26, 2019 13:09 — forked from julianxhokaxhiu/build.sh
How to build minimal ARM QEMU Static from sources with EXECVE
#!/bin/bash
#
# IMPORTANT!
# At the moment this script is forged only for Debian ( tested on 8.x release ).
# Although my efforts were put on building this also on Arch Linux or Alpine, at the moment only Debian seems to be able to build it.
# Also, not sure why these instructions where nowhere on the internet, therefore I leave them here for whoever need them.
#
###########
# Add Backports repo support
@jwalzer
jwalzer / rename_user.bash
Last active February 20, 2019 10:19
small script that goes for renaming default users from images to more suitable-ones (tested with raspbian)
#!/bin/bash
#
# this script will rename the user $1 on the system to $2
#
# Rename will be done by low-level substitution in the following files:
# /etc/passwd,/etc/shadow,/etc/group,/etc/gshadow,/etc/sudoers,/etc/sudoers.d
# ... and additionally the homedir will be renamed.
fail()
{
#!/usr/bin/python
import bs4 as BeautifulSoup
import collections
import os
import os.path
import requests
import shutil
import subprocess
import sys