Saturday, September 18, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


NAT specific host through the WAN interface, and all the rest through VPN tunnel interface

Posted: 18 Sep 2021 10:26 AM PDT

Here's a debian-based Linux router with 3 interfaces

  • eth1: WAN (192.168.100.0/24)
  • tun0: VPN interface (10.8.0.0/24) created over eth1
  • eth0: LAN (192.168.0.0/24)

In the past, I had activated the NAT with something like

iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT  iptables -A FORWARD -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT  iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE  

Then, out of laziness, I moved to arno-iptables debian package with something like

EXT_IF="eth0"  EXT_IF_DHCP_IP=1  OPEN_TCP="80"  OPEN_UDP=""  INT_IF="eth1"  NAT=1  INTERNAL_NET="192.168.0.0/24"  NAT_INTERNAL_NET="192.168.0.0/24"  OPEN_ICMP=0    

I recently tried a commercial VPN (norvpn) which created the interface tun0 in my router. I changed the EXT_IF to point on tun0 and all hosts on my LAN (Linux hosts) seemed to hide behind the VPN correctly (quite magically, without more configuration and without apparent problems).

But, lately, I plugged-in a Windows laptop for my work on the LAN. Obviously, it has its own OpenVPN config to reach the company's network + remote desktop access to the company's Windows machine, and it doesn't work.

The first symptom was an intermittent connection loss of the Windows VPN (which was not the case before). I thought I solved it by whitelisting the server address on my Linux router's VPN:

$ sudo nordvpn settings  Technology: OpenVPN  Protocol: UDP  Firewall: enabled  Kill Switch: disabled  CyberSec: disabled  Obfuscate: disabled  Notify: disabled  Auto-connect: disabled  IPv6: disabled  DNS: disabled  Whitelisted ports:           1194 (UDP|TCP)  

The remote desktop seemed to start after, but it stayed on a black screen. Then, the RDP sometimes stated it was reconnecting.

RDP reconnection

I don't want to fight against Windows and the RDP ports to open so I ended up trying to whitelist this windows host to skip the tunnel tun0. But, my notes are dirty around NAT/SNAT/MASQUERADE/DNAT and I have no clue if we can actually do what I want.

Is it somehow possible, purely with iptables, to NAT my Windows host (say 192.168.0.30) to eth1, and the remaining part of the subnet to tun0 (as arno-iptables does for us)?

Keepass Keeagent SSH Keys How to integrate with a bash terminal?

Posted: 18 Sep 2021 09:53 AM PDT

I am completely lost here.

I found out about storing ssh private keys (of which I have a lot of) in my keepass database. Before I had a bash script with a simple menu that would just use ssh -i and get the priv key file locally from the .ssh directory. The end goal here is to make a centrally available database of both passwords and private keys to utilize across different devices.

I have since put all my ssh private keys in my keepass database and I am trying to figure out how to integrate keepass/keeagent with the bash terminal.

But I think I have misunderstood what keepass can actually do. What I want to do is open my keepass database, run my existing bash script and be able to bring up an ssh session that way.

I've been trying to look into using ssh-agent, but I have actually no idea what I am doing there or how that operates. All the information I find online is walking through steps way above me or options that don't use the terminal.

So, is there a way I can run a command like this: ssh -i KEEPASS-DB-PRIVKEY user@ip or is that just not a capability of keepass/keeagent/sshagent?

I am on ubuntu 20.04 with KDE plasma as desktop. I have keepass2 (2.44) with keeagent plugin installed.

How can I find an identifiable network name over ethernet?

Posted: 18 Sep 2021 09:49 AM PDT

As a network client over wifi, I can get a BSSID that shows a recognizable network name. Are there any equivalent method over an ethernet connection under nixes ?

My question concerns personal computers on a DHCP lease, that could be connected to either a home's or a shop's shared Access Point. I'm looking for solutions implemented as libraries if possible.

I suppose the gateway MAC address would be (almost) unique, and would let me identify the network I'm connected to. But it's not recognizable - because a bunch of hexadecimal blocks is not easy to remember I guess.

I read in another related SE question's comments that I could traceroute some known place to try and find out the gateway's hostname. But I suppose this would not work when connected to an offline LAN.

Cursor and keyboard are acting strangely in

