Monday, April 12, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Why are there often letters missing in my terminal?

Posted: 12 Apr 2021 10:02 AM PDT

On my laptop, Gallium OS running on Chromebook hardware, sometimes (pretty often) a selection of characters don't want to render in my terminal (urxvt). One day 'a' 'i' and 'W' are gone, another day it's 'r' 'y' 'D' and a bunch of bold characters.

a screenshot of the issue

It looks like the missing characters depend on whether the font is bold or not. There are different characters missing on different days, and I've noticed no patterns. There's something can do that causes the characters to re-appear, but I haven't figured out what I'm doing yet. I also have an issue, maybe related, on this laptop where the terminal suddenly won't refresh all the lines, which makes using vim pretty annoying, but switching workspaces away and back usually fixes this.

Ask and I can include more information; I just don't know what's relevant to this problem. I'm in jury duty right now, so I'll be available until my laptop dies. After we know what's causing this, I'll help in editing this question to be more relevant/findable by folks with a similar question.

installing security key

Posted: 12 Apr 2021 09:26 AM PDT

I have a security key (specifically a TrustKey g320 with finger print reader) that I would like to use under Linux (Ubuntu 20.04).

On one hand, I'd like to use it to authenticate when pushing to github (on the command line), on the other hand I'd like to later use it with a password manager and other services.

Chromium detects it and I was able to set up a PIN and scan finger prints.

Next, I wanted gpg to be able to 'talk' to it. When I plug it in, I find the following in syslog:

systemd[1]: pcscd.service: Succeeded.  kernel: [36216.016892] usb 3-10.3: new full-speed USB device number 20 using xhci_hcd  kernel: [36216.118536] usb 3-10.3: New USB device found, idVendor=311f, idProduct=4c2a, bcdDevice= 0.00  kernel: [36216.118542] usb 3-10.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3  kernel: [36216.118546] usb 3-10.3: Product: TrustKey G320  kernel: [36216.118549] usb 3-10.3: Manufacturer: TrustKey  kernel: [36216.118551] usb 3-10.3: SerialNumber: XXXXXXXXXX  kernel: [36216.128349] hid-generic 0003:311F:4C2A.0020: hiddev2,hidraw9: USB HID v1.10 Device [TrustKey TrustKey G320] on usb-0000:00:14.0-10.3/input0  kernel: [36216.129724] input: TrustKey TrustKey G320 as /devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10.3/3-10.3:1.1/0003:311F:4C2A.0021/input/input49  kernel: [36216.189607] hid-generic 0003:311F:4C2A.0021: input,hidraw11: USB HID v1.10 Keyboard [TrustKey TrustKey G320] on usb-0000:00:14.0-10.3/input1  mtp-probe: checking bus 3, device 20: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10.3"  mtp-probe: bus: 3, device: 20 was not an MTP device  mtp-probe: checking bus 3, device 20: "/sys/devices/pci0000:00/0000:00:14.0/usb3/3-10/3-10.3"  mtp-probe: bus: 3, device: 20 was not an MTP device  systemd[1]: Started PC/SC Smart Card Daemon.  gpg-agent[18087]: scdaemon[18087]: pcsc_list_readers failed: unknown PC/SC error code (0x8010002e)  

When I nevertheless try accessing it from gpg (with and without sudo), I get:

$ gpg --card-status   gpg: selecting card failed: No such device  gpg: OpenPGP card not available: No such device  

I am now not sure what went wrong or what is missing. Not sure if/what udev rules may be required, and I also have to confess that I don't have a very clear idea of the overall installation process and how it will later interact with the different software parts. There seems to be more info around for the Yubikeys, but this does not help me with this key I guess.

Concatenating string to form an existing variable name and working within array enclosure format

Posted: 12 Apr 2021 09:37 AM PDT

" Hi Friends, I would like some ideas to achieve the following".

  • I have many existing 'arrays vars' that I would like to be called within a for loop by 'concatenating strings' in order to form those ' existing array names'.
    • Example of the existing 'array names':

      var_mat1=( ".." ".." ".." )  var_mat2=( ".." ".." ".." )       .       .       .  var_matN=( ".." ".." ".." )  
  • The reason is that I would like to create a function that inside it has as an input parameter, some matrix enclosures, like the following

