Friday, October 29, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Error installing flatpak softwares "Unacceptable TLS certificate"

Posted: 29 Oct 2021 08:32 AM PDT

I installed flatpak using

$ sudo pacman -S flatpak  

after that i a added repo

$ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo  

and it gives me error

"Unable to load summary from remote flathub: Unacceptable TLS certificate"  

i added another following repo

$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo  

this got added without any error but if i install any software from flathub.org it gives me same previous error

"Unable to load summary from remote flathub: Unacceptable TLS certificate"  

XFCE black splash icon background

Posted: 29 Oct 2021 08:27 AM PDT

I have observed the following problem in XFCE, which I hope somebody can help me fix:

Case 1: When starting Mathematica the splash icon (the manifold) appears embedded in a black square enter image description here .

The black regions should, however, be transparent.

Case 2: When I attempt to share my screen in a Zoom call I can observe a similar black 'border' around the control elements and often geet informed that the windows I'm attempting to show can be seen with large black boxes obscuring almost everything but the window boundaries.

This appears to be a transparency/fill issue somewhere but I can't quite figure out how to fix it.

shell script, display users in the system

Posted: 29 Oct 2021 08:15 AM PDT

the task is as follows:

write a program that outputs information about users in the system after a certain time interval: who entered, who left.

while [ true ]; do      clear         date      lastlog      sleep 5  done   