Posted: 18 Sep 2021 09:29 AM PDT

I am using kali linux and today all of a sudden my keyboard and cursor started acting weird. "^[[3~ keeps printing upon enter because of which im unable to work. My kali release is 2021.3. Also, I couldnt attach a picture because it kept erasing from where the square brackets open while typing the issue. Please tell me how to fix this.

Huawei Matebook D14, Wi-Fi visible, but not workable

Posted: 18 Sep 2021 09:00 AM PDT

I've been trying to install Fedora 34 Workstation on my Huawei Matebook D14 laptop. So, the problem is that wifi can show me other networks, but fails to connect each one of them. Network card is Realtek RTL8822CE Wireless Adapter.

Grub Read error : I think I have a hard drive problem, but I'm not sure?

Posted: 18 Sep 2021 08:56 AM PDT

One year ago, I got a big grub problem on my laptop (an old Lenovo), with dual boot windows/unbuntu. I spend one entire day to repair that and I finished by reset my computer and install Pop Os (without dual boot). It have resolved the problem (I was thinking at this time).

Now, I have used Pop Os until I have a new grub problem that is quite weird : my laptop run the os 1/3 time, the other time I have a grub problem. I searched to resolve that the entire day yesterday, I reset it and I have now the same problem.

There are here very weird things, and I just want to know if I can fix that or if this is a problem with the hard drive (wich I suspect).

So, when I run my compute I have 3 options :

  • That run correcty the OS
  • I have a "Read Error" and no grub rescue, I have to force shutdown manually
  • I have a grub rescue, and when I navigate in the partition that sometimes work or indicate "Unknow file system" (on the same partition, the same command can do both !)

This is a try to repair grub on grub rescue (msdos3 is a boot partition, the os partition is msdos2).

error: attempt to read or write outside of disk 'hdo'.  Entering rescue mode...    grub rescue> ls (hd0, msdos3)  (hd8, msdos3): Filesystem is ext2.    grub rescue> ls (hd0, msdos3)/  ./../ lost+found System.map-5. 11.8-7633-generic config-5. 11.8-7633-generic ini  trd. img initrd. img-5. 11.8-7633-generic initrd. ing. old vmlinuz vmlinuz-5.11.8-763  3-generic vmlinuz.old grub/ vmlinuz-5.13.0-7614-generic config-5.13.0-7614-gener  ic System.map-5. 13.0-7614-generic initrd. img-5. 13.0-7614-generic    grub rescue> set prefix=(hd0, msdos3)/grub    grub rescue> set root=(hd0, msdos3)    grub rescue> insmod normal    error: attempt to read or write outside of disk 'hdo'.  

What do you think about that ? Is it fixable for you ?

Issue with Tails Bootloader and Video Card

Posted: 18 Sep 2021 08:48 AM PDT

When attempting to run a Tails boot-loader, I received: Error starting GDM with your 2 graphics cards:

At the time of the error msg I was using a fresh Tails v4.22 boot-loader on my early 2011 MacBook Pro.

This is the full msg I was given;

Advanced Micro Devices, Inc. [AMD/ATI] [1002:6741] Whistler [Radeon HD 6630M/6650M/6750M/7670M/7690M]

Intel Corporatio

Please take note of this error and visit https://tails.boum.org/gdm for troubleshooting.

At the web page for troubleshooting I could not find the video card listed as a known problem so I went through the suggested generic troubleshooting steps of adding to boot options;

radeon.modeset=0  xorg-driver=modesetting  modprobe.blacklist=radeon  

I tried them seperate and all at once but no variation seemed to work.

Do you have any suggestions? I am lost as to where to go next...

Thank you for your time and I hope you have a great day!

How to install any linux distro as a main & only OS on my HP Laptop?

Posted: 18 Sep 2021 10:06 AM PDT

I had used ubuntu in WSL2 for 3-4 days ,also tried to use kali linux on wsl2 but due to network manager problems I left my idea. Yesterday I was trying to dual boot pop os with windows 10 but due to wrong partition(I have GPT mode but did in MBR ) I was unable to do this. Also tried to do in gpt mode. It was not showing in boot menu. My friend told me that Microsoft destroys grub boot loader when we dual boot with linux distro.

