Pipewire and copying audio to two outputs

1 minute read Published: 2021-12-29

#Pipewire is a nice replacement for #Pulseaudio, even if it still lacks some features and tooling. I switched to pipewire a couple of weeks ago and it solved many small papercuts that pulseaudio had for me, like USB audio being broken after it was disconnected once.

Sometimes I want audio from a single source (e.g. a stream played by firefox) to go to multiple sinks: two headphones for example or speakers and headphones.

Bash: Import variables from a .env file

1 minute read Published: 2021-07-26

This sets and exports all variables set in a .env file that can also be used by systemd to setup environment variables.

# Read and export the variables from .env
source "$HOME/.env"
while read -r var; do
        export "${var?}"
done < <(sed -e 's_=.*$__' "$HOME/.env")

Update: Apparently set -a / set +a before and after the sourcing makes it a lot easier. Thanks @bekopharm@social.tchncs.de for this hint.

#bash #systemd

various FFMPEG command lines

1 minute read Published: 2021-07-24

A selection of various command lines for #ffmpeg that I either found online and used and adapted somehow or built myself

Ansible run_once & when

1 minute read Published: 2021-05-26

Ansible has issues with "run_once" and "when" in the same task. If the "when" only evaluates to true for some hosts, it's basically undefined wether the task will run or be skipped based on whatever host happens to be the first one to be evaluated. If the first one is skipped, the task won't even run once if all others would evaluate as true.

Ansible ... why???

1 minute read Published: 2021-05-05
with_items: "{{ old_mounts | sort | reverse }}"

results in...

item=<list_reverseiterator object at 0x7fdc252dad60>

The "fix" is to use the list filter:

with_items: "{{ old_mounts | sort | reverse | list }}"