Today I learned you can get the size of a block device with e.g.: sudo blockdev --getsize64 /dev/sda
Category Archives: Sys Admin
List of PLAYBACK Hardware Devices
Note to self:
------------------- Thu Mar 24 23:58:51 [bash:5.0.17 jobs:0 error:0 time:0] jj5@charm:/home/jj5 $ aplay -l **** List of PLAYBACK Hardware Devices **** card 1: Audio [USB Audio], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Audio [USB Audio], device 1: USB Audio [USB Audio #1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Audio [USB Audio], device 2: USB Audio [USB Audio #2] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: Audio [USB Audio], device 3: USB Audio [USB Audio #3] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: HDMI [HDA ATI HDMI], device 7: HDMI 1 [HDMI 1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: HDMI [HDA ATI HDMI], device 8: HDMI 2 [HDMI 2] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: HDMI [HDA ATI HDMI], device 9: HDMI 3 [HDMI 3] Subdevices: 1/1 Subdevice #0: subdevice #0 card 2: HDMI [HDA ATI HDMI], device 10: HDMI 4 [HDMI 4] Subdevices: 1/1 Subdevice #0: subdevice #0 -------------------
Stuttering audio on Ubuntu on Asus ROG Strix Z690-F Motherboard
My new computer ‘charm‘ wasn’t playing audio, there was just some incomprehensible and quiet static coming out of the speakers (I was testing with this). I ran this search and found this and ran this:
# apt install libavcodec-dev
Then I edited /etc/modprobe.d/alsa-base.conf
and added:
# 2022-03-24 jj5 - SEE: https://askubuntu.com/a/1059492 options snd-hda-intel position_fix=1
And I edited /etc/pulse/default.pa
and changed:
# 2022-03-24 jj5 - NEW: load-module module-udev-detect tsched=1 # 2022-03-24 jj5 - OLD: #load-module module-udev-detect
And I edited /etc/pulse/daemon.conf
and added this at the end:
; 2022-03-24 jj5 - SEE: https://ubuntuforums.org/showthread.php?t=766860&p=4816308#post4816308 default-sample-rate = 48000 default-fragments = 8 default-fragment-size-msec = 10
I also read this and ran this:
# apt install inxi # inxi -SMA # apt-get install --reinstall alsa-base pulseaudio $ mv ~/.config/pulse ~/.config/pulse.bak
Then after a reboot or two (and enabling USB Audio in BIOS) it started working! Probably didn’t need most of that, but I’m happy to have a solution.
John’s adventures
Bash Scripting Techniques
This in my feed today: 5 Modern Bash Scripting Techniques That Only A Few Programmers Know.
jless and visidata
Raspberry Pi vital statistics
I have a few RPis on my desk but I had no idea what version they were. I ran these commands to find out:
$ cat /proc/cpuinfo | grep Model $ free -h $ lsb_release -a $ ip a
How to write idempotent Bash scripts
This is great: How to write idempotent Bash scripts. Some highlights for me were `blkid` and `mountpoint`.
Snap-confine has elevated permissions
I tried to run `chromium` on my Kubuntu 20.04.3 LTS workstation and got the following error:
Snap-confine has elevated permissions and is not confined but should be. Refusing to continue to avoid permission escalation attacks
I found this and this worked for me:
systemctl enable --now apparmor.service systemctl enable --now snapd.apparmor.service