Now, I have decided to use a linux distro(Manjaro ) as a main and only os on my hp machine. How can I do this ? Will I face any problem like grub boot ? Please help me. Thanks

inoticoming daemon started as service just vanishes

Posted: 18 Sep 2021 08:18 AM PDT

I'm trying to get inoticoming to start monitor a folder, and it's working if I start it manually, but I can't get it to autostart.

I know it starts, because if I enters a non-existant directory it will complain about it in the syslog..

If I start the service manually it doesn't work, but if I'm running the script it starts without any issues.

so it refuses to start via system service, or is there some other way to start this? (also tried directly (without script) in the service file..

[Unit]  Description=Monitor for ip file change  Wants=network.target  After=syslog.target network-online.target    [Service]  Type=simple  ExecStartPre=/bin/sleep 60  ExecStart=/home/helre/ipmon.sh  # /usr/bin/inoticoming /g/updates/ip/ /home/helre/ipchangemonitor.sh \;  [Install]  WantedBy=multi-user.target  

ipmon.sh:

#!/bin/bash    /usr/bin/inoticoming /g/updates/ip/ /home/helre/ipchangemonitor.sh \;  

Running Ubuntu server 20.04.3

xdg-open from .desktop file (in script)

Posted: 18 Sep 2021 10:03 AM PDT

I am trying to get a shell script to launch a browser. When run standalone, this script successfully opens a browser with

xdg-open http://localhost:8080  

However, I am trying to make it convenient newbie-friendly, so I've created a .desktop file which launches this script (linuxStart.sh)

Here's the .desktop file

[Desktop Entry]  Type=Application  Terminal=true  Name=Start Application  Icon=utilities-terminal  Exec=./linuxStart.sh  Categories=Application;  

So far so good. But when run this way, it seems xdg-open does not run, and the browser does not open. The command is ignored inside the script. What gives?

I have tried inserting

#!/usr/bin/env xdg-open  

on top of the .desktop file with no effect

Here is linuxStart.sh (proof of concept)

#!/bin/sh    #Other commands (runs fine)  #...    #Does not run from the .desktop file  xdg-open http://localhost:8080  

Thanks

OS: MX Linux 19.04

DE: Xfce

Add multiple options in cmake flag in a shell script and run the shell script

Posted: 18 Sep 2021 08:06 AM PDT

I want to run a set of commands from a bash script. How ever I don't know how to put the quotation in a bash script.

The following is the bash script which I want to run, how ever in the cmake -DCMAKE_C_FLAGS I want to add another flag -gcc-name=/path/bin/gcc. I want to do it through a shell script and eventually run that shell script, which is going to give me the installation.

Please kindly suggest me a way to do this.

mkdir /g/g92/bhowmik1/installTF/ROSS;  cmake -DCMAKE_INSTALL_PREFIX=/g/g92/bhowmik1/installTF/ROSS -DCMAKE_C_FLAGS=-O3 -DCMAKE_C_COMPILER=mpicc -DARCH=x86_64 -DROSS_BUILD_MODELS=ON ..;  make;  make install;   

How do i add custom font to ibus input methods

Posted: 18 Sep 2021 07:54 AM PDT

i want to add bamini (tamil language font) to my input method .

Is that possible? if so how do i do it?

if thats not possible can i change key mappings

I got one bad sector to disk is ok. I am confused

Posted: 18 Sep 2021 08:56 AM PDT

So I am asking. What is happening and what happened to the bed sector? Thanks. For a long time: enter image description here

Now I got this: enter image description here

Is installing Git in general and Git clone in particular on shared hosting server environments a standard / common practice?

Posted: 18 Sep 2021 07:27 AM PDT

So far I avoided using Git clone (a terrible mistake) just by a principle that because I work with shared web hostings and I can't control which programs are installed and Git might not be installed on a given shared server by a given shared hosting company (because maybe many if not most users SSHing into a shared hosting don't use Git), than I should just make myself used to downloading code from GitHub with zips, doing wget file.zip, unzip file.zip rm file.zip etc. and not counting on Git.

Today I found thanks to user:terdon, that Git clone is very easy to use and is more efficient than dealing with archives, at least for very small projects, hence the question in the title.

How do filesystem UUID's work from kernelspace perspective (and what can happen to my Linux machine when it is not unique)?