${#var_mat1[@]} , ${var_mat1[i]}, ... and finally I may repeat the same process by calling like: my-function var_mat1 and because of var_mat1 already exists it being interpreted within an internal function "my-function input parameters"

And I would like those strings that are part of the name of existing variables be treated as an input and this loop works. I will show What I have done, what I have reached, and what I expect to have. Thank you!

#!/bin/bash  mat_1=(ServerAB ServerFR ServerPE ServerAM ServerHU)  st="mat_1";  indirect_var='${'${st}'[@]}'    # The reason I used Indirect was in order to form  # the entire name it must be called within a loop   # " ((for i=0; i< ${#var_mat1[@]}; i++ ))..." --> This is the entire string I would like to be valid  # inside the LOOP, working as a real input but it is considered as an error   # input    #----- What is Hapenning now at output ----  echo Values of "mat_1 ": ${mat_1[@]}  echo Indirect value of "mat_1": ${!indirect_var}      # -- What actually have ----  for (( i=0; i < ${#mat_1[@]}; i++ ))  do  echo ${mat_1[i]};  done    #------What I expect works-----    #for (( i=0; i < ${#$st[@]}; i++ ))  #do  #   echo ${$st[i]};  #done    #--- Actual Output ------------  #$ ./matrix.sh   # Values of mat_1 : ServerAB ServerFR ServerPE ServerAM ServerHU  # ./matrix.sh: line 8: ${mat_1[@]}: invalid variable name  # ServerAB  # ServerFR  # ServerPE    #--- Desired Output ----------  #$ ./matrix.sh   # Values of mat_1 : ServerAB ServerFR ServerPE ServerAM ServerHU  # Indirect Value of mat_1: ServerAB ServerFR ServerPE ServerAM ServerHU  # ServerAB  # ServerFR  # ServerPE  # ServerAM  # ServerHU    

can I use my own variable in .muttrc config

Posted: 12 Apr 2021 09:39 AM PDT

I am using mutt,

In my config I have:

where 000.000.000.000 is the ip of my server (or could ofc be replaced by domain)

set smtp_url = "smtp://$my_address@000.000.000.000:25/"  set folder = imap://000.000.000.000:143  

I am looking to replace to IP hardcoded inside these values by a variable.

So I tried the following but it didn't work as ip is not sth mutt can recognize.

set ip="000.00.00.000"  set smtp_url = "smtp://$my_address@$ip:25/"  set folder = imap://$ip:143  

Is there anyway to achieve this without throwing mutt off when parsing the config file?

Thanks in advanceemphasized text

Systemd specifying service name dynamically

Posted: 12 Apr 2021 09:01 AM PDT

Is there a way of setting a service name dynamically in a service file?

I am running several instances of a service, where all services uses different input arguments. For debugging this is not optimal as all services are called the same and it can be tedious finding out which service is actually complaining. So what I want is to give the service a unique name for a given input. Systemds service files support this by changing the arg[0] in ExecStart by setting the prefix "@" where the second argument will be the arg[0] value.

Information about ExecStart command and the @ prefix: https://www.freedesktop.org/software/systemd/man/systemd.service.html

So this is what I have so far in my service file:

ExecStart=@/usr/bin/foo foo-%I %I  

The input argument is a file, so it will be called something like bar-123.json. This works and the service name will be foo-bar-123.json when I use top, ps or the QA tools we are using. The input files are created by another service that also starts the "foo" service instance using systemctl dbus api.

However having the service called foo-bar-123.json is not the best and instead I would like to call is foo-bar.

I have tried running, as a test:

**ExecStartPre=/bin/sh -c 'export NAME=bar'**  **ExecStart=@/usr/bin/foo foo-${NAME} %I**  

But then the name will be "foo-". Am guessing this is to be expected as the service file is not a shell script, however that was the only solution I could think of.

Other solution to the problem are also welcomed. I know that PR_SET_NAME in the prctl function should also change the name of the process but I am not sure who they relates to each other. The reason I don't want to use the prctl function is that is says that the name only can be 16 bytes long including the null byte, this is a limitation that I would be nice not to have.

Make grub let me me choose the new kernel

Posted: 12 Apr 2021 08:45 AM PDT

there's somethings I don't understand with kernel installed packages.
Sometimes I have all the kernel packages installed in a "basic version" and its upgraded version. Let's say : 4.18.0-240.el8 and 4.18.0-240.15.1.el8_3.

I know that several versions are installed to let us choose in the grub and to be able to use different kernels. This is not the problem. When I have a mix with 4.18.0-240.15.1.el8_3 and 4.18.0-240.22.1.el8_3 for instance, I don't have any issues.

But when I have a combination like 4.18.0-240.el8 and 4.18.0-240.15.1.el8_3 I always have the same issue : the grub don't let me choose to start on 4.18.0-240.15.1.el8_3. But if I try to use something that need kernel-devel and headers, it fails saying that the devel/headers packages are not available.

[root@localhost ~]# yum list installed | grep kernel  kernel.x86_64                                      4.18.0-240.el8                                @anaconda  kernel.x86_64                                      4.18.0-240.15.1.el8_3                         @baseos  kernel-core.x86_64                                 4.18.0-240.el8                                @anaconda  kernel-core.x86_64                                 4.18.0-240.15.1.el8_3                         @baseos  kernel-devel.x86_64                                4.18.0-240.22.1.el8_3                         @baseos  kernel-headers.x86_64                              4.18.0-240.22.1.el8_3                         @baseos  kernel-modules.x86_64                              4.18.0-240.el8                                @anaconda  kernel-modules.x86_64                              4.18.0-240.15.1.el8_3                         @baseos  kernel-tools.x86_64                                4.18.0-240.15.1.el8_3                         @baseos  kernel-tools-libs.x86_64                           4.18.0-240.15.1.el8_3                         @baseos  

uname -r gives me :

[root@localhost ~]# uname -r  4.18.0-240.el8.x86_64  

But when using something to build modules like dkms I have this error:

Please make sure that the correct versions of these packages are  installed.  Versions required: 4.18.0-240.el8.x86_64  

But when trying to install them, kernel-headers-4.18.0-240 nor kernel-devel-4.18.0-240 are found.

I know that if I make an upgrade, it would update everything in and it will work. But my question is : without upgrading, and keeping de version 4.18.0-240.15.1.el8_3 I to make it work? How could I do to be able to choose the 4.18.0-240.22.1.el8_3 version, which seems to be installed? I don't understand.

Thanks to anyone who could give me any advices or :)

Using sed command to match parent folder and immediate subfolder

Posted: 12 Apr 2021 10:08 AM PDT

I have a linux command that prints the following:

folder/subfolder1/file1.txt  folder/subfolder2/file1.txt  folder/subfolder2/file2.txt  folder/subfolder3/sub-subfolder3/file1.txt  

