Windows 11 micophone level keeps adjusting

For a few weeks now I had the problem that the microphone level in windows kept going down. Wen I set it to 100% and look a few minutes later its at 96 % or lower.
I did unset the exclusive-mode uder advances with no avail.
So I did what any sane person does: I wrote a software which detecs the change and resets it to my desired level!

Sourcecode: https://gitlab.efana.de/sheepchen/MicAdjuster
Programm: https://nextcloud.sheepchen.net/index.php/s/AZyiam3rE5pii6D (compiled win_x64)

The Program reads in the current level at start. After this it will keep the level you tell him.
Every second it checks the windows setting against your desired value and changes it if it differs.
Minimize minimizes it into the NotifyTray. If you wan’t to get rid of it, just quit it. The is no installer, config, registry or something like that.

And in my case: I found out that it was the game Helldivers 2 !

gitlab ‘edit single file’ not working for files in subdirs (behind proxy)

If you use gitlab behind an apache proxy and can’t edit files that are in subdirs with the “Edit > edit single file” button (just loading circle) – here is the Problem: this happends because the proxy translates the ‘%2F’ in the URL paths!
You have to add “AllowEncodedSlashes NoDecode” to your proxy. here is a valid configuration:

Apache HTTP:

# Allow encoded slashes
AllowEncodedSlashes NoDecode

# Redirect all HTTP traffic to HTTPS
Redirect permanent / https://this-target/

Apache HTTPS:

# Proxy settings
ProxyPreserveHost On

# Allow encoded slashes
AllowEncodedSlashes NoDecode

# Proxy configuration
ProxyPass / http://gitlab-target:80/ nocanon
ProxyPassReverse / http://gitlab-target:80/

Threads in bash 2

you want threads in bash and know exactly when they finish and in which state?

#!/bin/bash

threads=()
f_getThreadKeyword(){ for i in ${threads[@]}; do [[ $(echo $i|cut -d':' -f2) == $1 ]] && echo $(echo $i|cut -d':' -f1); done; }  # returns the keyword for a given pid
f_addThread(){ keyword=$1; pid=$2; threads+=( "$keyword:$pid" ); echo "added thread $keyword ($pid)"; }  # adds a thread to the array
f_removeThread(){ pid=$1; threads=( ${threads[@]/$(f_getThreadKeyword $pid):$pid} ); }  # removes a thread to the array
f_getThreadPids(){ echo ${threads[@]}|tr ' ' '\n'|cut -d':' -f2|tr '\n' ' '; }   # returns all pids


sleep 3 &
f_addThread first $!

sleep 10 &
f_addThread second $!

sleep 5 &
f_addThread third $!


while [[ $(jobs|grep -iE 'läuft|running' -c) -gt 0 ]]; do  # there are running background jobs
  wait -p next -n $(f_getThreadPids)
  err=$?
  echo pid $next exited with $err \($(f_getThreadKeyword $next)\)
  f_removeThread $next
done

echo done

Output:

added thread first (1429283)
added thread second (1429285)
added thread third (1429286)
pid 1429283 exited with 0 (first)
pid 1429285 exited with 143 (second)
pid 1429286 exited with 0 (third)

(I killed the second thread from another console)

Programming ATtiny85 via Arduino ISP

Most information comes from this site: https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP/

I created an Arduino Nano header so I don’t have to recable a nano every time I want to burn or programm a Tiny.
This board comes on top of the Nano like a sandwitch.

TBD – photo of endproduct

After this you have to programm the ISP

first choose your connection. For me it was: Tools > Port > COM5
After this choose the ISP skatch: File > Examples > 11.ArduinoISP > ArduinoISP
Upload the Sketch to the Nano

Setup Environment to use the newly created ISP

Switch the chiptype to the one you want to program (daughter):
Tools > Board > ATTinyCore (ATTinyCore) > ATtiny85 (Micronucleus / DigiSpark)
Tools > Programmer > Arduino as ISP
Tools > Burn Bootloader Method > Fresh install (via ISP)

Now you can burn Tinys with: Tools > Burn Bootloader
Or upload sketches to them via the ISP: Sketch > Upload Using Programmer

TBD – video of programming and Test

massping script

just a little script which pings a defined number of servers a defined time and give you the result. Good for looking if you connection is stable or if it may be an internet problem.

#!/bin/bash

targets=( 1.1.1.1 8.8.8.8 cloudflare.com discord.com )
max=100


tmpfile=$$.massping.tmp

# functions
f_ping(){
  v=$(ping -c $max $1 2>/dev/null|grep received|cut -d' ' -f4)
  echo $1 $v >> $tmpfile
}

f_done(){
  [[ ! -f $tmpfile ]] && echo false && return
  [[ $(wc -l $tmpfile 2>/dev/null|cut -d' ' -f1) -eq ${#targets[@]} ]] && echo true && return
  echo false
}

# main
for s in ${targets[@]}; do
  f_ping $s &
done

c=$max; echo
while [[ $(f_done) == false ]]; do
  echo -e "\e[1A\e[Kwaiting. This should need $c more seconds.."
  c=$(( $c - 1 ))
  sleep 1
done
echo -e "\e[1A\e[Kdone"; echo

maxline=0; for w in $(cat $tmpfile|cut -d' ' -f1); do [[ ${#w} -gt $maxline ]] && maxline=${#w}; done
spaces=""; while [[ $(( ${#spaces} + 1 )) -lt $maxline ]]; do spaces="$spaces "; done
echo "server${spaces}%"
IFS="
"
while read -r line; do
  server=$(echo $line|cut -d' ' -f1)
  count=$(echo $line|cut -d' ' -f2)
  perc=$(echo "scale=1; $count * 100 / $max"|bc)
  spaces=""; while [[ $(( ${#spaces} + ${#server} - ( 5 - ${#perc} ) )) -lt $maxline ]]; do spaces="$spaces "; done
  echo "${server}${spaces} ${perc}"
done < $tmpfile

[[ -f $tmpfile ]] && rm -f $tmpfile

exampleoutput:

server             %
1.1.1.1        100.0
8.8.8.8        100.0
cloudflare.com  99.0
discord.com     85.0