Posted: 18 Sep 2021 08:52 AM PDT

In the end I guess that is really the question I want to find an answer for: Can I crash a Linux box if the root filesystem does not have a unique UUID? But please read on, this question is about understanding the cause in depth and not so much the effect of a faulty configuration.

Given the fact that I can clone an entire root filesystem including its UUID in a separate partition of identical size. On both the original and the clone the inodes would point you to a copy of the same file and the same block on disk (partitionwise), so you wouldn't notice anything starting to go wrong.

But if so, I want to understand why, or what the nature of problems would be that can be expected. There are a lot of writings on the topic how UUID's in filesystems can ease your life, how they are supposed to work, how udev builds nice device trees in /dev. And there is the remark UUID's must be unique in a Linux box. I guess UUID's are well documented from a userspace perspective, but I want to understand the kernelspace perspective better.

Could you for example get some sort of split brain situation where some blocks are read or written from the one partition and other blocks from the other partition? Can the kernel lock up? Perhaps trouble mounting and/or unmounting the other device? Perhaps on a side track: How does multipathing fit in, which is able to manage a very specific case of duplicate UUID's.

Back to the actual question: How does the kernel actually utilize these UUID's internally? When I mount a filesystem by UUID and I inspect the output of mount, df or /proc/mounts, none of these show the UUID that I used to issue the mount command with, they always show me the device node in /dev. Is there a userspace interface for the UUID to device mapping (which is not necessarily the same as device to UUID)? How does the kernel decide which block device to access and can this more or less spontaneously change over time, maybe due to certain events? What can happen to my machine / filesystems if I do not obey the simple rule of unique UUID's?

Perhaps my answer is in https://www.kernel.org/doc/ but that is a bit overwhelming when I don't known what exactly I am searching for. Deep links into this website are welcome too.

In gnome some for applications the window shadow counts as resize area

Posted: 18 Sep 2021 07:15 AM PDT

