Skip to content

Instantly share code, notes, and snippets.

View cfra's full-sized avatar
🚀

Christian Franke cfra

🚀
View GitHub Profile
@cfra
cfra / rgb-yuv-color-snafu.md
Last active July 12, 2022 21:21
Converting RGB PNGs to H.264 with Correct Colors

Colors in Video

Disclaimer: I don't have a deep understanding of this topic, so take everything I have written up here with a grain of salt. This also is all from the perspective of 8 bit SDR video. HDR video is probably a whole other can of worms.

YCbCr and Chroma Subsampling

This describes my observations about Converting from RGB to video, attempting to match colors when encoding using libx264.

@cfra
cfra / pulseaudio-u44.md
Last active July 31, 2023 14:57
Zoom U-44 PulseAudio Setup

Zoom U-44 PulseAudio Setup

Problem Statement

The Zoom U-44 works out of the box with recent Linux versions.

By default, PulseAudio will register it as a single sink with 4 output channels. As the U-44 is organized to have two stereo pairs for outputs, there are situations where it is more useful to have 2 separate sinks available, each playing back to one of the two stereo pairs.

@cfra
cfra / ethernet-socat-ssh.md
Last active April 2, 2024 14:22
Tunneling Ethernet Over SSH With Socat and Tap Devices

Tunneling Ethernet Over SSH With Socat and Tap Devices

There are circumstances where one wants to attach the local machine to the same layer 2 ethernet segment, which a remote machine is connected to, with the only available transport being SSH.

While this solution has quite some shortcomings and should not be used to replace a real VPN, it can be beneficial e.g. for debugging network issues remotely.

@cfra
cfra / ISIS_TLV_ADDITION.md
Created February 8, 2019 12:58
Describes how to add new IS-IS TLV to FRR's isisd

Adding a new TLV and SubTLVs to FRR's isisd

Protocol description

For this first example, we are going to add a TLV called hundred with the currently unassigned codepoint 100.

That TLV has the following assumed format:

  • one octet: type this is 100
@cfra
cfra / naming-netns.md
Last active May 9, 2022 15:06
How to access an unnamed network namespace

Some programs might create network namespaces without registering them in /run/netns as iproute2 does. This makes it hard to access them with readily available tools like ip netns exec. However, there is a way to register those network namespace, after they have been created.

The following session creates and enters an unnamed namespace:

# unshare -n bash
# ip a l
1: lo:  mtu 65536 qdisc noop state DOWN group default qlen 1000
@cfra
cfra / eve-ng.md
Created July 10, 2018 13:49
How to install eve-ng on digitalocean

Installing eve-ng on digitalocean

  1. Create an Ubuntu 16.04 Droplet
  2. Set a root passwd
passwd root
@cfra
cfra / memtest-flashdrive.md
Last active March 26, 2021 07:40
Memtest from USB flash drive

Memtest on USB flash drive

Using Memtest86 Free Edition

At the time of writing, this installed V7.4 for UEFI and V4 for BIOS boot.

Caution: you have to use the correct device name for your flashdrive

wget https://www.memtest86.com/downloads/memtest86-usb.tar.gz
@cfra
cfra / dockerdrop.md
Last active September 26, 2022 07:13
How to setup Docker CE at Digitalocean with btrfs

Dropping the Docker

Based on this guide

We differ from the official docs by creating the btrfs before installing docker-ce.

Also we assume this is done as root.

Apperently, we can save ourself the effort to shuffle stuff around afterwards and have docker use the btrfs as intended, immediately after installation.

@cfra
cfra / slow-serial.md
Last active November 11, 2017 01:36
Automate slow Device over Serial

Automate slow Device over Serial

This describes how to push data to a device which doesn't react kindly when flooded with input.

It uses screen.

It is a hack.

It could be used for provisioning switches with config.

@cfra
cfra / freenas-iohyve.md
Last active February 14, 2018 05:23
A short description on how to use iohyve on FreeNAS 9.10

Introduction

FreeNAS 9.10 is based on FreeBSD 10.3 and as such, supports the BSD hypervisor bhyve. There are different frontends for bhyve, one of them is iohyve which is included in FreeNAS 9.10. This document describes how to setup iohyve for operation on FreeNAS 9.10 and basic VM management tasks.

Setting up Iohyve

Iohyve is already installed in FreeNAS 9.10, so it only needs to be enabled. This is done by adding the following lines to /conf/base/etc/rc.conf:

iohyve_enable="YES"

iohyve_flags="kmod=1 net=igb0 pool=storage-volume"