Skip to content

Instantly share code, notes, and snippets.

@oromate
oromate / fixing-audio.sh
Created February 10, 2022 21:18
Having both speakers and headphones plugged in and switching in software on-the-fly
#!/bin/bash
fL=0
fLp=0
base_url="/usr/share/pulseaudio/alsa-mixer/paths"
Aurl="$base_url/analog-output-speaker.conf"
Burl="$base_url/analog-output-headphones.conf"
fL=$(grep -n "Jack Headphone" $Aurl | awk -F ":" '{print $1}')
echo "$fL"
echo "$fLp"
fLp=$(($fL + 2))
@oromate
oromate / mp_pool.py
Created March 10, 2019 02:04
pool simple sample
import multiprocessing
from time import sleep
from random import randint
def f(tnumber, data):
n = randint(2, 6)
print(f'Thread {tnumber} - calculating {data} (estimated time {n}s)')
sleep(n)
print(f'Thread {tnumber} - finished')