I have an Arch Linux installation with gnome 40.4 and gtk2 (2.24.33), gtk3 (3.24.30) and gtk4 (4.4.0) installed. (Graphicbackend is X11 if that's relevant)

For some applications - probably those that use gtk3 - (like Thunderbird, Firefox, VSCode) the drop shadow of the window counts to the resize area for the window (which is roughly 60px).

For other Applications (like Chromium, Settings, Nautilus) the shadow doesn't count to the resize area, which is the behavior I would expect.

The Theme used is Adwaita but that behavior also exits for other themes.

Does anyone know what the reason for this could be and how that could be changed?

Having a 60px large area around the window one cannot be click-through is a bit annoying.

is it possibe to prevent app modify my /etc/resolv.conf dns

Posted: 18 Sep 2021 07:30 AM PDT

Recently I facing a problem, technically it bother me for a long time. My Fedora 32 dns config in /etc/resolv.conf always mofidied by an unknown app. the modified config look like this:

[dolphin@MiWiFi-R4CM-srv]~/Documents/GitHub/reddwarf-music% sudo cat /etc/resolv.conf   # Generated by NetworkManager  nameserver 192.168.31.1  nameserver 8.8.8.8  nameserver 114.114.114.114  

what I want the dns conf looks like this:

nameserver 8.8.8.8  

I only want the 8.8.8.8 dns. If I modified the /etc/resolv.conf, it will be changed to the wrong config, what should I do to make the dns config under control?

ecryptfs in initramfs

Posted: 18 Sep 2021 10:11 AM PDT

I have a dir /encrypted, ecncrypted with ecryptfs and I need to mount /encrypted to /unencrypted during boot process, just after real root has been mounted. I've add mount.ecryptfs to /usr/sbin of initramfs via hook, and created script /etc/initramfs/init-top/ecryptfs with the next content:

#!/bin/sh    PREREQ=""  prereqs()  {          echo "$PREREQ"  }    case $1 in  prereqs)          prereqs          exit 0          ;;  esac    . /scripts/functions  /usr/sbin/mount.ecryptfs \    -o user,ecryptfs_sig=################,ecryptfs_fnek_sig=################,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_unlink_sigs \    /root/encrypted /root/uncrypted    exit 0  

but neither password is asked, nor error is printed.

What am I doing wrong?

UPD: Do I need to copy /usr/lib/ecryptfs/libecryptfs_key_mod_passphrase.so somewhere in initramfs?

UPD 2: I've copied all files from ecryptfs-utils.deb and now it asks for passphrase, but then shows the error:

Error attempting to evaluate mount options [-22] Invalid argument  Check your system logs for details on why this happened  Try updating your ecryptfs-utils package, and/or  submit a bug report on https://bugs.launchpad.net/ecryptfs  

Git clone; how to deal with directory clashes?

Posted: 18 Sep 2021 07:13 AM PDT

I have noticed that Git clone can easily download all files of a GitHub repository to to a directory named exactly as the GitHub repository (without having to deal with archives).

If a directory with the same of the repository already exists, Git will throw an error:

fatal: destination path 'REPOSITORY_NAME' already exists and is not an empty directory.

In such case, perhaps a good coping with it is to somehow clone anyway but to just save the data in a directory with a different name.

Changing Terminal Prompt Name

Posted: 18 Sep 2021 08:10 AM PDT

The terminal window starts with a default of [johnnine@tec ~]$

How would I use "set prompt" in .cshrc it so that it would also display the time?

Debian 11 Server - vsftpd virtual users don't work, permission issue?

Posted: 18 Sep 2021 08:28 AM PDT

I have a Debian 11 VM with vsftpd enabled for my local user. I want to create a virtual, FTP only user (who should be rw limited to their home directory). I followed this https://help.ubuntu.com/community/vsftpd Unfortunately this not only doesn't work, it also breaks my local user. The user is named editor but rest (paths etc) is the same as in the guide.

Connecting a local user (copied from Filezilla, 100% sure password is correct)

Status: Connecting to 10.0.1.8:21...  Status: Connection established, waiting for welcome message...  Status: Insecure server, it does not support FTP over TLS.  Command: USER tomsikr  Response: 331 Please specify the password.  Command: PASS **********  Response: 530 Login incorrect.  Error: Critical error: Could not connect to server  

Connecting a virtual user

Status: Connecting to 10.0.1.8:21...  Status: Connection established, waiting for welcome message...  Status: Insecure server, it does not support FTP over TLS.  Command: USER editor  Response: 331 Please specify the password.  Command: PASS ******  Response: 500 OOPS: cannot change directory:/home/vftp/editor  Error: Critical error: Could not connect to server  

/etc/vsftpd.conf (pastebin com/9k9r3rLe)

listen=NO  listen_ipv6=YES  anonymous_enable=NO  local_enable=YES  virtual_use_local_privs=YES  write_enable=YES  dirmessage_enable=YES  use_localtime=YES  xferlog_enable=YES  connect_from_port_20=YES    xferlog_enable=YES  xferlog_file=/var/log/vsftpd.log  xferlog_std_format=YES    log_ftp_protocol=YES  chroot_local_user=YES  chroot_list_enable=YES  chroot_list_file=/etc/vsftpd.chroot_list  secure_chroot_dir=/var/run/vsftpd/empty  pam_service_name=vsftpd  rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem  rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key  ssl_enable=NO    userlist_deny=YES  userlist_file=/etc/vsftpd.denied_users    pasv_enable=Yes  pasv_min_port=10100  pasv_max_port=10110    pam_service_name=vsftpd.virtual    guest_enable=YES    user_sub_token=$USER    local_root=/home/vftp/$USER    chroot_local_user=YES    hide_ids=YES  

/etc/vsftpd.chroot_list (only contains my local user, aka me)

tomsikr  

/etc/vsftpd.denied_users

root  

The virtual user editor is in /etc/vsftpd/vsftpd-virtual-user.db

/etc/pam.d/vsftpd.virtual

#%PAM-1.0 auth required pam_userdb.so db=/etc/vsftpd/vsftpd-virtual-user  account required pam_userdb.so db=/etc/vsftpd/vsftpd-virtual-user  session required pam_loginuid.so  

Any help would be appreciated because I hit a wall. I'm not a Linux admin, I'm learning this on the fly

How to compare specifics positions of two files who don't have delimiter

Posted: 18 Sep 2021 10:03 AM PDT

File 1

abc123def999  ghi456klm999  nop789qrs999  

File 2

abc000def000  xxx000yyy000  nop000qrs000  

I need full non-matching lines but comparison must ignore characters in positions 4 to 6 and 10 to 12.

In that exemple, only the second line should be different.

I don't want a read loop to parse the files line by line... Files have millions of records.

Thanks!

Persistent WiFi connectivity problems in Kali Linux

Posted: 18 Sep 2021 10:09 AM PDT

I have been having WiFi trouble for months now, and I've tried all manner of solutions with no change.

Hardware: Mid 2012 MacBook Pro unibody, 16gb RAM and 500gb Samsung SSD

OS: Kali Linux 2021.2 with weekly updates to all software. Running Live with Persistence from a USB drive.

Driver: Broadcom BCM 4331

Problem: Linux will connect to my iPhone hotspot with no problems and no connection lag, but when connecting to my university's WiFi or home WiFi, it either will not make the connection at all, or establish a connection for about half an hour, then stop working. Webpages pull up a "connection timed out" or "could not reach the server" errors. Currently I have a decent connection to my university's WiFi, but about a half-hour prior, I could not connect at all.

Attempted:

  • uninstalling and reinstalling NetworkManager
  • Manually filling out WiFi router details in the nm-applet
  • Uninstalling and reinstalling OS
  • Adding wifi.scan-rand-mac-address=no to /etc/NetworkManager/NetworkManager.conf
  • addressing router directly, both with the default address 192.168.1.1 and the gateway address that appears after running route in the terminal -Edited /etc/network/interfaces and added wlan0
  • Numerous NetworkManager restarts.
  • when a connection is established, even if no webpages are loading, the command ping still shows that there is a connection with no packet loss
  • set DNS servers to 8.8.8.8 and 8.8.4.4 in the IPv4 settings in NetworkManager
  • module bcma is listed when running command sudo lsmod, used by b43 which is my driver
  • added deb http://http.deb/debian.org/debian bullseye-backports main contrib non-free and deb http://us.debian.org/debian bullseye main non-free to /etc/apt/sources.list, updated and upgraded with these sources
  • manually installed linux-headers-amd64, linux-image-amd64, and linux-kbuild-5.10
  • ran apt install broadcom-sta-dkms followed by modprobe-r b43 b43legacy ssb brcmsmac bcma and modprobe wl, after reboot, WiFi seems to be working again

Various other attempts were made to fix the problem but I can't remember what all I tried. At the moment, all edits to /etc/network and /etc/NetworkManager files have been removed, all NetworkManager settings are the default.

SOLVED Really basic Samba set-up not working

Posted: 18 Sep 2021 10:29 AM PDT

SOLVED by @roaima

I needed to add users to Samba using smbpasswd -a. For some reason, Webmin no longer does this when you select "sync users".

Background: I had a Debian server running a Samba share, and it played nicely with everyone: Debian, Ubuntu, Mint, Windows 7, Windows 10, Android 8 through whatever is current, even XP (for testing purposes).

One of the services (Plex) on that server was problematic, so I set up another Debian server with the same storage devices, and set up the services I want. So far, all of the services work, except for Samba.

I figured I mucked up the config some how, so I copied line by line the config file from the old server to the new server, and this had no change.

I know it's a problem on the server, since it's the same for all the clients (Linux, Windows, Android, etc)

Win10 and Mint are both giving me the same generic error: Permission Denied

mount error(13): Permission denied  Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)  

