Skip to content

Instantly share code, notes, and snippets.

a damn fine cup of coffee

Andreas Linz klingtnet

Block or report user

Report or block klingtnet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
klingtnet /
Last active May 17, 2019
Benchmark CPU vulnerability mitigtations

Kernel options:

$ curl -s ''
noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off mitigations=off

Rust's click library was compiled as a benchmark (CPU bound on my machine (Lenovo X1C5):

klingtnet / handle-http-client-timeout.go
Created Mar 21, 2019
Handle HTTP client timeout in Go
View handle-http-client-timeout.go
package main
import (
klingtnet /
Created Feb 27, 2019
WIP: Modern Python Project Setup
klingtnet /
Last active Feb 10, 2019
Install all u-he x64 linux betas
set -euo pipefail
SYNTHS=(ACE Bazille ColourCopy Diva Filterscape Hive Podolski Presswerk Repro-1 Satin TrippleCheese Twangstrom Uhbik Zebra2)
_TMPDIR=$(mktemp -d --suffix=_uhe)
for SYNTH in ${SYNTHS[@]}; do
echo Downloading $_URL and extracting to $_TMPDIR
klingtnet /
Created Oct 29, 2018
Rust TCP to STDOUT server
use std::io;
use std::net::{TcpListener, TcpStream};
fn handle_client(mut stream: TcpStream) {
let sout = io::stdout();
let mut sout_handle = sout.lock();
io::copy(&mut stream, &mut sout_handle).expect("failed to copy into stdout");
fn main() -> io::Result<()> {
klingtnet /
Created Oct 7, 2018
How to make beautiful call graphs for Rust

I found the instructions in this [reddit comment][reddit] by the user fn_rust. Dependencies:

The instructions are illustrated on the [rb][rb] crate:

  1. Build a binary with debug symbols (no --release flag was given): cargo build --example saw
klingtnet /
Last active May 22, 2019
How to upgrade [Lenovo] NVMe SSD firmware on Linux

The instructions were tested on a Lenovo X1 Carbon 5th Gen (X1C5) on Arch Linux but should be applicable to other Lenovo models and Linux distributions.

BACKUP YOUR DATA! I created a bootable Ubuntu Image like this:

$ sudo sh -c 'curl --location --silent --fail "" | pv > /dev/<your-usb-drive>'
# note that pv is only there to show progress, it is perfectly fine to redirect curl to the usb drive directly.

then I booted from this drive by pressing F12 on reboot and dumped my NVMe disk to an external hard drive like this:

klingtnet /
Created Aug 29, 2018
Random login dialog appearing in xscreensaver

Random login dialog appearing in xscreensaver

If you're running XFCE then the solution is pretty simple, deactivate xfce-power-manager's presentation mode. In presentation mode the xfce-power-manager is sending keystrokes to keep the display awake. You can disable this mode by right clicking on the tray icon or by running:

$  xfconf-query --channel xfce4-power-manager --property /xfce4-power-manager/presentation-mode --set false
klingtnet /
Last active Aug 5, 2018
How to unmount webdrives on shutdown with systemd

The systemd service file that is triggered before the (note that systemd targets are somewhat similar to RunLevels of SysVinit):

# /etc/systemd/system/unmount-webdrives-on-shutdown.service
Description=Unmount webdrives before shutdown

ExecStart=/bin/bash /usr/local/bin/
klingtnet /
Created Aug 3, 2018
How to setup adbock on an OpenWRT router

How to setup adbock on an OpenWRT router

The following commands were used for a TP-Link WDR3500 with OpenWRT 18.06 and LuCI installed.

  1. ssh into the router

  2. Install the required packages

$ opkg install adblock luci-app-adblock ca-bundle ca-certificates libustream-openssl uclient-fetch
You can’t perform that action at this time.