My goal is to use sed to print the following result instead:

folder/subfolder1  folder/subfolder2  folder/subfolder2  folder/subfolder3  

However, I'm not able to just keep the main folder and the immediate subfolder, I'm just able to remove the file name

's/\(folder\/.*\)\(\/.*\)/\1/'  

, which prints

folder/subfolder1  folder/subfolder2  folder/subfolder2  folder/subfolder3/sub-subfolder3  

How to create folders and subfolders in Unix/shell script

Posted: 12 Apr 2021 08:55 AM PDT

Please find the image -- of my question.

enter image description here

keyboard shortcut for moving all windows between two monitors

Posted: 12 Apr 2021 08:27 AM PDT

I am using Linux Mint, and I have two monitors. On each monitor, I have a couple of windows. Is there any keyboard shortcut to move all windows from Monitor1 to Monitor2 and vice versa? Of cause without changing the prime monitor settings.

Is there a script that can do this task? I can assign a keyboard shortcut for it.

select directories by name and list ordered by size

Posted: 12 Apr 2021 08:11 AM PDT

I want to find all directories with a specific name (e.g. .stversions) and get a list sorted by their size. I plan to use find -name .stversions to get the directories, du -hd1 to determine the size of each, and sort -h. But I cannot get them into a single line command:

find -name .stversions | du -hd1 | sort -h

seems not to select the directories (which the command alone does) but - after some complains about permission denied - to determine the size of the directories in the current directory and produce the sorted output. How to pipe the output from find to du?

How to replace Unicode code numbers by UTF-8 characters in a number of files?

Posted: 12 Apr 2021 09:45 AM PDT

I have 500 files that contain escaped Unicode characters like so:

Albert Vel\u00e1zquez  V\u00e9ronique Ekin  

etc. The data was queried from a server by a script through XMLHttpRequests and I assume the type of quoting stems from there.

As you can see each \u00xx needs to be replaced by the respective special character:

\u00e1 -> á  \u00e9 -> é  

etc.

Question: How do I replace these code sequences by their respective UTF-8 counterpart, non-interactively within all files?

The Unicode code points seem to be all 8-bit but it was not possible to check all occurrences (too many). Perhaps multi-byte characters would be displayed like \u00xx\u00yy? Or perhaps \uxxyy if this is some sort of 7-bit clean UTF-16? I hope someone here recognises the character representation (I could not find it online) and can recommend a script that handles multi-byte sequences correctly.

EDIT: Please note that iconv cannot handle the file format:

# iconv --list | wc -l  1179  

iconv knows 1179 encodings. Just try them all out:

# foreach enc ( `iconv --list | tr -d /` )  foreach? echo ==== $enc >> enctest  foreach? echo 'Vel\u00e1zquez' | iconv -f $enc -t UTF-8 >> enctest  foreach? end  # grep -a --before=1 Velázquez enctest  Exit 1  

