štvrtok 2. novembra 2023

piatok 14. apríla 2023

How to test microphone with pulseaudio



How to test that your microphone is working, using pulseaudio:

pactl load-module module-loopback latency_msec=1

To disable it again:

pactl unload-module module-loopback

Thanks to: https://askubuntu.com/a/262297

utorok 4. apríla 2023

Set file modification time based on file name (or EXIF data)

This snippet works for the Iphone image/movie files in format: YY-MM-DD HH24-MI-SS NNNN.ext


for f in *mov; do
  echo $f
  touch "$f" -t "20${f:0:2}${f:3:2}${f:6:2}${f:9:2}${f:12:2}.${f:15:2}"
done


Then, to overwrite with EXIF information from JPEG files:

exiv2 -T rename *.jpg


Useful snippet for some of the Iphone files/movies on my disk:

find . -type f -name \*720p.mov | while read LINE; do
  f=$(basename "$LINE")
  echo "$LINE"
  touch "$LINE" -t "20${f:0:2}${f:3:2}${f:6:2}${f:9:2}${f:12:2}.${f:15:2}"
done

Delete broken symlinks

Identify broken symbolic links:

find . -xtype l

To delete as well:

find . -xtype l -delete


Remove duplicate files

Use rdfind tool from Debian repo.

To find duplicate files in directories dir1 (and dir2) with results.txt output file produced:

rdfind dir1 [dir2]


To test:

rdfind -n true -deleteduplicates true dir1 dir2

To delete duplicates:

rdfind -deleteduplicates true dir1 dir2


utorok 4. októbra 2016

Eaton 3S disconnect problem

Recently I bought Eaton 3S UPS for my home server. I bought this model because it's supposed to have good Linux support and the size is quite small.

All works fine but after a few days I keep getting disconnects and machine load increases to about 2.0. The messages in syslog are:

Oct 4 06:54:13 atom2 upsmon[1785]: Poll UPS [eaton3s@localhost] failed - Data stale
Oct 4 06:54:16 atom2 kernel: [934148.871714] usb 1-5.2: device descriptor read/64, error -110
Oct 4 06:54:16 atom2 kernel: [934149.047613] usb 1-5.2: new low-speed USB device number 5 using xhci_hcd
Oct 4 06:54:18 atom2 upsmon[1785]: Poll UPS [eaton3s@localhost] failed - Data stale


What I need to do now is not only restart nut but also unload the xhci_hcd module:  

/etc/init.d/nut-client stop
/etc/init.d/nut-server stop

Check and kill all remaining processes:

ps -ef|grep -i -e usb -e hid -e ups -e eaton -e nut

Unload module:

modprobe -r xhci_hcd Load module:
modprobe xhci_hcd

Start nut:

/etc/init.d/nut-server start
/etc/init.d/nut-client start

štvrtok 11. apríla 2013

Lenovo USB Ethernet adapter and Debian

I bought Lenovo USB Ethernet adapter for my home PC that I set up as a router. The problem is Debian stable does not contain driver for this device (USB ID 17ef:7203), I needed to compile my own.
I found some help on the following pages:
Linux asix_devices.c
Case of the Broken Linux Driver (Lenovo USB 2.0 Ethernet 10/100 dongle)
I needed to change &ax88772b_info in the code snippet.