Skip to content

Instantly share code, notes, and snippets.

@jwalzer
jwalzer / latest-widevine.sh
Created July 18, 2016 09:54 — forked from ruario/intro-latest-widevine.md
Fetches Chrome and extracts out Widevine so that it can be used by Vivaldi. Also works with other Chromium-based browsers, see guide below.
#!/usr/bin/env bash
available () {
command -v $1 >/dev/null 2>&1
}
# Make sure we have wget or curl
if available wget; then
SILENT_DL="wget -qO-"
LOUD_DL="wget"
#!/usr/bin/python
import bs4 as BeautifulSoup
import collections
import os
import os.path
import requests
import shutil
import subprocess
import sys
@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()
{
@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 / 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]
#!/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##*/}"
#!/bin/bash
DEBUG=false
prefix=
preamble_printed=
PREAMBLE() {
[ "$preamble_printed" != 1 ] || return 0
cat << EOF
@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",
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