Samba has these nifty logs - one for each client, but, when I try to read those logs, they're blank and all read as 0kb.

It seems like a simple thing that should be working... What the heck do I do now?

Any advice is appreciated; thanks in advance!

(BTW in case it matters, I tried the first time using Webmin, then just the config files in /etc when Webmin didn't work)

Output from grep -Ev '^\s*[#;]|^$' /etc/samba/smb.conf as requested in the comments (I changed the username to my given name and I'm working with a test share that will be deleted once I have this issue corrected)

[global]          workgroup = WORKGROUP          dns proxy = no          log file = /var/log/samba/log.%m          max log size = 1000          syslog = 0          panic action = /usr/share/samba/panic-action %d          server role = standalone server          passdb backend = tdbsam          obey pam restrictions = yes          unix password sync = yes          passwd program = /usr/bin/passwd %u          passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .          pam password change = yes          map to guest = bad user          usershare allow guests = yes          unix extensions = no  [test]            comment = test          writeable = yes          path = /home/tony/test          valid users = tony  
ps -ef | grep -E 'smbd|nmbd|winbind|sssd'  root       42538       1  0 14:41 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group  root       42540   42538  0 14:41 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group  root       42541   42538  0 14:41 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group  root       42549   42538  0 14:41 ?        00:00:00 /usr/sbin/smbd --foreground --no-process-group  root       42551       1  0 14:41 ?        00:00:00 /usr/sbin/nmbd --foreground --no-process-group  root       90058   35763  0 16:18 pts/1    00:00:00 grep -E smbd|nmbd|winbind|sssd  

KDE Plasma doesn't start (black screen) after upgrading Debian10->11

Posted: 18 Sep 2021 08:27 AM PDT

I upgraded from Debian 10 to 11. After completing the upgrade – which had problems due to lack of disk space (there should have been enough), some rkhunter config and unattended-upgr blocking konsole commands – I rebooted.

The first strange thing was that the initial boot screen asking for the grub password was red and looked a bit strange instead of blue but quickly changed back to the blue one. The second problem was that after logging in I only have a black screen (with some windows on top). This is because plasmashell isn't running (the only thing that runs is startplasma-x11) so I started it with kstart5 plasmashell. However, it crashes right after it seems to have fully loaded (with the desktop and the task bar showing). How to solve this? The full output is:

Omitting both --window and --windowclass arguments is not recommended    kf.coreaddons: Expected JSON property "X-Plasma-ContainmentCategories" to be a string list. Treating it as a list with a single entry: "panel" org.kde.plasma.desktop.defaultPanel  kf.coreaddons: Expected JSON property "X-Plasma-ContainmentCategories" to be a string list. Treating it as a list with a single entry: "panel" org.kde.plasma.desktop.appmenubar  kf.coreaddons: Expected JSON property "X-Plasma-ContainmentCategories" to be a string list. Treating it as a list with a single entry: "panel" org.kde.plasma.desktop.emptyPanel  kf.plasma.quick: Applet preload policy set to 1  Cyclic dependency detected between "file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml" and "file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/kirigami.2/styles/org.kde.desktop.plasma/Units.qml"  qt.svg: <input>:406:376: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:407:130: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:408:130: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:408:393: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:409:130: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:410:129: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:411:129: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:412:129: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:413:129: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:413:379: Could not add child element to parent element because the types are incorrect.  qt.svg: <input>:413:631: Could not add child element to parent element because the types are incorrect.  trying to show an empty dialog  file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"  file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"  trying to show an empty dialog  file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"  file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"  libpng warning: iCCP: known incorrect sRGB profile  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/homeworld-theme/wallpaper" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/futureprototype-theme/wallpaper" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/futureprototype-theme/wallpaper-withlogo" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/joy-theme/wallpaper" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/joy-inksplat-theme/wallpaper" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/joy-theme/lockscreen" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/lines-theme/wallpaper" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/lines-theme/lockscreen" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/moonlight-theme/wallpaper" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/moonlight-theme/lockscreen" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/wallpapers/Next" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/softwaves-theme/wallpaper" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/softwaves-theme/lockscreen" is a directory. Use addDir!  kf.coreaddons: KDirWatch: "/usr/share/desktop-base/spacefun-theme/wallpaper" is a directory. Use addDir!  libpng warning: iCCP: known incorrect sRGB profile  Plasma Shell startup completed  qml: disabling redshift  qml: renderModeString:   qml: disabling redshift  qml: onLoaded  Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)  file:///usr/share/plasma/plasmoids/org.kde.panel/contents/ui/main.qml:30:1: QML DropArea (parent or ancestor of QQuickLayoutAttached): Binding loop detected for property "minimumWidth"  Both point size and pixel size set. Using pixel size.  Both point size and pixel size set. Using pixel size.  Both point size and pixel size set. Using pixel size.  trying to show an empty dialog  trying to show an empty dialog  trying to show an empty dialog  Cyclic dependency detected between "file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/global/Globals.qml" and "file:///usr/share/plasma/plasmoids/org.kde.plasma.notifications/contents/ui/NotificationHeader.qml"  file:///usr/lib/x86_64-linux-gnu/qt5/qml/org/kde/plasma/extras/PlasmoidHeading.qml:56:5: Unable to assign [undefined] to int  Plasma Shell startup completed  Plasma Shell startup completed  trying to show an empty dialog  file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"  file:///usr/share/plasma/shells/org.kde.plasma.desktop/contents/views/Desktop.qml:146:19: QML Loader: Binding loop detected for property "height"  KAStatsFavoritesModel::setFavorites is ignored  Entry is not valid "applications:seahorse.desktop" QSharedPointer(0x563b9bdb07d0)  Entry is not valid "applications:seahorse.desktop" QSharedPointer(0x563b9bd267e0)  file:///usr/share/plasma/plasmoids/org.kde.plasma.kickoff/contents/ui/FullRepresentation.qml:356: ReferenceError: headerSeparator is not defined  trying to show an empty dialog  qml: clearing connected sources, stop source was: killall redshift; redshift -x  qml: enabling redshift with command: redshift [...]  libpng warning: iCCP: known incorrect sRGB profile  libpng warning: known incorrect sRGB profile  libpng warning: profile matches sRGB but writing iCCP instead  file:///home/username/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/ui/TimerView.qml:31:13: QML ToolButton: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.  file:///home/username/.local/share/plasma/plasmoids/org.kde.plasma.eventcalendar/contents/ui/TimerView.qml:87:13: QML ColumnLayout: Detected anchors on an item that is managed by a layout. This is undefined behavior; use Layout.alignment instead.  

Bash, find and delete old files

Posted: 18 Sep 2021 10:04 AM PDT

Write script to backup files and delete old backups:

#!/bin/sh    BACKUPDIR=/var/backups/files  ROTATE=1    mkdir -p $BACKUPDIR    CURRENT="$BACKUPDIR/`date +%Y-%m-%d`-files.tar.gz"    cd /var/ && tar czf $CURRENT www    find $BACKUPDIR -type f -mtime $ROTATE -exec rm {} \;    chmod 0600 $BACKUPDIR/*  

Command Line (for testing):

find $BACKUPDIR -type f -mtime $ROTATE -exec rm {} \;  

Somehow, the script does not work. However, if I execute it in the console, all is OK and old files get deleted. But if I run the script, files are not deleted (tar archive get created when I run the script). Why?

Script permissions are 755.

How to invoke shell function in string? (bash)

Posted: 18 Sep 2021 08:02 AM PDT

I want to invoke shell function in string. Here is my use case:

function envfoo() {      env ENV_FOO=foo $@  }  function envbar() {      env ENV_BAR=bar $@  }    $ envfoo env |egrep ENV_  ENV_FOO=foo  $ envbar env |egrep ENV_  ENV_BAR=bar  $ envfoo envbar env |egrep ENV_  env: envbar: No such file or directory  # expected result: ENV_FOO=foo and ENV_BAR=bar lines  

Here I want envfoo to execute envbar shell function. How can I do it?

Say that is opposite of command which ignores shell function and finds real command.


Maybe I gave a wrong example. I want to combine multiple shell functions like actual executables. A real case goes like this:

function be() {      bundle exec $@  }    function envstg() {      env RAILS_ENV=staging $@  }    $ be rails server  # launches Rails server    $ envstg be rails server  env: be: No such file or directory  

Here be isn't expanded into bundle exec. How can I expand them?

Arch Linux in Qemu : Failed to access perfctr msr error

Posted: 18 Sep 2021 09:03 AM PDT

I got the Arch Linux (march build) iso file through bittorrent lately.

I tried to run it in VM, but it only gets up to the main screen (The screen where you select what you want to do) shown below:

enter image description here

But when I select first option, it shows a black screen which goes nowhere. The Hardware Information option seems to work, but it's out of my intellectual capacity so I ignored it.

I then tried qemu with a simple qemu-system-x86_64 ./location to file command. It shows a slightly different image:

enter image description here

On selecting x64-86 I get errors:

enter image description here

I am a Ubuntu user, so I don't get anything of this, but the first error seems to be:

failed to access perctr msr(msr coo1ooo4 is 0)  

No comments:

Post a Comment