The file does not contain the correct string :-(

How to add to Yocto fsck as a standalone package without modifying util-linux recipe?

Posted: 12 Apr 2021 07:58 AM PDT

I am working with Linux built with Yocto. I need to add to the image newer version of fsck. As I know, fsck is in util-linux. I would like to avoid updating all util-linux package. I know how to disable adding fsck from util-linux, but I have no idea how to add fsck as a standalone packet. Thank you in advanced for any help.

Ubuntu server cannot power off

Posted: 12 Apr 2021 08:12 AM PDT

I have a problem with my Ubuntu Server. If I type:

sudo shutdown -P now  

There are many logs and in the end it says reboot: Power down.

And after 30 seconds, the computer reboots.

I run Ubuntu Server 20.04 LTS on a iMac Retina from the end of 2015.

And maybe the information is helpful: I have physical access to the computer.

I don't know how I can fix this.

Can anybody help me?

In the log-file there is the following error:

systemd-networkd.socket: Failed to queue service startup job (Maybe the service file is missing or not a non-template unit?): Transaction for systemd-networkd.service/start is destructive (systemd-poweroff.service has 'start' job queue not a non-template unit?): Transaction for systemd-networkd.service/start is destructive (systemd-poweroff.service has 'start' job queued, but 'stop' is included in transaction).  

How can I prevent disk UUID mismatch when cloning a machine?

Posted: 12 Apr 2021 09:01 AM PDT

I have built a Debian linux machine. I have captured an 'image' of the entire hard drive in the form of a compressed tar file. I then unpack this onto another machine, setting up grub so that it can boot.

The problem I encounter is that the disk UUID differs from that from the original and therefore, the disk is mounted as read-only. I can fix this afterwards by configuring the correct UUID in /etc/fstab However, I would like to avoid this.

What can I do on the original machine BEFORE I capture an 'image' of it, so that when unpacked to another machine this problem is avoided?

How do I split and name the text file (based on the no. of lines of content) for bigdata?

Posted: 12 Apr 2021 09:01 AM PDT

I had a 1000's of text files on a Linux machine, and each text file's name has a prefix (OG00*) and contains 9 unique IDs. I want to create one text file for each of these IDs with text file names - OG0012637_1.txt, OG0012637_2.txt, OG0012637_3.txt, OG0012637_4.txt, OG0012637_5.txt....OG0012637_9.txt

Input:  
$ cat OG0012637.txt          TRINITY_DN9932_c0_g2_i1.p1          TRINITY_DN17663_c0_g1_i1.p1          TRINITY_DN6645_c0_g1_i2.p1          TRINITY_DN2462_c0_g1_i2.p1          TRINITY_DN19713_c3_g1_i2.p1          TRINITY_DN4587_c0_g1_i1.p1          TRINITY_DN4405_c0_g1_i1.p1          TRINITY_DN7191_c1_g2_i1.p1          TRINITY_DN1740_c0_g1_i2.p1  

Desired output files:

$ cat OG0012637_1.txt   TRINITY_DN9932_c0_g2_i1.p1  $ cat OG0012637_2.txt   TRINITY_DN17663_c0_g1_i1.p1  $ cat OG0012637_3.txt   TRINITY_DN6645_c0_g1_i2.p1  $ cat OG0012637_4.txt   TRINITY_DN2462_c0_g1_i2.p1  $ cat OG0012637_5.txt   TRINITY_DN19713_c3_g1_i2.p1  $ cat OG0012637_6.txt   TRINITY_DN4587_c0_g1_i1.p1  $ cat OG0012637_7.txt   TRINITY_DN4405_c0_g1_i1.p1  $ cat OG0012637_8.txt   TRINITY_DN7191_c1_g2_i1.p1  $ cat OG0012637_9.txt   TRINITY_DN1740_c0_g1_i2.p1  

How can lsof report a higher number than the ulimit?

Posted: 12 Apr 2021 08:06 AM PDT

From time to time some user consumes all the file descriptors (FDs) on a RHEL Linux machine. I have started logging the FDs per user to see the actual state. The logging is run as root to have access to all of the FDs. The script is simple and uses the following command to count the FDs per user:

ps -ef | awk '{print $1}' | sort | uniq | grep -v UID | xargs -I {} bash -c 'printf "{} "; /usr/sbin/lsof -u {} | wc -l ' | sort -n -k2  

I also want to compute the ratios of the actual FDs and the maximal available FDs per user for which I used the ulimit -Sn command. Nevertheless, either the soft limit returned or the counted FDs are incorrect as for some user I have 1555 as actual count and 1024 as soft limit set. I have no problem with the max values of users which have these in /etc/security/limit.conf .

In summary, I am not sure whether the root> lsof -u <user> lists only the unique FDs or it also includes more references to the same FD. In the latter case, how could I count the FDs in a correct manner?

How would you solve the problem?

Port-forwarding OpenVPN Access Server

Posted: 12 Apr 2021 09:09 AM PDT

I have been trying to properly port-forward my VPN server to no avail. I run an OpenVPN Access Server (made following a guide here) on Azure and would like users to connect to the VPN Public IP, which would forward them to my actual server public IP (a visual explanation at the end).

There are already VERY similar posts about this here and there. As a result of that, I have tried a bunch of things and researched a bunch of questions before, namely this, this, this, this (and probably even more), as well as certain articles like this, this and that, others as well probably. I have tried running this based on my situation, to no avail as well.

I have tried adding the Public IP of the VPN server in the User Permissions of the Access Server, to no avail:

51.x.x.x:tcp/63394  51.x.x.x:udp/63394  51.x.x.x:tcp/23394  51.x.x.x:udp/23394  51.x.x.x:tcp/29339  51.x.x.x:udp/29339  

I have also tried running the game server on both the public and lan IP, but that didn't make a difference. I can access the OpenVPN AS admin web UI via 10.0.1.4, which makes me think that the setup is correct. I have also added port-forwarding and traffic rules on my router for testing, but that had no effect either (tun0 interface port-forward to lan interface lan IP of PC, traffic rule vpn zone to lan zone - accept).

I have also added inbound and outbound rules in Azure for the VM. That hasn't helped either. I am not sure whether it's due to the OS or due to Azure. I am also not sure whether OpenVPN listens on port 63394, but even with DMZ on that port I am not able to connect to that port.

The current router and VPN Server routing can be viewed here.

The amount of information is a bit overwhelming, and I cannot seem to wrap my head around it alone anymore.

A visual representation of my setup is here: Server Setup

How userId work while doing sftp using ssh keys?

Posted: 12 Apr 2021 09:33 AM PDT

I'm trying to understand below scenario.

There is Server A and server B

server A pushes files to server B via ssh keys mechanism.

When server B get file pushed by server A, then what userID will be seen against that pushed file in server B ?

Is that possible where server B allows only specific userId to be used by server A to push files to it ? if yes, how that can be achieved ?

not aware of this logic in linux.

Please share.

Update: Server B has userID named as serverB and want server A also to be used the same userID serverB. Is it possible ?

How to change the output file of a pipe without stopping

Posted: 12 Apr 2021 08:04 AM PDT

I am using arecord to get audio files to preform DSP on. The problem is that everytime I start to capture input from my i2s microphone, there is a 1 second pop at the beginning of the file. I am trying to solve this by using pipes. What I would like to do is change the output of a pipe without stopping it to avoid this pop and avoid having a gap in audio as well.

For example, I would like to do something like this to switch between soundfile1 and soundfile2 so I can analyze one file while the other is recording. I don't care about a pop happening when I start recording, but I can't have it happen every time I switch back and forth.

arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v > soundfile1.wav    arecord -D dmic_sv -c2 -r 48000 -f S32_LE -t wav -V mono -v > soundfile2.wav    

Unfortunately this just tells me "Device or resource busy"

Find and replace text in bash script terminal

Posted: 12 Apr 2021 08:10 AM PDT

I have a file at /home/count/1/details/info.txt as follow

title1 {  key1 value1  key2 value2  key3 value3  }    info {  name1 text  post1 anything  salary 1  work day1  work day2  work day3  }    work {  department sell  store ground  remarks  }    contact {  required No  }  

Now I need to CHANGE above to:

title1 {  key1 value1  key2 value2  key3 value3  }    info {  name1 text  post1 anything  salary 1  work day1  work day2  work day3  work day4  work day5  work day8  }    work {  department sell  store ground  remarks  Absent No  }    contact {  required No  }  

info group has added 3 new values work day4, work day5, work day8. work group got new value ie, Absent.

headings ie, title1, info, work are fixed and can't be changed. but values between {} are dynamically changeable and can be anything. However Key work is fixed, can only be added or removed can't be renmed.

I have to write bash file to accomplish this. only terminal with ubuntu 20.04 server minimal is available to me.

Any idea, suggest, help?

Thank you

fsck - there are differences between bootsector and its bakup

Posted: 12 Apr 2021 08:56 AM PDT

Just booted up my laptop after its shutdown after a sudden poweroff, caused by a discharged battery. I use Pop!_OS which comes with a disk encryption utility, which, in my case, has been always disabled by default (probably because I installed my distro as a dual-boot to Win8). But even though it was not enabled, in the middle of the booting process it showed me a message that said: "Please enter the passphrase for disk [diskname] (cryptswap)" even though I have disabled my swap partition by commenting it out in /etc/fstab months ago. Anyways as I don't have a passphrase, I pressed escape, which got me to the tty, and from there I pressed Ctrl+C, which let me completely boot up the system. After booting up, I ran dmesg and got this output:

[   26.489543] device-mapper: table: 253:0: crypt: Device lookup failed  [   26.489547] device-mapper: ioctl: error adding target to table  [   26.520538] Swap area shorter than signature indicates  [   26.700214] FAT-fs (sda8): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.  

My 8th partition is for the bootloader. I ran fsck on /dev/sda8 which said:

There are differences between boot sector and its backup.  This is mostly harmless. Differences: (offset:original/backup)    65:01/00  1) Copy original to backup  2) Copy backup to original  3) No action  

