Skip to content

Instantly share code, notes, and snippets.

☕️
a damn fine cup of coffee

Andreas Linz klingtnet

☕️
a damn fine cup of coffee
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
klingtnet / how-to-remove-bloatware-from-android-without-root-using-adb-only.md
Created Jul 27, 2019
How to remove bloatware from android without root using adb only
View how-to-remove-bloatware-from-android-without-root-using-adb-only.md

How to remove bloatware from android without root using adb only

  1. Make sure that USB debugging is enabled.
  2. Deactivate all bloatware apps.
  3. List the names of all deactivated packages:
$ adb shell pm list packages -d
View compare-svg-renderers.sh
#!/bin/bash
set -euo pipefail
inkscape --without-gui --export-png inkscape.png --export-dpi=120 example.svg
convert -density 120 example.svg imagemagick.png
python -m venv venv && venv/bin/pip install cairosvg && venv/bin/cairosvg --dpi 120 --output cairosvg.png example.svg
curl --location --fail --silent https://github.com/RazrFalcon/resvg/archive/v0.7.0.tar.gz | tar --extract --gzip && cargo build --features=qt-backend --release --manifest-path=resvg-0.7.0/tools/rendersvg/Cargo.toml && ./resvg-0.7.0/target/release/rendersvg --dpi 120 example.svg qt.png
curl --silent --location --fail 'http://www.apache.org/dyn/closer.cgi?filename=/xmlgraphics/batik/binaries/batik-bin-1.11.tar.gz&action=download' | tar --gzip --extract batik-1.11/batik-rasterizer-1.11.jar && java -jar batik-1.11/batik-rasterizer-1.11.jar -dpi 120 -d batik.png example.svg
chromium --headless --disable-gpu --screenshot=chrome-headless.png --window-size=449x35 $PWD/example.svg
View multi-document-yaml-decoding.go
package main
import (
"bytes"
"fmt"
"io"
"log"
"gopkg.in/yaml.v2"
)
@klingtnet
klingtnet / benchmark-cpu-vulnerability-mitigations.md
Last active May 17, 2019
Benchmark CPU vulnerability mitigtations
View benchmark-cpu-vulnerability-mitigations.md

Kernel options:

$ curl -s 'https://make-linux-fast-again.com/'
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
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 (
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"net/url"
"time"
)
@klingtnet
klingtnet / modern-python-project-setup.md
Created Feb 27, 2019
WIP: Modern Python Project Setup
View modern-python-project-setup.md
@klingtnet
klingtnet / uhe-linux-all.sh
Last active Feb 10, 2019
Install all u-he x64 linux betas
View uhe-linux-all.sh
#!/bin/bash
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
_URL="https://www.u-he.com/downloads/linux/beta/${VERSION}/${SYNTH}-${VERSION}.tar.xz"
echo Downloading $_URL and extracting to $_TMPDIR
@klingtnet
klingtnet / tcp-server.rs
Created Oct 29, 2018
Rust TCP to STDOUT server
View tcp-server.rs
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
klingtnet / how-to-make-beautiful-call-graphs-for-rust.md
Created Oct 7, 2018
How to make beautiful call graphs for Rust
View how-to-make-beautiful-call-graphs-for-rust.md

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
You can’t perform that action at this time.