Monday, May 30, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Efficient way to dynamically change access rights for Samba; use ACL?

Posted: 30 May 2022 01:36 PM PDT

Suppose that I share the root of a data disk using Samba. The permissions I want are something like:

  1. There are only a few users.
  2. By default, the users can read all the content.
  3. Exception to 2: Some directories are not accessible (no read, no write) by default.
  4. When necessary, I want to manually give a user temporary read or write permission for a certain directory and its subdirectories for which the permission is not enabled by default.

Since Samba itself does not seem to fine access control, I think it should be done by the file system permission. On Windows, I could use Advanced Security Settings where I can specify complex permissions for multiple users/groups for this. When I had asked about a way to use ACL (because it seemed to be close to aforementioned Windows' feature), a person replied that Linux has such a great file permission system, that one would not need ACL, but when I asked about this Samba use case, he did not reply. Can what I want be done with normal file permissions like chown/chgrp, etc without ACL? Or is there any better way than ACL for this?

How to identify Linux partitions in windows disk manager

Posted: 30 May 2022 01:09 PM PDT

Currently, I have dual systems on my laptop. Ubuntu on the legacy harddrive and Windows on UEFI. I'm going to reinstall the Ubuntu but feel difficult to identify which partitions should be formatted.

There are around 11 partitions showing up on the Windows Disk Manager. enter image description here or enter image description here

followed the related question of How to identify partitions in Windows Disk Management

I made a conclusion: enter image description here

The four green colour partition should be okay to be formatted, but I am wondering about the BIOS partition. Should I leave it or format it?

thanks in advance

Can Bash scripts (or their children) be given special IDs that could be used to test against?

Posted: 30 May 2022 01:02 PM PDT

Is there something I could add to a Bash script to always assert correctly if it's running so a it can not be executed simultaneously with itself or some other script.

I was thinking like they way capture groups can be named in regex or the name or id keyword in HAProxy. A variable the could be set and unset at the end but, or a reliable version of this that is unset automatically in case of exiting prematurely (thus never unsetting this random variable blocking itself to run later)

Is there?

Grub updated and now I can't get in to the BIOS, how can I fix it?

Posted: 30 May 2022 12:30 PM PDT

Mint 20.2 system. Need to get to the BIOS so that I can boot from the USB stick into GParted, which is suddenly not happening automatically. I upgraded all my packages an hour ago (pretty sure grub updated too). Tried rebooting about five times now, holding down delete or f11 or f3. Delete definitely worked before the upgrade. I have tried pressing it several times and holding it down. I've tried pressing it constantly immediately after starting the reboot process. No matter what I do it just goes to the Mint splash screen.

The chipset is a Intel Celeron 3205U (Broadwell, embedded) if that helps. I can't find any info in the system manual as to the BIOS. I flashed the BIOS about 6 months ago to the most current version. The system is not dual boot. The machine's product page is here. The MSI product page is less helpful. The system is 6 years old.

Tried system-ctl reboot --firmware-setup and it says my firmware does not support that.

Tried reboot -f and it didn't go to the BIOS.

Tried a full power down and reboot, still can't get to the BIOS.

Tried editing grub to use menu instead of hidden, the grub menu won't show. The timeout is set to 10.

I have gotten in to the BIOS about 10 times in the past 2 days with no issue, just hold down DEL and it get's there. I am positive the USB stick is bootable, I booted in to Clonezilla off of it this morning. It's definitely plugged in.

I know there are similar questions here and I have tried those answers. The only thing I can think to do is factory reset my BIOS but I don't know if that's the smart choice.

Grub config:

GRUB_DEFAULT=0  GRUB_TIMEOUT_STYLE=menu  GRUB_TIMEOUT=10  GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`  GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"  GRUB_CMDLINE_LINUX=""  

Difference between sort -u and uniq -u

Posted: 30 May 2022 12:28 PM PDT

I always have been using sort -u to get rid of duplicates until now.
But I am having a real doubt about a list generated by a software tool.
The question is: is the output of sort -u |wc the same as uniq -u |wc?

Because they don't yield the same results. The manual for uniq specifies:

-u, --unique only print unique lines

My output consists of 1110 words for which sort -u keeps 1020 lines and uniq -u 1110 lines, the correct amount. The issue is that I cannot visually spot any duplicates on the list which is generated by using > at the end of the command line, and that there IS an issue with the total cracked passwords (in the context of customizing john the ripper).

Missing Icon on taskmanager KDE

Posted: 30 May 2022 12:02 PM PDT

Greatings, something is puzzling me on my linux install: I can't see the icons in the window and in the bottom bar, though I see it on the global app menu, search engine and file manger.

The application in Calibre, installed through flatpack and my distro is KDEneon.

Any tip to troubleshoot this is more than welcome, especially if you can explain me what went wrong :)

Executable permissions on files that do not need it

Posted: 30 May 2022 11:53 AM PDT

I would like to ask you who are familiar with security on unix-like systems how do you rate potential risk on for example config files (ASCII) that have executable flag configured on them.

Common sense would say obviously to go with the least privileges as possible but could you rate potential danger or point to exact example of abusing this in the real world?

As those files are mostly owned by root, in order to edit them you would need a root permission to change them and in that case you can even change the executable flag on it as well even for those with the flag unset.

Thanks in advance

How to build custom images with buildroot?

Posted: 30 May 2022 11:47 AM PDT

I need to build custom Linux image that I can burn on flash card and make it bootable?

How do I resolve Ipv6 related errors from NetworkManager

Posted: 30 May 2022 11:45 AM PDT

I started using nmcli instead of just iwd. I usually have ipv6 disabled. It works just fine but I'd like to get rid of th warnings.

# sudo journctl -u NetworkManager    May 30 09:51:59 1337 NetworkManager[499]: <warn>  [1653918719.7647] platform-linux: do-add-ip6-address[4: fe80::c2b0:7b0b:4420:320a]: failure 13 (Permission denied)    May 30 09:53:29 1337 NetworkManager[499]: <warn>  [1653918809.8212] ipv6ll[06195b9399eef6b4,ifindex=4]: changed: no IPv6 link local address to retry after Duplicate Address Detection failures (back off)    

Systemd Partof directive behavior when a component service restarts

Posted: 30 May 2022 11:38 AM PDT

I have an application that consists of several services : one backend service and several frontend services with auto-restart activated. After reading controlling-a-multi-service-application-with-systemd/, PartOf directive almost met my requirements : a contoller service is used to forward stop, start requests to the components except for the fact that if frontend (ComponnetB.service below) fails and is restarted by systemd, the whole group of services gets restarted.

What I'd like would be for componentB.service to restart without making the whole group to restart. Is it possible to do that with Systemd ?

Controller Service example-app.service:

[Unit]  Description=Controller Service    [Service]  Type=oneshot  Restart=no  ExecStart=/bin/true  RemainAfterExit=yes    [Install]  WantedBy=multi-user.target  

componentA.service:

[Unit]  PartOf=example-app.service  After=example-app.service    [Service]  Type=simple  Restart=no  User=root  Group=root  ExecStart=bash -c 'sleep infinity & sleep infinity & sleep infinity & sleep infinity && echo ok '    [Install]  RequiredBy=streamhub-app.service  

ComponentB.service:

[Unit]  PartOf=example-app.service  After=example-app.service    [Service]  Type=simple  Restart=always  RestartSec=5  ExecStart=sleep infinity    [Install]  RequiredBy=example-app.service  

How to find out with which user gvfs has connected to smb share

Posted: 30 May 2022 10:59 AM PDT

I can connect to network drives with the following command:

( echo myusername; echo MYDOMAIN; echo password123 ) | gio mount smb://127.0.0.1/Sharename  

And I can get some file attributes of the mount point:

gio info smb://127.0.0.1/Sharename    Anzeigename: Sharenameauf 127.0.0.1  Name bearbeiten: /  Name: /  Typ: directory  Größe:  0  Adresse: smb://127.0.0.1/Sharename/  Attribute:    standard::type: 2    standard::name: /    standard::display-name: Sharename auf 127.0.0.1    standard::edit-name: /    standard::icon: folder-remote, folder-remote-symbolic    standard::content-type: inode/directory    standard::size: 0    standard::allocated-size: 0    standard::symbolic-icon: folder-remote-symbolic, folder-remote    etag::value: 0    id::filesystem: smb-share:server=127.0.0.1,share=Sharename    access::can-trash: FALSE    time::modified: 0    time::modified-usec: 0    time::access: 0    time::access-usec: 0    time::changed: 0    time::changed-usec: 0    unix::device: 2648392497    unix::inode: 6160419607250089214  

But how can I fetch the name of the user that connected to the share ("myusername" in the case above)?

How can I fix "You don't have enough free space" in kali linux?

Posted: 30 May 2022 11:02 AM PDT

How can I fix "You don't have enough free space" in kali linux?

Import LVM VG with broken mirror

Posted: 30 May 2022 12:15 PM PDT

I have a PC running Kubuntu 21.10 I setup several months ago where I protected my data by using LVM mirroring with 2 physical 1 TB SSD disks. I recently had disk controller issues on that old PC that kept corrupting the ext4 filesystem so I bought a new PC. I used one of the old SSDs to build a new Kubuntu 22.04. I am now trying to use the other old SSD that still has the mirrored data from the old Kubuntu 21.10 (but obviously only half the mirrors that LVM was originally setup with). I never got a chance to vgexport the old 21.10 VG or LVMs. Still it seems reasonable that I should be able to import the old VG/LVMs that have the broken mirror (only 1 of the original 2 disks are available). But I can't figure out how. The new 22.04 does have a different VG name (vg00) so no VG name conflict (21.10 VG is named kubuntu). A "lsblk -f" does show the old 21.10 disk /dev/sda2 as "LVM2_member" so thats good. A "pvscan" also shows as /dev/sda2 as "lvm2". But I can't get "vgimport" to do anything. Any ideas?

Bspwm session displays only grey screen and keybindings dont work

Posted: 30 May 2022 10:09 AM PDT

Here are my bspwmrc and sxhkdrc files

  #AUTOSTART  picom --config ~/.config/picom/picom.conf  nitrogen --restore &  $HOME/.config/polybar/launch.sh  pgrep -x sxhkd > /dev/null || sxhkd &  xsetroot -cursor_name left_ptr &    bspc monitor -d "I" "II" "III" "IV" "V"    wm-restack = bspwm    bspc config border_width    0  bspc config window_gap      25    bspc config split_ratio     0.52  bspc config borderless_monocle  true  bspc config gapless_monocle true  bspc config focus_follows_pointer true    bspc rule -a Gimp desktop='^8' state=floating follow=on  bspc rule -a Chromium desktop='^2'  bspc rule -a mplayer2 state=floating  bspc rule -a kupfer.py focus=on  bspc rule -a Screenkey manage=off  

#  # wm independent hotkeys  #    # terminal emulator  super + Return      alacritty    # program launcher  super + p      dmenu_run    # make sxhkd reload its configuration files:  super + Escape      pkill -USR1 -x sxhkd    #  # bspwm hotkeys  #    # quit/restart bspwm  super + alt + {q,r}      bspc {quit,wm -r}    # close and kill  super + {_,shift + }w      bspc node -{c,k}    # alternate between the tiled and monocle layout  super + m      bspc desktop -l next    # send the newest marked node to the newest preselected node  super + y      bspc node newest.marked.local -n newest.!automatic.local    # swap the current node and the biggest window  super + g      bspc node -s biggest.window    #  # state/flags  #    # set the window state  super + {t,shift + t,s,f}      bspc node -t {tiled,pseudo_tiled,floating,fullscreen}    # set the node flags  super + ctrl + {m,x,y,z}      bspc node -g {marked,locked,sticky,private}    #  # focus/swap  #    # focus the node in the given direction  super + {_,shift + }{h,j,k,l}      bspc node -{f,s} {west,south,north,east}    # focus the node for the given path jump  super + {p,b,comma,period}      bspc node -f @{parent,brother,first,second}    # focus the next/previous window in the current desktop  super + {_,shift + }c      bspc node -f {next,prev}.local.!hidden.window    # focus the next/previous desktop in the current monitor  super + bracket{left,right}      bspc desktop -f {prev,next}.local    # focus the last node/desktop  super + {grave,Tab}      bspc {node,desktop} -f last    # focus the older or newer node in the focus history  super + {o,i}      bspc wm -h off; \      bspc node {older,newer} -f; \      bspc wm -h on    # focus or send to the given desktop  super + {_,shift + }{1-9,0}      bspc {desktop -f,node -d} '^{1-9,10}'    #  # preselect  #    # preselect the direction  super + ctrl + {h,j,k,l}      bspc node -p {west,south,north,east}    # preselect the ratio  super + ctrl + {1-9}      bspc node -o 0.{1-9}    # cancel the preselection for the focused node  super + ctrl + space      bspc node -p cancel    # cancel the preselection for the focused desktop  super + ctrl + shift + space      bspc query -N -d | xargs -I id -n 1 bspc node id -p cancel    #  # move/resize  #    # expand a window by moving one of its side outward  super + alt + {h,j,k,l}      bspc node -z {left -20 0,bottom 0 20,top 0 -20,right 20 0}    # contract a window by moving one of its side inward  super + alt + shift + {h,j,k,l}      bspc node -z {right -20 0,top 0 20,bottom 0 -20,left 20 0}    # move a floating window  super + {Left,Down,Up,Right}      bspc node -v {-20 0,0 20,0 -20,20 0}    

When i log in with gnome my window manager works fine so i think the problem is with bspwm because after logging into a bspwm session the only thing i can see is a grey screen with no errors or no cursor response whatsoever. The keybindings i set in sxhkdrc also do not seem to work either.

Login to Linux knowing only the root password

Posted: 30 May 2022 10:33 AM PDT

I tried top disable the password of my Debian user and must have done something stupid since now I can't login at all anymore with that user.

I do still have the root/sudo password. I tried to type in "root" as the user at the logon screen after the computer boots, but it didn't seem to accept that.

Is there a way to login to my Debian installation knowing only the root account password? Unfortunately I have not enabled SSH on the machine.

How do I see what version of certain libraries are being used by a snap package

Posted: 30 May 2022 11:02 AM PDT

I'm trying to determine what version of MESA the latest firefox snap package is using.

Is there a way this can be done?

Add extra field to a file for records that have 6 fields instead of 7

Posted: 30 May 2022 10:58 AM PDT

I have a problem with text files separated by commas, when I'm going to begin receiving files (hundreds of them) with a mixed layout, some records will have 7 fields(a total of 6 commas) and other records in the same file will have 6 fields (a total of 5 commas).

When I find a record with 5 commas, I want to add at the end of that record a comma followed by NA so my loading process thinks it has 7 fields, being the last one NA.

This is what I have right now, the first record has 7 fields, the second only 6:

200000003183000100,Data,NA,0,IN,0,0.00  200000004625000000,Data,NA,0,IN,0  

This is what I expect (both records with 7 fields)

200000003183000100,Data,NA,0,IN,0,0.00  200000004625000000,Data,NA,0,IN,0,NA  

Can this be done counting commas with sed or something similar and adding at the end of the file ,NA whenever there's only 5 commas. Please keep in mind this is going to happened for hundreds of files, so I don't know if I need to use the filename as a parameter so something like that.

Thanks!!!!

Can program notify itself any opened shell?

Posted: 30 May 2022 12:26 PM PDT

I am planning on write CLI program. This CLI program should have ability to run at scheduled time.

Is it possible for this program to somehow notify user's shell? Sort of like mail tells you that you have unread mail?

initramfs got corrupted/ misconfigured, how to boot properly?

Posted: 30 May 2022 12:10 PM PDT

How to boot properly, fix the boot loader? Why my initramfs-fallback have higher size than newly created? (use mkinitcpio instead update-initramfs on arch)

-rw-------  1 root root 29MB Mei 30 06:49 initramfs-5.10-x86_64-fallback.img  -rw-------  1 root root  9MB Mei 30 06:48 initramfs-5.10-x86_64.img  -rw-------  1 root root  9MB Mei 30 23:43 initramfs-subscribe-5.10-x86_64.img  

The initramfs is always missing for 8 month i just do via recovery fallback initramfs. What I notice is, even i do kernel update, it still missing. I assume it will be fixed when the newer kernels do post-transaction things. I do use dual boot, both arch and on a different drive (HDD and SDD).

detailed config and the old story

execute set of commands in group by {} vs () [duplicate]

Posted: 30 May 2022 01:44 PM PDT

I read this post:

I understand the answer, but having the option to execute a set of commands through either {} or () makes to create this post.

If the scenario(s) exists: when is mandatory use {} over () - and vice versa - and why?

Wifi won't connect after delete almost all package

Posted: 30 May 2022 10:52 AM PDT

Earlier I wanted to make Linux Ubuntu GUI to a CLI, after I changed my Linux to CLI. I removed all GUI related packages without further reading a depency that will delete (eg, X11).

However after I reboot, I find that my wifi can't connect to the internet or connected to router. I have tried restarting the wifi/Networkmanager, Even after reinstalling roughly what I deleted earlier, it still doesn't work.

Changes:

I've managed to fix it and get it working by running the command sudo nmcli device up wlx8c18d9e25879. But when rebooted, the wifi must be turned on manually using the command above, how do I make the wifi always turn on automatically when turned on? enter image description here

enter image description here

Ansible: How to dynamically construct menu with ansible.builtin.pause module

Posted: 30 May 2022 10:38 AM PDT

The goal here is to dynamically construct menu from available variable file
In this example I use ansible.builtin.pause module but not sure if this is best way
variable file: vars.yml

$ cat ./vars.yml  ---  menu:    ansible:      main:      - option: 1        name: "Add..."      - option: 2        name: "Delete..."      - option: 3        name: "Empty..."      add:        - option: 1          name: "Add something..."        - option: 2          name: "Add something to..."      delete:      empty:    ssh:      main:    

playbook: test.yml

$ cat ./test.yml  - name: "PLAY: > TEST"    hosts: localhost    gather_facts: no    vars_files: vars.yml    pre_tasks:      - name: Dynamicaly construct menu      pause:        prompt:          "\n          Ansible options:\n          =====================================\n          {{item.option}}- {{item.name}}"      register: result      loop: "{{menu.ansible.main}}"      - debug:         msg: "Option 1 was selected"      when: result.user_input == '1'    

Output:

PLAY [PLAY: > TEST] *******************************************************************************************************************************************************************************************************************************************************    TASK [Dynamicaly construct menu] ******************************************************************************************************************************************************************************************************************************************  [Dynamicaly construct menu]     Ansible options:   =====================================   1- Add...:    

As you could see it displays only part of the main not all

Question:

How to display all available options at once and save user selection, so I can run next task based on condition I'm pretty sure menu must be first generate and saved under one variable before sending to ansible.builtin.pause but not sure how

Thanks for help

How to pass an array as function argument but with other extra parameters?

Posted: 30 May 2022 11:15 AM PDT

The following post solution works as expected:

Therefore - from his answer:

function copyFiles() {     arr=("$@")     for i in "${arr[@]}";        do            echo "$i"        done    }    array=("one 1" "two 2" "three 3")    copyFiles "${array[@]}"  

The reason of this post is what if the following case happens:

copyFiles "${array[@]}" "Something More"  copyFiles "Something More" "${array[@]}"  

Problem: I did do realize about the arguments sent, when they are received how parameters in the function - they are practically merged - so $1 and $2 does not work as expected any more, the "array" argument integrates with the other argument

I already did do a research:

Sadly typeset -n does not work

and in:

does not work as expected - in that answer there is a comment indicating an issue - with a link with a demo testing/verification - about the array size (${#array[@]}) being different within the function.

So how accomplish this goal?

10-key (numeric keyboard) not working when connected via VNC to Fedora 35 or Ubuntu 21. Both are using GNOME - is this a bug?

Posted: 30 May 2022 11:40 AM PDT

I use VNC (RealVNC "VNC Viewer" app) on my Mac to connect to Linux desktops: Fedora 35 & Ubuntu 21. They both are using GNOME desktop: 41.1 for Fedora, and 40.5 for Ubuntu

I recently discovered that the 10-key (numeric) part of my Mac keyboard no longer works on either desktop when connected via VNC. These are both physical machines, but I have not yet tried actually connecting the same keyboard to the Linux machines yet since I need the VNC connection to work. I have disabled "Mouse Keys" but this has no effect and did not resolve the issue.

Is this a bug in GNOME perhaps? Worth mentioning that the 10-key does work in Windows and macOS when connected via VNC. Also, for whatever reason the 10-key does work in the calculator app in Linux, but nothing else. When trying to use the 10-key to enter numbers in a text editor app I just get the "ding" error sound. When trying to use it in the terminal it prints outs all caps letters: for example - 123456789 shows:

[me@fedora35 ~]$ BDECA

What's the point of firewalling outgoing connections?

Posted: 30 May 2022 11:47 AM PDT

I have a firewall (csf) that lets you to separately allow incoming and outgoing TCP ports. My question is, why would anyone want to have any outgoing ports closed?

I understand that by default you might want to have all ports closed for incoming connections. From there, if you are running an HTTP server you might want to open port 80. If you want to run an FTP server (in active mode) you might want to open port 21. But if it's set up for passive FTP mode, a bunch of ports will be necessary to receive data connections from FTP clients... and so on for additional services. But that's all. The rest of ports not concerned with a particular service that the server provides, and especially if you are mostly a client computer, must be closed.

But what about outgoing connections? Is there any security gain in having destination ports closed for outbound connections? I ask this because at first I thought that a very similar policy of closing all ports as for incoming connections could apply. But then I realised that when acting as a client in passive FTP mode, for instance, random high ports try to connect to the FTP server. Therefore by blocking these high ports in the client side you are effectively disabling passive FTP in that client, which is annoying. I'm tempted to just allow everything outgoing, but I'm concerned that this might be a security threat.

Is this the case? Is it a bad idea, or has it noticeable drawbacks just opening all (or many) ports only for outgoing connections to facilitate services such as passive FTP?

Pulseaudio no sound from speakers

Posted: 30 May 2022 01:51 PM PDT

Well, I know there are similar questions out there but none of their answers have actually solved my problem. I am running a Debian 10 (uname -a: Linux msi-debian 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2 (2019-08-28) x86_64 GNU/Linux)

The thing is I haven't been able to make speakers play a sound, even though microphone and headphones work.

On the other hand, while speakers are silent they are detected by the system. This is the info about my computer:

$ inxi -Fx    System:    Host: msi-debian Kernel: 4.19.0-6-amd64 x86_64 bits: 64 compiler: gcc v: 8.3.0 Desktop: Gnome 3.30.2              Distro: Debian GNU/Linux 10 (buster)   Machine:   Type: Laptop System: Micro-Star product: GL63 8SE v: REV:1.0 serial: <root required>              Mobo: Micro-Star model: MS-16P7 v: REV:1.0 serial: <root required> UEFI: American Megatrends v: E16P7IMS.105              date: 11/26/2018   Battery:   ID-1: BAT1 charge: 34.1 Wh condition: 49.6/53.4 Wh (93%) model: MSI BIF0_9 status: Discharging   CPU:       Topology: 6-Core model: Intel Core i7-8750H bits: 64 type: MT MCP arch: Kaby Lake rev: A L2 cache: 9216 KiB              flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 52992              Speed: 800 MHz min/max: 800/4100 MHz Core speeds (MHz): 1: 800 2: 800 3: 801 4: 800 5: 800 6: 800 7: 800 8: 800              9: 800 10: 800 11: 800 12: 800   Graphics:  Device-1: Intel UHD Graphics 630 vendor: Micro-Star MSI driver: i915 v: kernel bus ID: 00:02.0              Device-2: NVIDIA TU106M [GeForce RTX 2060 Mobile] vendor: Micro-Star MSI driver: nvidia v: 418.74 bus ID: 01:00.0              Display: x11 server: X.Org 1.20.4 driver: modesetting,nouveau,nvidia unloaded: fbdev,vesa              resolution: 1920x1080~120Hz              OpenGL: renderer: Mesa DRI Intel UHD Graphics 630 (Coffeelake 3x8 GT2) v: 4.5 Mesa 18.3.6 direct render: Yes   Audio:     Device-1: Intel Cannon Lake PCH cAVS vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 00:1f.3              Device-2: NVIDIA TU106 High Definition Audio vendor: Micro-Star MSI driver: snd_hda_intel v: kernel bus ID: 01:00.1              Sound Server: ALSA v: k4.19.0-6-amd64   Network:   Device-1: Intel Wireless-AC 9560 [Jefferson Peak] driver: iwlwifi v: kernel port: 6000 bus ID: 00:14.3              IF: wlo1 state: up mac: 48:a4:72:bd:e7:b4              Device-2: Qualcomm Atheros Killer E2400 Gigabit Ethernet vendor: Micro-Star MSI driver: alx v: kernel port: 3000              bus ID: 03:00.0              IF: enp3s0 state: down mac: 00:d8:61:05:39:c3              IF-ID-1: docker0 state: down mac: 02:42:fc:9c:14:12   Drives:    Local Storage: total: 1.14 TiB used: 6.68 GiB (0.6%)              ID-1: /dev/nvme0n1 vendor: Kingston model: RBUSNS8154P3256GJ size: 238.47 GiB              ID-2: /dev/sda vendor: Seagate model: ST1000LM049-2GH172 size: 931.51 GiB   Partition: ID-1: / size: 91.17 GiB used: 5.95 GiB (6.5%) fs: ext4 dev: /dev/sda4              ID-2: /home size: 137.24 GiB used: 749.6 MiB (0.5%) fs: ext4 dev: /dev/sda5              ID-3: swap-1 size: 15.82 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/sda6   Sensors:   System Temperatures: cpu: 49.0 C mobo: N/A              Fan Speeds (RPM): N/A   Info:      Processes: 297 Uptime: 1h 58m Memory: 15.51 GiB used: 3.01 GiB (19.4%) Init: systemd runlevel: 5 Compilers:              gcc: 8.3.0 Shell: bash v: 5.0.3 inxi: 3.0.32   

The info in pulseaudio is:

$ pacmd list-cards  2 card(s) available.      index: 0      name: <alsa_card.pci-0000_01_00.1>      driver: <module-alsa-card.c>      owner module: 6      properties:          alsa.card = "1"          alsa.card_name = "HDA NVidia"          alsa.long_card_name = "HDA NVidia at 0xa5080000 irq 17"          alsa.driver_name = "snd_hda_intel"          device.bus_path = "pci-0000:01:00.1"          sysfs.path = "/devices/pci0000:00/0000:00:01.0/0000:01:00.1/sound/card1"          device.bus = "pci"          device.vendor.id = "10de"          device.vendor.name = "NVIDIA Corporation"          device.product.id = "10f9"          device.product.name = "TU106 High Definition Audio Controller"          device.string = "1"          device.description = "TU106 High Definition Audio Controller"          module-udev-detect.discovered = "1"          device.icon_name = "audio-card-pci"      profiles:          output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: no)          output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 800, available: no)          output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 800, available: no)          output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no)          output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no)          output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no)          off: Inactiu (priority 0, available: unknown)      active profile: <off>      ports:          hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)              properties:                  device.icon_name = "video-display"          hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)              properties:                  device.icon_name = "video-display"      index: 1      name: <alsa_card.pci-0000_00_1f.3>      driver: <module-alsa-card.c>      owner module: 7      properties:          alsa.card = "0"          alsa.card_name = "HDA Intel PCH"          alsa.long_card_name = "HDA Intel PCH at 0xa5410000 irq 154"          alsa.driver_name = "snd_hda_intel"          device.bus_path = "pci-0000:00:1f.3"          sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"          device.bus = "pci"          device.vendor.id = "8086"          device.vendor.name = "Intel Corporation"          device.product.id = "a348"          device.product.name = "Cannon Lake PCH cAVS"          device.form_factor = "internal"          device.string = "0"          device.description = "Audio intern"          module-udev-detect.discovered = "1"          device.icon_name = "audio-card-pci"      profiles:          input:analog-stereo: Estèreo analògic Input (priority 65, available: unknown)          output:analog-stereo: Estèreo analògic Output (priority 6500, available: unknown)          output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6565, available: unknown)          output:iec958-stereo: Estèreo digital (IEC958) Output (priority 5500, available: unknown)          output:iec958-stereo+input:analog-stereo: Estèreo digital (IEC958) Output + Estèreo analògic Input (priority 5565, available: unknown)          output:iec958-ac3-surround-51: Envolvent digital 5.1 (IEC958/AC3) Output (priority 300, available: no)          output:iec958-ac3-surround-51+input:analog-stereo: Envolvent digital 5.1 (IEC958/AC3) Output + Estèreo analògic Input (priority 365, available: unknown)          output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5900, available: no)          output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Estèreo analògic Input (priority 5965, available: unknown)          output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 800, available: no)          output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Estèreo analògic Input (priority 865, available: unknown)          output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 800, available: no)          output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Estèreo analògic Input (priority 865, available: unknown)          output:hdmi-stereo-extra1: Digital Stereo (HDMI 2) Output (priority 5700, available: no)          output:hdmi-stereo-extra1+input:analog-stereo: Digital Stereo (HDMI 2) Output + Estèreo analògic Input (priority 5765, available: unknown)          output:hdmi-surround-extra1: Digital Surround 5.1 (HDMI 2) Output (priority 600, available: no)          output:hdmi-surround-extra1+input:analog-stereo: Digital Surround 5.1 (HDMI 2) Output + Estèreo analògic Input (priority 665, available: unknown)          output:hdmi-surround71-extra1: Digital Surround 7.1 (HDMI 2) Output (priority 600, available: no)          output:hdmi-surround71-extra1+input:analog-stereo: Digital Surround 7.1 (HDMI 2) Output + Estèreo analògic Input (priority 665, available: unknown)          output:hdmi-stereo-extra2: Digital Stereo (HDMI 3) Output (priority 5700, available: no)          output:hdmi-stereo-extra2+input:analog-stereo: Digital Stereo (HDMI 3) Output + Estèreo analògic Input (priority 5765, available: unknown)          output:hdmi-surround-extra2: Digital Surround 5.1 (HDMI 3) Output (priority 600, available: no)          output:hdmi-surround-extra2+input:analog-stereo: Digital Surround 5.1 (HDMI 3) Output + Estèreo analògic Input (priority 665, available: unknown)          output:hdmi-surround71-extra2: Digital Surround 7.1 (HDMI 3) Output (priority 600, available: no)          output:hdmi-surround71-extra2+input:analog-stereo: Digital Surround 7.1 (HDMI 3) Output + Estèreo analògic Input (priority 665, available: unknown)          output:hdmi-stereo-extra3: Digital Stereo (HDMI 4) Output (priority 5700, available: no)          output:hdmi-stereo-extra3+input:analog-stereo: Digital Stereo (HDMI 4) Output + Estèreo analògic Input (priority 5765, available: unknown)          output:hdmi-surround-extra3: Digital Surround 5.1 (HDMI 4) Output (priority 600, available: no)          output:hdmi-surround-extra3+input:analog-stereo: Digital Surround 5.1 (HDMI 4) Output + Estèreo analògic Input (priority 665, available: unknown)          output:hdmi-surround71-extra3: Digital Surround 7.1 (HDMI 4) Output (priority 600, available: no)          output:hdmi-surround71-extra3+input:analog-stereo: Digital Surround 7.1 (HDMI 4) Output + Estèreo analògic Input (priority 665, available: unknown)          output:hdmi-stereo-extra4: Digital Stereo (HDMI 5) Output (priority 5700, available: no)          output:hdmi-stereo-extra4+input:analog-stereo: Digital Stereo (HDMI 5) Output + Estèreo analògic Input (priority 5765, available: unknown)          output:hdmi-surround-extra4: Digital Surround 5.1 (HDMI 5) Output (priority 600, available: no)          output:hdmi-surround-extra4+input:analog-stereo: Digital Surround 5.1 (HDMI 5) Output + Estèreo analògic Input (priority 665, available: unknown)          output:hdmi-surround71-extra4: Digital Surround 7.1 (HDMI 5) Output (priority 600, available: no)          output:hdmi-surround71-extra4+input:analog-stereo: Digital Surround 7.1 (HDMI 5) Output + Estèreo analògic Input (priority 665, available: unknown)          off: Inactiu (priority 0, available: unknown)      active profile: <output:analog-stereo+input:analog-stereo>      sinks:          alsa_output.pci-0000_00_1f.3.analog-stereo/#35: Audio intern Estèreo analògic      sources:          alsa_output.pci-0000_00_1f.3.analog-stereo.monitor/#43: Monitor of Audio intern Estèreo analògic          alsa_input.pci-0000_00_1f.3.analog-stereo/#44: Audio intern Estèreo analògic      ports:          analog-input-internal-mic: Internal Microphone (priority 8900, latency offset 0 usec, available: unknown)              properties:                  device.icon_name = "audio-input-microphone"          analog-input-mic: Microphone (priority 8700, latency offset 0 usec, available: no)              properties:                  device.icon_name = "audio-input-microphone"          analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)              properties:                  device.icon_name = "audio-speakers"          analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)              properties:                  device.icon_name = "audio-headphones"          iec958-stereo-output: Digital Output (S/PDIF) (priority 0, latency offset 0 usec, available: unknown)              properties:            hdmi-output-0: HDMI / DisplayPort (priority 5900, latency offset 0 usec, available: no)              properties:                  device.icon_name = "video-display"          hdmi-output-1: HDMI / DisplayPort 2 (priority 5800, latency offset 0 usec, available: no)              properties:                  device.icon_name = "video-display"          hdmi-output-2: HDMI / DisplayPort 3 (priority 5700, latency offset 0 usec, available: no)              properties:                  device.icon_name = "video-display"          hdmi-output-3: HDMI / DisplayPort 4 (priority 5600, latency offset 0 usec, available: no)              properties:                  device.icon_name = "video-display"          hdmi-output-4: HDMI / DisplayPort 5 (priority 5500, latency offset 0 usec, available: no)              properties:                  device.icon_name = "video-display"  

I have tried every possible profile combination through pacmd set-profile-card and I have no idea what to do. Moreover, through alsamixer I have checked that no speakers have been muted (or I thing none of them are muted):

alsamixer output

Update:

$ pacmd list-sinks  1 sink(s) available.    * index: 0      name: <alsa_output.pci-0000_00_1f.3.analog-stereo>      driver: <module-alsa-card.c>      flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY FLAT_VOLUME DYNAMIC_LATENCY      state: SUSPENDED      suspend cause: IDLE      priority: 9039      volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB              balance 0,00      base volume: 65536 / 100% / 0,00 dB      volume steps: 65537      muted: no      current latency: 0,00 ms      max request: 0 KiB      max rewind: 0 KiB      monitor source: 0      sample spec: s16le 2ch 44100Hz      channel map: front-left,front-right                   Estèreo      used by: 0      linked by: 0      configured latency: 0,00 ms; range is 0,50 .. 2000,00 ms      card: 1 <alsa_card.pci-0000_00_1f.3>      module: 7      properties:          alsa.resolution_bits = "16"          device.api = "alsa"          device.class = "sound"          alsa.class = "generic"          alsa.subclass = "generic-mix"          alsa.name = "ALC1220 Analog"          alsa.id = "ALC1220 Analog"          alsa.subdevice = "0"          alsa.subdevice_name = "subdevice #0"          alsa.device = "0"          alsa.card = "0"          alsa.card_name = "HDA Intel PCH"          alsa.long_card_name = "HDA Intel PCH at 0xa5410000 irq 154"          alsa.driver_name = "snd_hda_intel"          device.bus_path = "pci-0000:00:1f.3"          sysfs.path = "/devices/pci0000:00/0000:00:1f.3/sound/card0"          device.bus = "pci"          device.vendor.id = "8086"          device.vendor.name = "Intel Corporation"          device.product.id = "a348"          device.product.name = "Cannon Lake PCH cAVS"          device.form_factor = "internal"          device.string = "front:0"          device.buffering.buffer_size = "352800"          device.buffering.fragment_size = "176400"          device.access_mode = "mmap+timer"          device.profile.name = "analog-stereo"          device.profile.description = "Estèreo analògic"          device.description = "Audio intern Estèreo analògic"          alsa.mixer_name = "Realtek ALC1220"          alsa.components = "HDA:10ec1220,14621275,00100101 HDA:8086280b,80860101,00100000"          module-udev-detect.discovered = "1"          device.icon_name = "audio-card-pci"      ports:          analog-output-speaker: Speakers (priority 10000, latency offset 0 usec, available: unknown)              properties:                  device.icon_name = "audio-speakers"          analog-output-headphones: Headphones (priority 9000, latency offset 0 usec, available: no)              properties:                  device.icon_name = "audio-headphones"      active port: <analog-output-speaker>  

Update 2: Output of alsamixer -c 0

alsamixer -c 0

iconv module (to use with rsync) to avoid windows-illegal filenames in local NTFS partition

Posted: 30 May 2022 01:03 PM PDT

I would like to locally attach an NTFS volume to my unix (Ubuntu) machine, and copy (replicate) some unix directories to it, using rsync, in a way that the result is readable under Windows.

I do not care about ownership and permissions. It would be nice if modification dates would be preserved. I only need directories and files (symbolic links would be nice, too; but not a problem if they cannot be copied).

Two obvious problems are: case (in)sensitivity, and characters that are illegal in Windows filenames. For example, in Linux I can have two files "a" and "A"; I can copy them to the NTFS volume, but in Windows I will be able to access (at most?) one of them. But I am happy to ignore that problem. What I am interested about are illegal characters in Windows filenames, which are <,>,:,",/,\,|,?, and * (well, actually also ascii 0-31, but I do not care about that. There might also be problems with files ending in a "."?).

I would like rsync to automatically "rename", e.g., a file called "a:" to, say a(COLON), to end up with a legal name (and, ideally, translate a(COLON) back to a:)

Is this possible to have rsync automatically rename files to avoid characters forbidden in Windows?

  • As far as I understand rsync can use iconv to do such tasks; is there a standard iconv module for windows-filenames? (I briefly looked into programming an own gconv module, but lacking C knowlege this seems too complicated).
  • I have been told that rdiff-backup can do some conversions like that, but the homepage just mentions something being done "automatically", and I am not sure whether a locally mounted NTFS vomlume would trigger a renaming in a reliable way?
  • I am aware that there is fuse-posixovl, but this seems an overkill for my purpose, and also it doesn't seem to be well documented (which characters will be translated in which way? Will all filenames be truncated to 8.3 or whatever? Can I avoid the additional files carrying owner/permission information, which I will not need, etc etc.)
  • I am aware that I could avoid all these problems by using, e.g., a tar file; but this is not what I want. (In particular, I would like in Windows to further replicate from the NTFS volume to another backup partition, copying only the changed files)
  • I am aware of the "windows_names" option when mounting NTFS; but this will prevent creating offending files, not rename them.

Update: As it seems my question was not quite clear, let me give a more explicit example: For example, WINDOWS-1251 is of no use for me. iconv -f utf-8 -t WINDOWS-1251//TRANSLIT transforms

123 abc ABC äö &:<!|  

into

123 abc ABC ao &:<!|  

I would need a codepage, windows-filenams, say (which does not exist), that transforms the string into something like

123 abc ABC äö &(COLON)(LT)!(PIPE)  

Update 2: I now gave up and renamed the offending files ``by hand'' (i.e., by script). From now on, every time before running rsync, I run a script that checks whether offending filenames exist (but does not automatically deal rename anything); I just use

# find stuff containing forbidden chars  find $MYDIR -regex '.*/[^/]*[<>:*"\\|?][^/]*'  # find stuff containing dot as last character (supposedly bad for windows)  find $MYDIR -regex '.*\.'  # find stuff that is identical case insensitive  find $MYDIR -print0 | sort -z | uniq -diz | tr '\0' '\n'  

(the last line is from case-insensitive search of duplicate file-names )

KDE: suspend to 'freeze' state instead of 'mem'

Posted: 30 May 2022 10:04 AM PDT

I have a Lenovo Helix 2, which has busted suspend-to-RAM (S3) support. "Light sleep" mode (S0ix), however, works fine, as tested with echo freeze > /sys/power/state.

I can bind the power button to use freeze instead of mem using acpid event handlers, but what I really want to do is get the desktop environment to handle this, since it can do things like "suspend after N minutes of user inactivity" that acpid can't.

Unfortunately, the only options the KDE power manager gives me are "Do Nothing", "Lock Screen", "Suspend", "Hibernate", and "Power Off". It has a "run script" option, but that only applies when transitioning between power states -- e.g. I could have it run a script when going from AC to battery, or from battery to low battery, but not when on battery power and idle for 30 minutes.

So, is there some way -- either as part of KDE configuration, or as a systemd or sysfs or kernel option -- to override things so that it will try to freeze instead of, or as an alternative to, suspending?

Trying to connect bose quietcomfort 35 headset over bluetooth on arch linux

Posted: 30 May 2022 11:02 AM PDT

There is another question here, but i followed those instructions and it still didn't work.

Here is the systemctl status

Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Bluetooth daemon 5.42  Oct 06 10:02:38 TRAYUSH systemd[1]: Started Bluetooth service.  Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Starting SDP server  Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Bluetooth management interface 1.12 initialized  Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Failed to obtain handles for "Service Changed" characteristic  Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Sap driver initialization failed.  Oct 06 10:02:38 TRAYUSH bluetoothd[376]: sap-server: Operation not permitted (1)  Oct 06 10:02:38 TRAYUSH bluetoothd[376]: Failed to set mode: Not Supported (0x0c)  Oct 06 10:03:00 TRAYUSH bluetoothd[376]: a2dp-sink profile connect failed for 04:52:C7:0E:7F:12: Protocol not available  Oct 06 10:06:20 TRAYUSH bluetoothd[376]: a2dp-sink profile connect failed for 04:52:C7:0E:7F:12: Protocol not available  

Here are the contents of /etc/bluetooth/main.conf

[General]  ControllerMode=bredr  

And the contents of /etc/bluetooth/audio.conf

[General]  Enable=Source,Sink,Headset,Gateway,Control,Socket,Media  

Here is what happens when I try to connect via bluetoothctl

[trash@TRAYUSH ~]$ bluetoothctl  [NEW] Controller 98:58:8A:07:14:FC TRAYUSH [default]  [NEW] Device 04:52:C7:0E:7F:12 QC35  [bluetooth]# power on  Changing power on succeeded  [bluetooth]# agent on  Agent registered  [bluetooth]# connect 04:52:C7:0E:7F:12   

Here is the relevant information from /etc/pulse/default.pa

### Automatically load driver modules for Bluetooth hardware  .ifexists module-bluetooth-policy.so  load-module module-bluetooth-policy  .endif    .ifexists module-bluetooth-discover.so  load-module module-bluetooth-discover  .endif  

Any help is appreciated, thanks.

Ninja Edit: Pulseaudio-bluetooth IS installed.

How to access the Evolution calendar data from the command line?

Posted: 30 May 2022 12:06 PM PDT

I want to be able to access the Evolution calendar from the command line. Specifically, I'd like to be able to:

  1. List calendar events (the one-line summary, date and time is enough)
    1. Upcoming events starting today
    2. Events on a specific date
  2. Add an event on a specific date

How can I do that? Is it possible?

Google was distinctly unhelpful in this case. I'm running Evolution 3.4.4. Using additional software packages that talk to the Evolution server is perfectly fine.

No comments:

Post a Comment