Could it be the cause of said disk encryption pop-up and, also, what are the other consequences that can happen after a sudden shutdown without a proper unmount of the disk partiotions?

Problem installing nodejs on Centos (with yum and building from source)

Posted: 12 Apr 2021 09:20 AM PDT

I am trying to install lastest nodejs on CentOS:

[root@test-visitele ~]# uname -a  Linux test-visitele 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux  [root@test-visitele ~]# sudo yum install epel-release  Loaded plugins: fastestmirror  Loading mirror speeds from cached hostfile   * base: mirror.alpha-labs.net   * epel: ftp.plusline.net   * extras: mirror.23media.com   * updates: mirror.23media.com  Resolving Dependencies  --> Running transaction check  ---> Package epel-release.noarch 0:7-11 will be updated  ---> Package epel-release.noarch 0:7-12 will be an update  --> Finished Dependency Resolution    Dependencies Resolved    =========================================================================================   Package                   Arch                Version           Repository         Size  =========================================================================================  Updating:   epel-release              noarch              7-12              epel               15 k    Transaction Summary  =========================================================================================  Upgrade  1 Package    Total download size: 15 k  Is this ok [y/d/N]: y  Downloading packages:  Delta RPMs disabled because /usr/bin/applydeltarpm not installed.  epel-release-7-12.noarch.rpm                                      |  15 kB  00:00:00       Running transaction check  Running transaction test  Transaction test succeeded  Running transaction  Warning: RPMDB altered outside of yum.    Updating   : epel-release-7-12.noarch                                              1/2     Cleanup    : epel-release-7-11.noarch                                              2/2     Verifying  : epel-release-7-12.noarch                                              1/2     Verifying  : epel-release-7-11.noarch                                              2/2     Updated:    epel-release.noarch 0:7-12                                                                 Complete!  [root@test-visitele ~]# sudo yum install nodejs  Loaded plugins: fastestmirror  Loading mirror speeds from cached hostfile   * base: centosmirror.netcup.net   * epel: ftp.plusline.net   * extras: mirror.23media.com   * updates: mirror.23media.com  Resolving Dependencies  --> Running transaction check  ---> Package nodejs.x86_64 1:6.17.1-1.el7 will be updated  --> Processing Dependency: nodejs = 1:6.17.1-1.el7 for package: 1:npm-3.10.10-1.6.17.1.1.el7.x86_64  ---> Package nodejs.x86_64 2:10.20.1-1nodesource will be an update  --> Finished Dependency Resolution  Error: Package: 1:npm-3.10.10-1.6.17.1.1.el7.x86_64 (@epel)             Requires: nodejs = 1:6.17.1-1.el7             Removing: 1:nodejs-6.17.1-1.el7.x86_64 (@epel)                 nodejs = 1:6.17.1-1.el7             Updated By: 2:nodejs-10.20.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.20.1-1nodesource             Available: 2:nodejs-10.0.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.0.0-1nodesource             Available: 2:nodejs-10.1.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.1.0-1nodesource             Available: 2:nodejs-10.2.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.2.1-1nodesource             Available: 2:nodejs-10.3.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.3.0-1nodesource             Available: 2:nodejs-10.4.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.4.0-1nodesource             Available: 2:nodejs-10.4.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.4.1-1nodesource             Available: 2:nodejs-10.5.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.5.0-1nodesource             Available: 2:nodejs-10.6.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.6.0-1nodesource             Available: 2:nodejs-10.7.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.7.0-1nodesource             Available: 2:nodejs-10.8.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.8.0-1nodesource             Available: 2:nodejs-10.9.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.9.0-1nodesource             Available: 2:nodejs-10.10.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.10.0-1nodesource             Available: 2:nodejs-10.11.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.11.0-1nodesource             Available: 2:nodejs-10.12.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.12.0-1nodesource             Available: 2:nodejs-10.13.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.13.0-1nodesource             Available: 2:nodejs-10.14.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.14.1-1nodesource             Available: 2:nodejs-10.14.2-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.14.2-1nodesource             Available: 2:nodejs-10.15.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.0-1nodesource             Available: 2:nodejs-10.15.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.1-1nodesource             Available: 2:nodejs-10.15.2-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.2-1nodesource             Available: 2:nodejs-10.15.3-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.3-1nodesource             Available: 2:nodejs-10.16.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.0-1nodesource             Available: 2:nodejs-10.16.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.1-1nodesource             Available: 2:nodejs-10.16.2-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.2-1nodesource             Available: 2:nodejs-10.16.3-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.3-1nodesource             Available: 2:nodejs-10.17.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.17.0-1nodesource             Available: 2:nodejs-10.18.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.18.0-1nodesource             Available: 2:nodejs-10.18.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.18.1-1nodesource             Available: 2:nodejs-10.19.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.19.0-1nodesource             Available: 2:nodejs-10.20.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.20.0-1nodesource   You could try using --skip-broken to work around the problem   You could try running: rpm -Va --nofiles --nodigest  