I showed this version of the program above to the teacher, but he said that I should compare the two files.As far as I understand, I have to write users to a file. .Can you tell me how to implement his idea? :(

/also, instead of the lastlog line, I offered this option

cat /var/log/auth.log | egrep "(Accepted publickey|Accepted password|Disconnected from user)"  

Maybe he just didn't notice.. /

Please help me figure out how to do this by comparing two files, otherwise I already have nightmares about this program.

bash replacing special characters in a variable

Posted: 29 Oct 2021 09:51 AM PDT

pipe (|) limited text file is transferred from Windows application for processing. While processing there is a special character in the first column in first line of the file. This is how file looks in notepad before transferring from Windows

Sector|Name|Manager|...  

When I read IFS='|' read -r -a fields < "/uploads/file_data.txt", the first column sector is read as "Sector" with special characters prefixed.

When i do this head -1 "/uploads/file_data.txt" | od -c the value printed is

0000000 357 273 277   S   e   c   t   o   r   |  

I tried tr -d < //uploads/file_data.txt > /uploads/file_data_temp.txt but dint help. How do i replace the special characters not only this if any unknown characters are in the file uploaded in future.

RTNETLINK "file exists" error when attempting to create veth interface that was previously a dummy

Posted: 29 Oct 2021 07:56 AM PDT

Linux Mint 20.2

I used this command to create a dummy ethernet interface called veth0:

sudo ip link add veth0 type dummy  

Once finished I removed it with:

sudo ip link delete veth0 type dummy  

The interface was definitely removed. After a reboot I then tried to create a virtual ethernet type interface with:

sudo ip link add veth0 type veth  

But when I do this I get the "file exists" error.

It does allow me to recreate a dummy type interface with the first command again. Where could it be referencing the interface name to be preventing it from being reused as a virtual ethernet type?

My research has thrown up a lot of similar posts but they all generally reference a problem with physical interfaces not being able to use the ifup command. The fix is to flush the addresses on the interface and make sure is not more that one gateway listed in /etc/network/interfaces. Neither fix applies here. I've found nothing about virtual interface names not being re-usable for different interface types after the previous type is removed.

I realise I could just use a different interface name, but I'd like to clean up this configuration problem and understand what has caused it.

PHC2Sys and syscalls with intel NIC have insane high latency

Posted: 29 Oct 2021 07:50 AM PDT

I'm currently working on a device wich is set to give out multiple different timing Protocolls from one PTP-grandmaster. For this i have an RockPro64 SOC with an Intel i350 NIC.

For the Project I synched my Node 0 with the PTP-gm and then used PHC2SYS to synchronize that PHC (/dev/ptp0) with the Clock of the 2nd Node (/dev/ptp1). While doing this I realized "huge" discrepancy in the PHC2SYS log, leaving me with offsets of over 10µs between the two clocks.

Upon further investigation I realized my systems have immense latencys to get the Times of the corresponding Clocks from the Intel Card.

root@Debian-Desktop:~# phc2sys -s enp1s0f0 -c enp1s0f1 -m -O 0 -u 5  phc2sys[359650.251]: enp1s0f1 rms 30067 max 52752 freq +19970 +/- 4699 delay 134654 +/- 608  phc2sys[359655.258]: enp1s0f1 rms 7716 max 12513 freq +22632 +/- 6695 delay 139043 +/- 9564  phc2sys[359660.266]: enp1s0f1 rms 5405 max 11982 freq +19878 +/- 4756 delay 139411 +/- 9425  phc2sys[359665.273]: enp1s0f1 rms 9643 max 15968 freq +25285 +/- 7717 delay 114311 +/- 52329  phc2sys[359670.280]: enp1s0f1 rms 2188 max 3666 freq +21912 +/- 867 delay 134384 +/- 699  phc2sys[359675.287]: enp1s0f1 rms 7516 max 12520 freq +21715 +/- 6460 delay 139239 +/- 9583  phc2sys[359680.294]: enp1s0f1 rms 1945 max 3782 freq +23035 +/- 1689 delay 134355 +/- 693  phc2sys[359685.302]: enp1s0f1 rms 7773 max 12556 freq +22474 +/- 6773 delay 139255 +/- 9578  phc2sys[359690.309]: enp1s0f1 rms  962 max 1615 freq +22359 +/- 522 delay 134470 +/- 774  phc2sys[359695.316]: enp1s0f1 rms  585 max  868 freq +22209 +/- 470 delay 134064 +/- 690  phc2sys[359700.323]: enp1s0f1 rms 23740 max 36534 freq +22996 +/- 20652 delay 139395 +/- 9383  

Here you can see the messages the service is printing to the terminal while im synching my 2 PHCs. Thinking i might have a problem with the scheduling or something inside the PHC clocks i tried to synch my ptp-slave Clock to my systemtime but the Problem seemed to prevail:

root@Debian-Desktop:~# phc2sys -s enp1s0f0 -c CLOCK_REALTIME -O 0 -m -u 5  phc2sys[359502.064]: CLOCK_REALTIME rms 8563 max 11357 freq   +497 +/- 4178 delay 74783 +/- 951  phc2sys[359507.067]: CLOCK_REALTIME rms 2281 max 3391 freq  +4203 +/- 719 delay 74258 +/- 1232  phc2sys[359512.070]: CLOCK_REALTIME rms  779 max 1008 freq  +3050 +/- 607 delay 74550 +/- 969  phc2sys[359517.073]: CLOCK_REALTIME rms  906 max 1288 freq  +3443 +/- 742 delay 74141 +/- 1128  phc2sys[359522.076]: CLOCK_REALTIME rms  980 max 1196 freq  +3268 +/- 837 delay 74141 +/- 1017  phc2sys[359527.079]: CLOCK_REALTIME rms  943 max 1274 freq  +3329 +/- 802 delay 74258 +/- 1116  phc2sys[359532.084]: CLOCK_REALTIME rms  772 max 1377 freq  +3290 +/- 661 delay 74608 +/- 854  phc2sys[359537.087]: CLOCK_REALTIME rms  922 max 1293 freq  +3420 +/- 794 delay 74141 +/- 1633  phc2sys[359542.090]: CLOCK_REALTIME rms  457 max  804 freq  +3542 +/- 372 delay 74783 +/- 1116  phc2sys[359547.094]: CLOCK_REALTIME rms  455 max  918 freq  +3136 +/- 323 delay 75950 +/- 143  phc2sys[359552.098]: CLOCK_REALTIME rms 1771 max 2858 freq  +3466 +/- 1518 delay 65275 +/- 18097  phc2sys[359557.100]: CLOCK_REALTIME rms  608 max 1147 freq  +3258 +/- 517 delay 74841 +/- 969  phc2sys[359562.104]: CLOCK_REALTIME rms  686 max  974 freq  +3461 +/- 584 delay 74550 +/- 1363  phc2sys[359567.107]: CLOCK_REALTIME rms  452 max  698 freq  +3260 +/- 375 delay 74783 +/- 952  phc2sys[359572.110]: CLOCK_REALTIME rms  543 max  881 freq  +3348 +/- 461 delay 73616 +/- 1259  phc2sys[359577.113]: CLOCK_REALTIME rms  786 max 1115 freq  +3179 +/- 657 delay 74375 +/- 1075  

after that i wrote a simple C-Script to test how fast i can get times from those clocks and the results seem to fall in line with my PHC2SYS problems:

CODE:

//clock functions  clockid_t phc_open(const char *phc)  {      clockid_t clkid;      struct timespec ts;      struct timex tx;      int fd;        memset(&tx, 0, sizeof(tx));        fd = open(phc, O_RDWR);      printf("fd: %d \n", fd);      if (fd < 0){          printf("fd failed \n");      return CLOCK_INVALID;      }        clkid = FD_TO_CLOCKID(fd);      /* check if clkid is valid */      if (clock_gettime(clkid, &ts)) {          close(fd);          return CLOCK_INVALID;      }      if (clock_adjtime(clkid, &tx)) {          close(fd);          return CLOCK_INVALID;      }        return clkid;  }  void phc_close(clockid_t clkid)  {      if (clkid == CLOCK_INVALID)          return;        close(CLOCKID_TO_FD(clkid));  }      int main(int argc, char **argv){      setpriority(PRIO_PROCESS,0,-20);   //set priority to highest        char ptpCH0[100]="/dev/ptp0";      char ptpCH1[100]="/dev/ptp1";      char ptpCH2[100]="/dev/ptp2";                  struct timespec ptp0;      struct timespec ptp1;      struct timespec ptp2;              clockid_t ptpclock0=phc_open(ptpCH0);      clockid_t ptpclock1=phc_open(ptpCH1);      clockid_t ptpclock2=phc_open(ptpCH2);      for(int i=0; i<=10;i++){              clock_t begin=clock();              clock_gettime(ptpclock0,&ptp0);              clock_t end=clock();              printf("time taken 1st call: %f\n",(double)(end-begin)/CLOCKS_PER_SEC);                            begin=clock();              clock_gettime(ptpclock1,&ptp1);              end=clock();                          printf("time taken 2nd call: %f\n",(double)(end-begin)/CLOCKS_PER_SEC);                            begin=clock();              clock_gettime(ptpclock2,&ptp2);               end=clock();              printf("time taken 3rd call: %f\n",(double)(end-begin)/CLOCKS_PER_SEC);                                            volatile unsigned long ptp0_sec=ptp0.tv_sec;              volatile unsigned long ptp0_nsec=ptp0.tv_nsec;                            volatile unsigned long ptp1_sec=ptp1.tv_sec;              volatile unsigned long ptp1_nsec=ptp1.tv_nsec;                            volatile unsigned long ptp2_sec=ptp2.tv_sec;              volatile unsigned long ptp2_nsec=ptp2.tv_nsec;                            printf("delay 1-0 [ns]: %d \n delay 2-1: %d \n", (int)(ptp1_nsec-ptp0_nsec),(int)(ptp2_nsec-ptp1_nsec));               printf("i: %d\n", i);        sleep(1);}      return 0;      }  

The results:

time taken 1st call: 0.000075  time taken 2nd call: 0.000087  time taken 3rd call: 0.000074  delay 1-0 [ns]: 103938    delay 2-1: 100815   i: 0  time taken 1st call: 0.000082  time taken 2nd call: 0.000075  time taken 3rd call: 0.000088  delay 1-0 [ns]: 110816    delay 2-1: 93767   i: 1  time taken 1st call: 0.000082  time taken 2nd call: 0.000109  time taken 3rd call: 0.000076  delay 1-0 [ns]: 99727    delay 2-1: 120274   i: 2  time taken 1st call: 0.000083  time taken 2nd call: 0.000076  time taken 3rd call: 0.000088  delay 1-0 [ns]: 117514    delay 2-1: 62423   i: 3  time taken 1st call: 0.000153  time taken 2nd call: 0.000079  time taken 3rd call: 0.000092  delay 1-0 [ns]: 237469    delay 2-1: 76199   i: 4  time taken 1st call: 0.000083  time taken 2nd call: 0.000075  time taken 3rd call: 0.000075  delay 1-0 [ns]: 111567    delay 2-1: 93376   i: 5  time taken 1st call: 0.000082  time taken 2nd call: 0.000076  time taken 3rd call: 0.000075  delay 1-0 [ns]: 98674    delay 2-1: 86869   i: 6  time taken 1st call: 0.000083  time taken 2nd call: 0.000076  time taken 3rd call: 0.000075  delay 1-0 [ns]: 121192    delay 2-1: 65821   i: 7  time taken 1st call: 0.000084  time taken 2nd call: 0.000075  time taken 3rd call: 0.000076  delay 1-0 [ns]: 131881    delay 2-1: 73680   i: 8  time taken 1st call: 0.000082  time taken 2nd call: 0.000075  time taken 3rd call: 0.000087  delay 1-0 [ns]: 111331    delay 2-1: 93727   i: 9  time taken 1st call: 0.000083  time taken 2nd call: 0.000075  time taken 3rd call: 0.000088  delay 1-0 [ns]: 118028    delay 2-1: 79757   i: 10  

as you can see my Problem is not only that i have massive access times (i can see some Microseconds here, since we are on a PCIe Bus. But 70-100+ µs seems just absurd to me) but also it varies a lot, wich significantly hinders the PHC2SYS service to work properly.

Does anyone has any idea what could cause this? Could this be a driver issue?

Thx in Advance

Alex

Access I/O From Startup Process on Ubuntu Server

Posted: 29 Oct 2021 07:56 AM PDT

I have installed an Ubuntu Server on my old PC, and put a Minecraft server on it (more specifically, a spigot 1.17.1 server, as per these instructions).

It's run by a .sh file with

java -Xmx3G -XX:+UseG1GC -jar spigot.jar nogui  

as arguments.

The server starts and I can connect to it. My only problem is that I can't access the program output (logging info) and input (to give him commands to execute). Any way I could access it?

Running ps -aux, the process is listed as started by my username.

Slow Startup and Shutdown on KDE

Posted: 29 Oct 2021 07:21 AM PDT

I'm using KDE and when I log in after entering user password, it takes almost 4-5 seconds to system to show desktop. While, when i shutdown, it takes almost 10 seconds to properly shutdown. But if i use $shutdown now command, the system shutdowns immediately. These slow login and shutdown and times were not there before i switched to Arch+KDE

"<?php" at Beginning of File Makes it Unreadable by Owner

Posted: 29 Oct 2021 07:21 AM PDT

I have a situation I've never seen before and haven't been able to find in my searching. I have a PHP file that is not viewable or editable by the owner or any group owner. Oddly, Apache can read and process the file, so it's not corrupt as far as I can tell. Also, it can be viewed and edited with sudo (i.e. as root).

What I've discovered is that any file that has <?php on the first line (which is pretty common for PHP files) exhibits this behavior. I just tested this in my home directory:

$ vi henry.txt  

I put some text in it and save it. No problem. I can view the file:

$ cat henry.txt  Test  

I edit the file again (vi henry.txt) and put <?php on the first line, pushing Test down to the second line. Then I save and exit. Now:

$ cat henry.txt  cat: henry.txt: Operation not permitted  

but:

$ sudo cat henry.txt  <?php  Test  

I edit the file again (sudo vi henry.txt because I can't edit it as myself) and remove the <?php line. Save and exit. Now:

$ cat henry.txt  Test  

In fact, I don't even need the full <?php to block access. Simply putting <? there will do it.

I'm totally at a loss as to why this might be. Any ideas would be greatly appreciated. In case it matters, this is Red Hat Enterprise Linux 8. I've tried disabling SELinux but that made no difference.

How can I stop SSH server to send logs to syslog?

Posted: 29 Oct 2021 07:13 AM PDT

Debian 10

I have a lot of log info like this:

localhost systemd[1]: Started Session 30522 of user xxxx.  

How can I stop sshd to send logging info to sysconf ?

Thank you

Why qemu is extremly slow? How to fast it up?

Posted: 29 Oct 2021 07:11 AM PDT

I have 4 kernels + 6G RAM notebook and run qemu+aarm64 there.

sudo apt-get install qemu-system-arm  sudo apt-get install qemu-efi-aarch64  sudo apt-get install qemu-utils  dd if=/dev/zero of=flash1.img bs=1M count=64  dd if=/dev/zero of=flash0.img bs=1M count=64  dd if=/usr/share/qemu-efi-aarch64/QEMU_EFI.fd of=flash0.img conv=notrunc  qemu-img create ubuntu-image.img 20G  

then downloaded https://cdimage.debian.org/debian-cd/current/arm64/iso-cd/debian-11.1.0-arm64-netinst.iso and run

qemu-system-aarch64 -nographic -machine virt,gic-version=max -m 3G -cpu max -smp 4 \  -netdev user,id=vnet,hostfwd=:127.0.0.1:0-:22 -device virtio-net-pci,netdev=vnet \  -drive file=ubuntu-image.img,if=none,id=drive0,cache=writeback -device virtio-blk,drive=drive0,bootindex=0 \  -drive file=debian-11.1.0-arm64-netinst.iso,if=none,id=drive1,cache=writeback -device virtio-blk,drive=drive1,bootindex=1 \  -drive file=flash0.img,format=raw,if=pflash -drive file=flash1.img,format=raw,if=pflash  

Emulator goes extremely slow, why?

How to tar-gzip a directory and put it in the /tmp

Posted: 29 Oct 2021 06:53 AM PDT

Hey im stuck on a assignment and i dont know how to solve it really because iam quite new with working in linux. I have to place a directory in a tar-ball and zip it using gzip. At the moment this is my code but it wont work and i dont know what the problem is...

dir=$1

tar -cv/tmp/backupfile.tgz $dir

Port Mirroring to another localhost port

Posted: 29 Oct 2021 07:09 AM PDT

I have an application a running on Port Y (UDP). Is it possible to create a mirror without touching application A to receive the message in application a and additionally in application B (same host) on a different port Y?

I tried with

socat udp-listen:x,reuseaddr,fork udp:localhost:y  

Unfortunately, socat starts a listener on port X and applicaton a does not receive the message.

I also read some solution with iptables with mangle - which does not seem to be supported by my iptables version anymore.

It needs to run on 2 different platforms:

  • Ubuntu 20.04 with iptables v1.8.4 (legacy)
  • SLES12SP5 with v1.4.21

I can not use a 2nd IP address in the subnet of my eth0 interface.

Rsync all directories that contain a specific file

Posted: 29 Oct 2021 08:28 AM PDT

I am working on a cluster that requires both public key and password, I have a complex file structure to organize my work on this cluster, and I would like to have a backup on my local machine of some directories only.

I would like rsync to get only directories that have a file named "backup". Example:

data/sub1/sub1_1/backup < back up this directory  data/sub1/sub1_2/ < don't back up  

Because of this password thing, I would like to avoid any script that calls ssh multiple times, is there any advanced filter able to do that with rsync?

How to make the cups client.conf file optional?

Posted: 29 Oct 2021 07:02 AM PDT

In order to print when I'm at the office, I need to add a file /etc/cups/client.conf with content

ServerName our.cups.server/version=1.1  

However, when I get home, the existence of this file makes Ubuntu 20.04 freeze when I log in to the graphical interface. So what I have been doing, as a workaround, is either deleting the file before going home, or logging in through a terminal, deleting the file, and only then logging in to the graphical interface.

Is there a cleaner way to do this? For example, is there a way to tell cups to ignore the file if it cannot connect?

Disk full but cannot find were is the used space (Ubuntu)

Posted: 29 Oct 2021 07:11 AM PDT

I have a small Intel NUC with a 30GB drive. My problem is that this drive is full but cannot find the cause of it.

df reporting the following

Filesystem     1K-blocks      Used Available Use% Mounted on  udev              899412         0    899412   0% /dev  tmpfs             189284      2676    186608   2% /run  /dev/sda2       28414508  27751116         0 100% /  tmpfs             946404         0    946404   0% /dev/shm  tmpfs               5120         4      5116   1% /run/lock  tmpfs             946404         0    946404   0% /sys/fs/cgroup  /dev/loop0           128       128         0 100% /snap/bare/5  /dev/loop1         56832     56832         0 100% /snap/core18/2128  /dev/loop2         56832     56832         0 100% /snap/core18/2246  tmpfs             946404         0    946404   0% /tmp  /dev/loop3        314880    314880         0 100% /snap/makemkv/381  /dev/loop4         66688     66688         0 100% /snap/gtk-common-themes/1515  /dev/loop5         63360     63360         0 100% /snap/core20/1169  /dev/loop6         63360     63360         0 100% /snap/core20/1081  /dev/loop7         33280     33280         0 100% /snap/snapd/13270  /dev/loop8        317184    317184         0 100% /snap/makemkv/385  /dev/loop9         33280     33280         0 100% /snap/snapd/13640  /dev/loop10        66816     66816         0 100% /snap/gtk-common-themes/1519  /dev/sda1         306584      5356    301228   2% /boot/efi  tmpfs             189280         4    189276   1% /run/user/1000  

Computing this it gives somewhere around ~14GB of used disk space.

Running sudo lsof | grep REG | grep -v "stat: No such file or directory" | grep -v DEL | awk '{if ($NF=="(deleted)") {x=3;y=1} else {x=2;y=0}; {print $(NF-x) " " $(NF-y) } }' | sort -n -u | numfmt --field=1 --to=iec | tail -10

gives me a list with few processes that matters:

5,5M  /usr/lib/php/20190902/fileinfo.so  6,8M  /usr/lib/jellyfin/bin/libcoreclr.so  8,0M  /var/log/journal/6296b00d07874d0a9533eed0efb81840/user-1000.journal  8,2M  /usr/lib/jellyfin/bin/System.Private.Xml.dll  8,3M  /usr/lib/locale/locale-archive  8,9M  /usr/lib/jellyfin/bin/System.Private.CoreLib.dll  10M  /usr/lib/udev/hwdb.bin  24M  /snap/snapd/13640/usr/lib/snapd/snapd  27M  /usr/lib/x86_64-linux-gnu/libicudata.so.66.1  64M  /memfd:pulseaudio  

Running sudo du -sh / --exclude=disks --total gives me a total of 13GB.

So, basically I am out of ideas on how to find out were are the missing ~16GB that the system reports as being somewhere filling out my drive.

An the report is actually behave as such, running

cd ~/ && touch example && echo "FooBar" > example  -bash: echo: write error: No space left on device  

Thank you in advance, and, any ideea is a good ideea, basically a have a device that at the current moment is unusable and my options are running low (basically a clean reinstall / buy a larger ssd for a device that should not use more than 20gb)

Difference between `eval set -- "$opts"` and the direct call `set -- "$opts"` [duplicate]

Posted: 29 Oct 2021 07:02 AM PDT

What is the difference between

eval set -- "$opts"   

and a direct call using

set -- "$opts"   

Have seen eval set -- "$opts" being used quite frequently with getopt.

To get some idea, I am using the following code

myfunc ()    {      shortopts=":hC:"      longopts="help"            opts=$( getopt -o "$shortopts" -l "$longopts" -n "${0##*/}" -- "$@" )        echo "\$@: $@"        eval set -- "$opts"      echo "eval \$@: $@"        set -- "$opts"      echo "set \$@: $@"            while (( $# > 0 )); do        case "$1" in          ("-h"|"--help")            printf "%s\n" "HELP."            return 0            ;;          ("-C") ctx=$2 ; shift 2 ;;          # ----------------------------------------------------           ("?") echo "? unrecognised predicate $1" ; shift 1 ;;          (":") echo ": missing argument" ; shift 1 ;;          # ----------------------------------------------------           ("--") shift 1 ; break ;;          ("-"*) echo "unrecognised predicate $1" ; shift 1 ;;          (*) echo "unrecognised argument" ; shift 1 ;;           # ----------------------------------------------------          esac       done     }  

Running the function as myfunc -hC "foo bar" gives

$@: -hC foo oeuoeu  eval $@: -h -C foo oeuoeu --  set $@:  -h -C 'foo oeuoeu' --  

There is some difference in the result, but unsure about the consequences.

mkisofs error - boot image...efibot.img not an allowable size

Posted: 29 Oct 2021 08:09 AM PDT

I am trying to create a custom ISO from a rhel-8 installation disk that can boot on either a BIOS or an EFI server. Everything goes fine until I try to create the iso. If I run the following command:

mkisofs -J -R -T -V "NGS-8.4-0 Server" \      -o ngs-8.4-0.iso \      -b isolinux/isolinux.bin \      -c isolinux/boot.cat \      --no-emul-boot \      --boot-load-size 4 \      --boot-info-table \      --eltorito-alt-boot \      -e images/efiboot.img \      -m TRANS.TBL \      ngs-dvd  

I get the following output:

Creating NGS iso...I: -input-charset not specified, using iso-8859-1 (detected in locale settings)    (bunch of TRANS.TBL output deleted)    Size of boot image is 4 sectors -> No emulation  Size of boot image is 19612 sectors -> genisoimage: Error - boot image '/NGS/ngs-dvd/images/efiboot.img' has not an allowable size.  

However, if I delete two options (--eltorito-alt-boot & -e images/efiboot.img), it creates a bootable iso. What am I doing wrong?

How to take only uniq rows based on a column using linux cmd?

Posted: 29 Oct 2021 06:53 AM PDT

Here is my dataset:

col1,col2,col3  a,b,c  a,d,f  d,u,v  f,g,h  d,u,g  x,t,k  

Expected output:

f,g,h  x,t,k  

Selection criteria:

If anything occurs in col1 multiple times, then all of the associated rows will be deleted.

Can I solve it using Linux sort or uniq or anything else?

Logging script to email

Posted: 29 Oct 2021 07:08 AM PDT

I have a script that scans a log for a list of words, then sends an email with the results. I would like to expand this to do the same for other logs in the same directory but make it a new email with each log. How would I do that?

#!/bin/bash  LOG="pdb.lg psmseis.lg psyseis.lg"   # three logs to look through    REPORT_NAME='/tmp/pdb.lg_report'    LOGDIR="/pdb1"  # directory containing the log    # errors being searched for.        LIST="      abnormal      allow*      attempt*      beyond      cannot      corrupt*      damage*      dead      died      disappear*      drastic      enough      error      exceed*      fail*      fatal      illegal      impossible      increase      insufficient      invalid      kill*      missing      overflow*      stget      stop      system      unable      unexpected*      unknown      violation      warn      wrong      "    rm ${REPORT_NAME}    for words in $LIST  do      RESULTS=`grep -i ${words} ${LOGDIR}/${LOG} | grep -v 'exceeded. Automatically increasing from'`      if [[ ${RESULTS} > "" ]]      then          echo -e "\n-----------------------" >> ${REPORT_NAME}          echo -e "SEARCH PATTERN = ${words}" >> ${REPORT_NAME}          echo -e "-------------------------" >> ${REPORT_NAME}          grep -i ${words} ${LOGDIR}/${LOG} >> ${REPORT_NAME}      fi  done    MESSAGE_HEADER="Please check these possible errors from the /pdb1/pdb.lg log.\n"  MESSAGE_BODY=`cat ${REPORT_NAME}`  MESSAGE_TAIL="\n\nThis email is from ${0}."  MESSAGE="${MESSAGE_HEADER}${MESSAGE_BODY}${MESSAGE_TAIL}"  SUBJECT="ERROR REPORT from ${LOGDIR}/${LOG}"    for USER in ${USERLIST}  do      echo -e "${MESSAGE}" | mailx -s "${SUBJECT}" ${USER}  done  

ThinkPad X1 Extreme Gen2 slow charging via USB-C on Ubuntu 20.10

Posted: 29 Oct 2021 08:29 AM PDT

I recently switched my ThinkPad X1 Extreme Gen2 to Ubuntu 20.10.

Everything works perfectly, except it seemed to charge a bit slow. I don't use the normal Lenovo charger usually, but rather USB-C with PD.

So I started looking into the checks for that and I confirmed that via both the sensors command as well as directly interacting with UCSI's sysfs endpoints, the negotiation doesn't seem to proceed completely correctly. I can see the charger offers 15V or 19V, but the laptop always negotiates 5V 3A, resulting in slow 15W charging. On Windows 10 it correctly charges with the full ~90-100W the charger permits. Here is an example output from sensors showing the laptop even clearly see the charger's capability to use 15V:

root@capefox:~# sensors  ...    ucsi_source_psy_USBC000:001-isa-0000  Adapter: ISA adapter  in0:           5.00 V  (min =  +5.00 V, max = +15.00 V)  curr1:         3.00 A  (max =  +3.00 A)  

Is there a way to manually tell Linux to negotiate up the voltage?

EDIT:

I should also mentioned I checked the typec in sysfs and verified that the mode is "usb_power_delivery" and "usb_power_delivery_revision" shows 2, so negotiation is happening, except for some reason the laptop asks for 5V 3A and never a higher voltage. I have even tried another power supply that can deliver 19V via PD, still stuck at 5V

How do I tell an application (Brave in this case) to remember that I've allowed it access to Kdewallet?

Posted: 29 Oct 2021 08:56 AM PDT

I've found many articles with instructions for disabling the wallet altogether, but I'd like to use it, just not have to authenticate every time I open Brave. Is there a way to grant permanent permissions for an application to access Kdewallet?

Here are some links to similar questions where the only answers are to disable it:

https://askubuntu.com/questions/1205161/annoying-kde-wallet-service-popup-the-application-kded5-has-requested-to-open

https://askubuntu.com/questions/1109179/kde-wallet-keychain

I'd really like to be able to save encrypted passwords locally without needing to give permissions every time.

Thank you

How do I determine the block size for ext4 and btrfs filesystems?

Posted: 29 Oct 2021 09:29 AM PDT

I'm looking for the commands that will tell me the allocation quantum on drives formatted with ext4 vs btrfs.

Background: I am using a backup system that allows users to restore individual files. This system just uses rsync and has no server-side software, backups are not compressed. The result is that I have some 3.6TB of files, most of them small.

It appears that for my data set storage is much less efficient on a btrfs volume under LVM than it is on a plain old ext4 volume, and I suspect this has to do with the minimum file size, and thus the block size, but I have been unable to figure out how to get those sizes for comparison purposes. The btrfs wiki says that it uses the "page size" but there's nothing I've found on obtaining that number.

Requirements to boot a rootfs.img

Posted: 29 Oct 2021 09:07 AM PDT

I have a Linux image from which I've extracted a "rootfs.img" file, the file seems to contain files and information, I would like to "boot into it" file contents: bin dev etc home lib media mnt proc run sbin service sys tmp usr var lib64

how can I install a bootloader to boot it?

I've tried: getting a live ubuntu image, adding a partition, placing the contents of rootfs.img inside the partition and running "Boot Repair", which did find the other system as another bootable linux, but I can't boot into it, seems like I'm missing something

Chrome: font size of tabs, bookmarks' bar etc

Posted: 29 Oct 2021 08:08 AM PDT

Depending on the DPI settings, the fonts used in the Chrome user interface may be the wrong size, because Chrome (2018.07.22) respects the DPI settings when it renders web pages' content, but not when it draws the UI.

E.g., my 13.3", 1366x768 display has approximately 118 DPI both in the horizontal and the vertical direction and when I use that value a 12pt font in a web page is, approximately, 12 points on my screen but the font in the UI is a bit largish, the bookmarks' bar is truncated and the tabs are a bit crowded.

Chromium developers made clear that changing the font of the UI is not something they're going to support, I see that it is possible to circumvent the problem on Windows, what can be done on Linux?

sudo must be owned by uid 0 and have the setuid bit set

Posted: 29 Oct 2021 08:30 AM PDT

I have changed my Ubuntu super password by recovery mode; after that, I can't run my sudo command in normal user .

I have attempted to crack my previous password in Recovery mode; I followed this link to crack my password.

$sudo ---In global mode throws me the below error:

sudo: /usr/local/bin/sudo must be owned by uid 0 and have the setuid bit set

$ ls -l sudo gives:

-r-sr-xr-x 1 root root 136808 May 29  2017 sudo  

/usr/local/bin$ ./sudo ---> I need this /usr/local/bin ./sudo isn't working -- it throws the below error:

sudo: ./sudo must be owned by uid 0 and have the setuid bit set

/usr/bin$ ./sudo --> working fine

usage: sudo -h | -K | -k | -V  

I need to access my sudo command from the terminal from anywhere.

Bash: Why is eval and shift used in a script that parses command line arguments?

Posted: 29 Oct 2021 08:33 AM PDT

As I was looking this answer https://stackoverflow.com/a/11065196/4706711 in order to figure out on how to use parameters like --something or -s some questions rised regarding the answer's script :

#!/bin/bash  TEMP=`getopt -o ab:c:: --long a-long,b-long:,c-long:: \       -n 'example.bash' -- "$@"`    if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi    # Note the quotes around `$TEMP': they are essential!  eval set -- "$TEMP"    while true ; do      case "$1" in          -a|--a-long) echo "Option a" ; shift ;;          -b|--b-long) echo "Option b, argument \`$2'" ; shift 2 ;;          -c|--c-long)               # c has an optional argument. As we are in quoted mode,              # an empty parameter will be generated if its optional              # argument is not found.              case "$2" in                  "") echo "Option c, no argument"; shift 2 ;;                  *)  echo "Option c, argument \`$2'" ; shift 2 ;;              esac ;;          --) shift ; break ;;          *) echo "Internal error!" ; exit 1 ;;      esac  done  echo "Remaining arguments:"  for arg do echo '--> '"\`$arg'" ; done  

First of all what does the shift program in the following line:

        -a|--a-long) echo "Option a" ; shift ;;  

Afterwards what is the purpose to use the eval command in the following line:

eval set -- "$TEMP"  

I tried to comment the line in script mentioned above and I got the following response:

$ ./getOptExample2.sh  -a 10 -b 20 --a-long 40 -charem --c-long=echi  Param: -a  Option a  Param: 10  Internal error!  

But if I uncomment it it runs like a charm:

Option a  Option b, argument `20'  Option a  Option c, argument `harem'  Option c, argument `echi'  Remaining arguments:  --> `10'  --> `40'  

How to add/remove an element to/from the array in bash?

Posted: 29 Oct 2021 09:01 AM PDT

I have an array containing some elements, but I want to push new items to the beginning of the array; How do I do that?

How can I change my tmux color scheme based on the time of day?

Posted: 29 Oct 2021 07:44 AM PDT

I just implemented a few lines into my .vimrc that changes the color scheme from SolarizedDark to SolarizedLight based on the time of day.

" Solarized light during the day, solarized dark during the night  let hour = strftime("%H")  if 6 <= hour && hour < 18    set background=light  else    set background=dark  endif  

Is it possible to do this for tmux and OS X terminal as well?

How to rip a scratched DVD-Video? (a "cdparanoia for DVDs")

Posted: 29 Oct 2021 07:52 AM PDT

I usually use the very nice and simple dvdbackup program to rip and backup my DVD-Video.

However some of my DVDs have a few scratches and my DVD drive has some trouble reading a few sectors. So, is there a tool similar to cdparanoia, but for DVDs?

No comments:

Post a Comment