What am I doing wrong? How can I fix it? (I am trying to follow this instruction enter link description here)

UPDATE: trying to update npm gives nothing

# yum install nodejs npm  Loaded plugins: fastestmirror  Loading mirror speeds from cached hostfile   * base: centosmirror.netcup.net   * epel: ftp.plusline.net   * extras: mirror.23media.com   * updates: mirror.23media.com  digitalocean-agent                                                | 3.3 kB  00:00:00       Resolving Dependencies  --> Running transaction check  ---> Package nodejs.x86_64 2:10.20.1-1nodesource will be installed  ---> Package npm.x86_64 1:3.10.10-1.6.17.1.1.el7 will be installed  --> Processing Dependency: nodejs = 1:6.17.1-1.el7 for package: 1:npm-3.10.10-1.6.17.1.1.el7.x86_64  --> Finished Dependency Resolution  Error: Package: 1:npm-3.10.10-1.6.17.1.1.el7.x86_64 (epel)             Requires: nodejs = 1:6.17.1-1.el7             Available: 1:nodejs-6.17.1-1.el7.x86_64 (epel)                 nodejs = 1:6.17.1-1.el7             Available: 2:nodejs-10.0.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.0.0-1nodesource             Available: 2:nodejs-10.1.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.1.0-1nodesource             Available: 2:nodejs-10.2.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.2.1-1nodesource             Available: 2:nodejs-10.3.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.3.0-1nodesource             Available: 2:nodejs-10.4.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.4.0-1nodesource             Available: 2:nodejs-10.4.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.4.1-1nodesource             Available: 2:nodejs-10.5.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.5.0-1nodesource             Available: 2:nodejs-10.6.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.6.0-1nodesource             Available: 2:nodejs-10.7.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.7.0-1nodesource             Available: 2:nodejs-10.8.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.8.0-1nodesource             Available: 2:nodejs-10.9.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.9.0-1nodesource             Available: 2:nodejs-10.10.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.10.0-1nodesource             Available: 2:nodejs-10.11.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.11.0-1nodesource             Available: 2:nodejs-10.12.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.12.0-1nodesource             Available: 2:nodejs-10.13.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.13.0-1nodesource             Available: 2:nodejs-10.14.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.14.1-1nodesource             Available: 2:nodejs-10.14.2-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.14.2-1nodesource             Available: 2:nodejs-10.15.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.0-1nodesource             Available: 2:nodejs-10.15.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.1-1nodesource             Available: 2:nodejs-10.15.2-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.2-1nodesource             Available: 2:nodejs-10.15.3-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.15.3-1nodesource             Available: 2:nodejs-10.16.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.0-1nodesource             Available: 2:nodejs-10.16.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.1-1nodesource             Available: 2:nodejs-10.16.2-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.2-1nodesource             Available: 2:nodejs-10.16.3-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.16.3-1nodesource             Available: 2:nodejs-10.17.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.17.0-1nodesource             Available: 2:nodejs-10.18.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.18.0-1nodesource             Available: 2:nodejs-10.18.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.18.1-1nodesource             Available: 2:nodejs-10.19.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.19.0-1nodesource             Available: 2:nodejs-10.20.0-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.20.0-1nodesource             Installing: 2:nodejs-10.20.1-1nodesource.x86_64 (nodesource)                 nodejs = 2:10.20.1-1nodesource   You could try using --skip-broken to work around the problem   You could try running: rpm -Va --nofiles --nodigest    

Tried building from source, but it fails to compile:

[root@test-visitele node-v12.16.3]# make  make -C out BUILDTYPE=Release V=0  ...    In file included from ../src/env-inl.h:27:0,                   from ../src/api/async_resource.cc:2:  ../src/aliased_buffer.h:32:22: error: expected type-specifier             typename = std::enable_if_t<std::is_scalar<NativeT>::value>>                        ^  ../src/aliased_buffer.h:32:22: error: expected '>'  ../src/aliased_buffer.h:65:54: error: template argument 3 is invalid         const AliasedBufferBase<uint8_t, v8::Uint8Array>& backing_buffer)                                                        ^  ../src/aliased_buffer.h:112:45: error: template argument 3 is invalid       Reference(AliasedBufferBase<NativeT, V8T>* aliased_buffer, size_t index)                                               ^  ../src/aliased_buffer.h:150:35: error: template argument 3 is invalid       AliasedBufferBase<NativeT, V8T>* aliased_buffer_;                                     ^  ../src/aliased_buffer.h: In constructor 'node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::AliasedBufferBase(v8::Isolate*, size_t, size_t, const int&)':  ../src/aliased_buffer.h:69:52: error: request for member 'GetArrayBuffer' in 'backing_buffer', which is of non-class type 'const int'       v8::Local<v8::ArrayBuffer> ab = backing_buffer.GetArrayBuffer();                                                      ^  ../src/aliased_buffer.h:78:45: error: request for member 'GetNativeBuffer' in 'backing_buffer', which is of non-class type 'const int'           const_cast<uint8_t*>(backing_buffer.GetNativeBuffer() + byte_offset));                                               ^  ../src/aliased_buffer.h: In member function 'node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference& node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::operator=(const NativeT&)':  ../src/aliased_buffer.h:121:24: error: request for member 'SetValue' in '((node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference*)this)->node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::aliased_buffer_->', which is of non-class type 'int'         aliased_buffer_->SetValue(index_, val);                          ^  ../src/aliased_buffer.h: In member function 'node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::operator NativeT() const':  ../src/aliased_buffer.h:130:31: error: request for member 'GetValue' in '((const node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference*)this)->node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::aliased_buffer_->', which is of non-class type 'int'         return aliased_buffer_->GetValue(index_);                                 ^  ../src/aliased_buffer.h: In member function 'node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference& node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::operator+=(const NativeT&)':  ../src/aliased_buffer.h:134:48: error: request for member 'GetValue' in '((node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference*)this)->node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::aliased_buffer_->', which is of non-class type 'int'         const NativeT current = aliased_buffer_->GetValue(index_);                                                  ^  ../src/aliased_buffer.h:135:24: error: request for member 'SetValue' in '((node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference*)this)->node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::aliased_buffer_->', which is of non-class type 'int'         aliased_buffer_->SetValue(index_, current + val);                          ^  ../src/aliased_buffer.h: In member function 'node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference& node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::operator-=(const NativeT&)':  ../src/aliased_buffer.h:144:48: error: request for member 'GetValue' in '((node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference*)this)->node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::aliased_buffer_->', which is of non-class type 'int'         const NativeT current = aliased_buffer_->GetValue(index_);                                                  ^  ../src/aliased_buffer.h:145:24: error: request for member 'SetValue' in '((node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference*)this)->node::AliasedBufferBase<NativeT, V8T, <template-parameter-1-3> >::Reference::aliased_buffer_->', which is of non-class type 'int'         aliased_buffer_->SetValue(index_, current - val);                          ^  ../src/aliased_buffer.h: At global scope:  ../src/aliased_buffer.h:254:50: error: template argument 3 is invalid   typedef AliasedBufferBase<int32_t, v8::Int32Array> AliasedInt32Array;                                                    ^  ...  make[1]: Leaving directory `/root/node-v12.16.3/out'  make: *** [node] Error 2  

Increase System Tray Icon Size in KDE

Posted: 12 Apr 2021 10:00 AM PDT

How can I increase the size of these System Tray Icons? :

enter image description here

How to resize titlebar buttons?

Posted: 12 Apr 2021 09:34 AM PDT

I am trying to resize the close, minimize, maximize buttons. I do it like this:

.titlebar.default-decoration button.titlebutton {    min-height: 36px;    min-width: 36px;    -gtk-icon-transform: scale(1.5);    margin: 0;    padding: 0;  }  

This makes button icons become blurry for some reason:

img

For comparison, here is how they look without -gtk-icon-transform: scale(1.5):

img

How to fix this problem?

Copy between tmux sessions without including line numbers

Posted: 12 Apr 2021 08:03 AM PDT

When I try to copy and paste between tmux sessions or windows, one problem is that I usually have line numbers displayed when using Vim and tmux copies the line numbers:enter image description here

Is there any way to avoid this?

how to resume GRUB2 upgrade apparently blocked by /boot filesystem type=ext2?

Posted: 12 Apr 2021 10:00 AM PDT

details

As detailed here, the /boot on this Debian Jessie had filesystem type=ext2

$ mount | grep -e '^/dev/'  /dev/sda3 on /boot type ext2 ...  ...  

and was unable to upgrade its GRUB2

$ sudo apt-get dist-upgrade   ...  Setting up grub-common (2.02~beta2-22+deb8u1) ...  Setting up grub2-common (2.02~beta2-22+deb8u1) ...  Setting up grub-pc-bin (2.02~beta2-22+deb8u1) ...  Setting up grub-pc (2.02~beta2-22+deb8u1) ...  Installing for i386-pc platform.  Installation finished. No error reported.  Installing for i386-pc platform.  grub-install: warning: File system `ext2' doesn't support embedding.  grub-install: warning: Embedding is not possible.  GRUB can only be installed in this setup by using blocklists.  However, blocklists are UNRELIABLE and their use is discouraged..  

At about this point, my console went to a curses TUI to present a dialog with title=Configuring grub-pc and body telling me that GRUB failed to install:

Do you want to continue anyway? If you do, your computer may not start up properly.  Writing GRUB to boot device failed - continue?  

I hit button=No. At that point,

  • the GRUB2 packages={grub-common, grub-pc, grub-pc-bin, grub2-common} were installed (per apt-get and aptitude) but not fully configured (per message above).
  • I had the following

questions

1. Should I now should update my {/dev/sda3, /boot} from filesystem type=ext2 to something else (presumably ext4)?

If I am misunderstanding the situation: what do I need to know? Is there something I should do to debug?

If I am not misunderstanding: what's the {easiest, most reliable, least disruptive} way to convert /boot's filesystem, on Debian (which this box is running)? fstransform?

2. Should I should now reconfigure GRUB2? E.g., how do I (or another Debian user in same situation) recreate the Setting up actions (see second text block) induced by the package install?

answers

1. It seemed clear to me that I should update my {/dev/sda3, /boot} from filesystem type=ext2 to ext4, which I did with fstransform (installing its Jessie package as detailed here. This seemed to go well (except for one problem).

However this filesystem upgrade may not have been necessary, per Jordan Uggla here.

2. Per Uggla's post, I reconfigured GRUB2 with sudo dpkg-reconfigure grub-pc --frontend=text as detailed here.

I now see and boot to the updated kernel and have no boot-time error messages.

How to reduce title bar height?

Posted: 12 Apr 2021 09:34 AM PDT

I'm running GNOME 3.18 and I would like to reduce the title bar height.

How could I do it?

Where to configure my smtp server in Mutt utility

Posted: 12 Apr 2021 07:57 AM PDT

I have my smtp server -- smtp.drdb.com which is registered in DNS. I need to setup Mutt utility in my RHEL 6 server. Where should I input my smtp server details in mutt.rc file so that I can send mail. When I try to send mail from mutt, it goves me error Invalid URL - smtp.drdb.com

Mounting synology disks in ubuntu

Posted: 12 Apr 2021 09:02 AM PDT

I have some files on synology disk that I would like to recover with extundelete. I have mounted the raid1 setup. So on the disk is two raid storages (md2 and md3) and they are connected to one with lvm. I try to get the lvm going. I think it doesn't like the md2p1. I tried to mount md2p1, but it doesn't mount, so I thnik it's some garbage. How could I make that work that LVM would find the other device?

sudo lsblk -o name,uuid,mountpoint  NAME        UUID                                   MOUNTPOINT  sda                                                  ├─sda1      bb4b1f59-9349-4e59-cced-5de7ca715931     ├─sda2      291dec99-01d5-7031-cced-5de7ca715931     ├─sda5      46288321-39d3-353d-7014-c3a9333d1c33     │ └─md2     8s9LfU-Egt2-sbtJ-1zkH-ewqb-LjRT-xZ2RC2   │   └─md2p1 8da77aa4-43ff-4cd1-81f0-f311284e0b04     └─sda6      a7ff03a3-29c2-a100-ecdd-c31c151ca783       └─md3     Eu0fsK-Cu1W-3PCw-ZEV6-80fL-05rf-H0qlcE   sdb                                                  ├─sdb1      e29faa0c-a7b4-4851-a17d-75c20238edc2   /  ├─sdb2      ce06f4bb-5f73-423b-9794-b94a1e47d4f8     └─sdb3      6089A7F658D702D4                         sdc                                                  └─sdc1      09d3c590-3a6a-4436-8718-7c14ab0e282b     sudo lvs   Couldn't find device with uuid 8s9LfU-Egt2-sbtJ-1zkH-ewqb-LjRT-xZ2RC2.  LV   VG     Attr      LSize Pool Origin Data%  Move Log Copy%  Convert  lv   vg1000 -wi-----p 2,72t  

Notifications and notification daemon not working on window manager

Posted: 12 Apr 2021 10:01 AM PDT

Notifications doesn't work on Linux standalone window managers (Openbox, Awesome WM and alike). I tried to install notification-daemon and dunst, but sending with notify-send "something" does not make any window to pop-up.

I tried to run polkit-gnome-agent and run directly notification daemons, but it does not help (while ago I solved similar problem in this way, but now it does nothing).

There is no any indications of errors unless I send trivial notification with python, then I get only vague error message:

File "/usr/lib/python3.3/site-packages/gi/types.py", line 113, in function      return info.invoke(*args, **kwargs)  gi._glib.GError: Could not connect: Connection refused  

Trivial C program outputs nothing (no error for example).

I'm using Archlinux with systemd and d-bus, I suspect it's a problem with polkit or some kind daemon not runing on window manager start, but have no idea, what could I try or how could I get more meaningfull error messages.

EDIT: I took sample code from there: https://wiki.archlinux.org/index.php/Libnotify#Python

Dbus should be runing because systemd has it as dependency. I have libnotify installed - it is package which provides notify-send. Also notification daemon should start as needed (only when notification arives), by following desktop file /usr/share/dbus-1/services/org.freedesktop.Notifications.service :

[D-BUS Service]  Name=org.freedesktop.Notifications  Exec=/usr/bin/dunst  

I had even tried to run daemons directly (just execute) and tried sending notifications. If somenone knows how I could get me more info, please do not hesitate to suggest.

EDIT 2: I tried running notification daemon with sudo: sudo notification-daemon_name & (in my case sudo dunst &) and sudo notify-send something, then notification works. But when I try to do any of the previous actions as unprivileged user (which is important most programs send notification as unprivileged users), nothing shows.

notification-daemon refuses to work at all without any error or warning.

EDIT 3: Clearly it is permissions problem: I can't send notifications without root access. After clean reboot: sudo notify-send "something" works even without manually launching any daemons, however what I (and my launched programs) should do to be able send notifications without root privilegies as it is possible in Gnome or any other full desktop environments?

No comments:

Post a Comment