Thursday, September 23, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to verify a 2MB huge page on a VM is mapped to a 2MB huge page in system/host physical memory?

Posted: 23 Sep 2021 09:50 AM PDT

I want to use 2MB huge pages on a VM guest to create contiguous 2MB huge pages in system/host physical memory.

I have a test program which mmap's 128MB with the MAP_HUGETLB and MAP_ANONYMOUS flags. I read /proc/PID/smaps to confirm 2MB pages are mapped. I also confirm that 64 huge pages are in use with /proc/meminfo.

In /proc/PID/smaps:
KernelPageSize: 2048 kB
MMUPageSize: 2048 kB
Private_Hugetlb: 131072 kB

In /proc/meminfo:
HugePages_Total: 4096
HugePages_Free: 4032
Hugepagesize: 2048 kB

I do the same thing on a guest and see that the guest is using 2MB pages in guest physical memory.

I want to confirm that the guest's 2MB pages are mapped to 2MB pages in host/system memory.

I have configured the guest to use huge pages in the XML file:

<memoryBacking>      <hugepages/>    </memoryBacking>  

I confirm that 4GB guest physical memory is mapped to 2MB huge pages in /proc/PID/smaps:

/dev/hugepages/libvirt/qemu/8-jwvm2/qemu_back_mem.pc.ram.rIJieT (deleted)
KernelPageSize: 2048 kB
MMUPageSize: 2048 kB
Private_Hugetlb: 4194304 kB

I think that would guarantee that the guest would get a real 2MB page in host/system memory, but I need a way to confirm that mmap() with MAP_HUGETLB on the guest really gets a contiguous 2MB page in system/host memory.

How can I verify that a 2MB huge page on the guest is mapped to a 2MB huge page on the host?

grep command with -rn not working properly

Posted: 23 Sep 2021 09:48 AM PDT

I am trying to find all the files in a directory structure which contain a specific word, but it is not working correctly.

For example: /Institute/IITDhanbad/ grep -rn "Programmer" * giving result as
BTECH/CompScience.txt:22: Sudip is a Programmer

whereas /Institute/IITDhanbad/MTECH/ grep -rn "Programmer" * giving result as
CSP/Boys/Good/Electronics.txt:13: Sourav is a Programmer

But, it was supposed to give Sourav is a Programmer as a result in /Institute/IITDhanbad/ folder alongwith Sudip is a Programmer , so what is going wrong and how to resolve this? any help please...

The ERR wrong number of arguments for 'hset' command

Posted: 23 Sep 2021 09:50 AM PDT

I am facing a problem on redis 3.0. When I use the command:

redis-cli -h 127.0.0.1 -p 6356 hset key_name id 1 value 2

It shows the following error: ERR wrong number of arguments for 'hset' command, I used it on redis 5.0 and it works fine, Can you give me an alternative to use on redis 3.0, I need it to be able to update if the key already exists or add a key from the command line

gpio_name_to_desc in gpiolib.c in Linux kernel should be externalized?

Posted: 23 Sep 2021 09:42 AM PDT

We have an embedded project, and for our purposes, it seems handy to name all the gpios in the gpio controller device tree stanza using gpio-line-names feature in device tree, mentioned in Documentation/devicetree/bindings/gpio/gpio.txt.

The main flaw in this is that the function gpio_name_to_desc() in source/drivers/gpio/gpiolib.c is not externalized for writing kernel drivers.

There seem to be very few examples of gpio-line-names in the kernel. For instance, arch/arm/boot/dts/ste-hrefv60plus.dtsi has a string HDTV_INTN, but is not used in kernel space anywhere else.

We have looked at the other feature, [-]gpios (and optionally an index), but would prefer the gpio-line-names feature as it is easier to read, and will probably patch our kernel, as it is trivial to externalize the gpio_name_to_desc() function.

Is this a dead or nearly dead feature?

#!/usr/bin/env hangs with NAME=VALUE

Posted: 23 Sep 2021 09:35 AM PDT

I'm trying to figure out exactly what the semantics of the shebang are.

I can write a script like this:

#!/usr/bin/env bash    if [ -z "$FOO" ]  then      echo "No FOO"  else      echo "$FOO"  fi  

without $FOO in my environment, and run it like ./foo.sh, bash foo.sh, env bash foo.sh, etc and it will print "No FOO" as expected.

I can of course run it like FOO=bar ./foo.sh and it will print bar.

The env man page gives the invocation as:

env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]  

And I can use it as such:

$ env FOO=bar bash foo.sh  bar  

However, if I try to use that syntax in a shebang:

#!/usr/bin/env FOO=bar bash    if [ -z "$FOO" ]  then      echo "No FOO"  else      echo "$FOO"  fi  

then ./foo.sh hangs indefinitely and does not execute.

Can someone explain this to me? I assumed that when a shebang is encountered, it just copies the command, appends the path to the script to the end of the argument list, and executes it, but this behavior suggests otherwise.

how to compile and run on different linux (debian) versions

Posted: 23 Sep 2021 09:40 AM PDT

compiled on debian 10 :

root@debian:/home/mongo# ldd /home/mongo/build/opt/mongo/db/mongod linux-vdso.so.1 (0x00007ffe9f1c0000) libcurl.so.4 => /lib/x86_64-linux-gnu/libcurl.so.4 (0x00007f1d7012d000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f1d70105000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f1d700eb0
... so it's dynamically compiled

the same executable on debian 9

ldd /usr/bin/mongod statically linked

and it segfaults

mongod[12662]: segfault at 8 ip 00007f25798fa821 sp 00007ffccda20090 error 4 in ld-2.24.so

what is this due to ? how to compile and run on different linux debian versions ?

VNC / Ubuntu 18.04 / xfce4: can't launch executables with a GUI

Posted: 23 Sep 2021 09:16 AM PDT

I'm using VNC remote desktop to visually access a remote Ubuntu 18.04 machine with a xfce4 GUI. VNC works fine. SSH shell works fine. The 2 programs with a graphic UI I'd like to launch are nedit (a visual editor, compiled) and Unity (a game dev IDE). They both have the +x permissions, which I can see in the shell.

Nedit permissions Unity permissions

In VNC, when I click "Properties", I don't see a "Run this as a program" option on either of them, just write/read.

VNC permissions

When I double click on an either "executable" in VNC's file manager, I get some odd message "Unable to set the xfce4 Display Settings" as if the "executables" were arguments for "Start with a Display".

enter image description here

When installing, I saw the Unity GUI in VNC briefly, so I know running Unity is technically possible.

The content of ~/.vnc/xstartup:

#!/bin/bash  xrdb $HOME/.Xresources  startxfce4 &  

Execute alias in whisker search bar

Posted: 23 Sep 2021 09:48 AM PDT

I created this alias in bash: alias .one='cd Learn/React/React\ JS/one_app/ && code . && exit' to open a project in VSCODE, but when i try to execute in whisker search bar using "!.one" i receive the error "Failed to execute child process". Any help?

*Linux mint 20.4

How to format text file from command line and print (font size and page size) using a2ps

Posted: 23 Sep 2021 08:57 AM PDT

I have a thermal printer (80mm Logic Controls LR2000E), connected via USB, to my Debian 11 machine. I want to use the printer to print a purchase order/quote, which I have in a text file. I need to be able to do this from the command line, as it is part of a script.

I installed the ppd file from the manufacturer's website (https://logiccontrols.com/product-drivers/).

This ppd only allows to specify one paper size by default. I changed it by hand to 80x300mm.

I can format (wordwrap etc) through awk and print the text file using

lp table.txt  

This respects the ppd's described paper size, and prints the list: printout from lp

But I would like to control the output more, use smaller font, add borders, etc., so I tried to use a2ps. In the a2ps.cfg file I added the page size that I need:

# 80mm for BEMATECH LR2000E (in postscript points)  #      NAME     W      H     LLX   LLY   URX    URY  Medium: T80    280    850    25    55    219    560  

But I don't know how to print my text through a2ps! I've been banging the keybourd for hours over several days, but don't know where to look for more information. It always prints the lower left-hand corner of the generated page instead of the whole thing: enter image description here

a2ps generates what looks like the right output if I save it using the -o table.ps option, but it doesn't fit the page. If I open the ps file in atril (PDF viewer) I can confirm that the text is in the file, wordwrapped and all, and the page size is partly correct (80x353mm), but I can't print it any way.

The a2ps info page has a great deal about prettyprint, but not very much about paper sizes.

So:

  1. Should I use another method? or if a2ps is the way to go:
  2. Why does the output ps file grow 53mm? and
  3. Why can't I print the whole ps file in stead of just the tail of it?

awk output not in columns when moved to log

Posted: 23 Sep 2021 08:19 AM PDT

I have an awk command piped to the output of another command | awk {'print $2,$3'}. When I run this command the output displays the data in columns, of the columns as I would expect

column2 column3  a       a  b       b  c       c  

no problems there, but when I add this output to a script and sent it to >> $log the data is not formatted in columns... just normal line text

column 2 output, column 3 output, column 4 output...etc.

This isn't really a problem but would be easier to deal with down the road in the column format. what do I need to change in the script log output to format it in columns?

Here is the command as it is in the script

d=$(COMMAND| awk {'print $2,$3'})  

Then sent to the log here

echo $d >> $log  

Raspberry pi OS can't load lightdm

Posted: 23 Sep 2021 07:03 AM PDT

Running the Pi using physical monitor works fine. But without HDMI connection, The NoMachine couldn't find any display running. Trying start lightdm using service lighdm start via ssh didn't works, as well systemctl . I got the next error:

● lightdm.service - Light Display Manager     Loaded: loaded (/lib/systemd/system/lightdm.service; indirect; vendor preset: enabled)     Active: failed (Result: exit-code) since Thu 2021-09-23 16:55:28 IDT; 8s ago       Docs: man:lightdm(1)    Process: 1702 ExecStartPre=/bin/sh -c [ "$(cat /etc/X11/default-display-manager 2>/dev/null)" = "/usr/sbin/lightdm" ] (code=exited, status=0/SUCCESS)    Process: 1704 ExecStart=/usr/sbin/lightdm (code=exited, status=1/FAILURE)   Main PID: 1704 (code=exited, status=1/FAILURE)    Sep 23 16:55:28 raspberrypi systemd[1]: lightdm.service: Service RestartSec=100ms expired, scheduling restart.  Sep 23 16:55:28 raspberrypi systemd[1]: lightdm.service: Scheduled restart job, restart counter is at 5.  Sep 23 16:55:28 raspberrypi systemd[1]: Stopped Light Display Manager.  Sep 23 16:55:28 raspberrypi systemd[1]: lightdm.service: Start request repeated too quickly.  Sep 23 16:55:28 raspberrypi systemd[1]: lightdm.service: Failed with result 'exit-code'.  Sep 23 16:55:28 raspberrypi systemd[1]: Failed to start Light Display Manager.  Sep 23 16:55:28 raspberrypi systemd[1]: lightdm.service: Triggering OnFailure= dependencies.  

How to disable the default gdm login screen

Posted: 23 Sep 2021 07:02 AM PDT

I'd like my Debian 10 box with vanilla GNOME to prompt for login at a tty/text terminal instead of having the gdm GUI pop up by default. Is there a way to change some config such that it works like this, and then the GNOME interface can be started manually with e.g. startx?

Terminal emulator that looks like TTY?

Posted: 23 Sep 2021 07:43 AM PDT

Is there a graphical terminal emulator that looks like the tty screen just before the login?

I pretty much like the way the tty looks: the font, the high-contrast colors, and the small padding between text and the screen itself.

For example, there is little to no padding between the command bar in Vim on tty. However, on alacritty/st/and other terminal emulators there is large, inconvenient gaps between the command bar and the bottom of the terminal, as well as large padding on top and on both sides. The same thing for other TUI programs, such as neomutt and newsboat.

If there were a terminal emulator that looks near exactly like tty that would be awesome. Does anyone know of such program? If not, is it possible to eliminate weird padding of those popular terminal emulators I just mentioned?

matchbox-keyboard grabs the upper half of the screen

Posted: 23 Sep 2021 08:32 AM PDT

When I run matchbox-keyboard, all maximized windows become resized to occupy only the lower half of the screen, while custom-sized windows stay intact. In the screenshot below, Chromium got resized, but not the terminal:

enter image description here

When I close the on-screen keyboard, the maximized windows get back to their almost-fullscreen size.

I also installed matchbox-keyboard on a vanilla Debian x86, where it behaves even weirder: maximized apps are still restricted to the lower part of the screen, but the keyboard also takes the lower part, leaving the upper part of the screen empty:

enter image description here

How exactly is this feature implemented, and is it configurable? Is it possible to start a different application (e.g. leafpad) in this mode, or run matchbox-keyboard so that it would occupy the lower part of the screen and let the maximized apps take the upper part?

How to transliterate characters with a wildcard?

Posted: 23 Sep 2021 09:34 AM PDT

I have a file called file.txt containing:

MAL TIRRUEZF CR MAL RKZYIOL EX MAL OIY UAE RICF "MAL ACWALRM DYEUPLFWL CR ME DYEU MAIM UL IZL RKZZEKYFLF GH OHRMLZH"  

I'd like the characters replaced as follows:

M = T  A = H  L = E  C = O  R = F  E = I  X = S  (Any other letter) = _  (Anything else) = (itself)  

I have the fixed characters covered with:

tr MALCREX THEOFIS < file.txt

or:

sed 'y/MALCREX/THEOFIS/' < file.txt

But how could I enforce the last 2 rules I mentioned?

Suggestions for a lightweight linux distro for purpose of coding? [closed]

Posted: 23 Sep 2021 07:10 AM PDT

I need a lightweight distro for my Acer aspire e3-112m Intel(R) Celeron(R) CPU N2840 @2.16GHz.

  • The PC will be used only to learn code (so everything else can be removed). I will be starting with C++ and HTML.
  • I have some experience with Linux, as I've been using it for 1.5 years as my primary OS on other laptop.

Cannot explain size of screenshot PNG file

Posted: 23 Sep 2021 07:06 AM PDT

I am running ubuntu 64-bit on a virtual machine and took a screenshot of a part of my desktop using the shortcut Shift+Print. The .png file consists of 1500x1078 pixels and has a total size of 30,1 kB.

To get a better understanding, I asked myself how to arrive at 30,1 kB?

Adopting a sloppy calculation, (1500*1078*bit_depth/(8*1024)), gives approximately 197 kB, assuming a bit_depth of 1, which is probably much higher such that the size is even larger and quite far away from 30,1 kB.

I have to admit that I am a newbie in this topic and there is an easy explanation for my question. Any input is appreciated!

VM: Error Starting Domain: USB Device Not Found

Posted: 23 Sep 2021 07:09 AM PDT

I have a working VM that will not load unexpectedly. Using virt-manager in CentOS7

Error is

Error Starting Domain: internal error: Did not find USB device 05ac:12a8  

I see USB device 05ac:12a8 in the QEMU GUI.

I do not know what USB device this would be on the server since this is virtualization.

VMerror

Here are the details of the error:

Error starting domain: internal error: Did not find USB device 05ac:12a8    Traceback (most recent call last):    File "/usr/share/virt-manager/virtManager/asyncjob.py", line 89, in cb_wrapper      callback(asyncjob, *args, **kwargs)    File "/usr/share/virt-manager/virtManager/asyncjob.py", line 125, in tmpcb      callback(*args, **kwargs)    File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 82, in newfn      ret = fn(self, *args, **kwargs)    File "/usr/share/virt-manager/virtManager/domain.py", line 1506, in startup      self._backend.create()    File "/usr/lib64/python2.7/site-packages/libvirt.py", line 1080, in create      if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)  libvirtError: internal error: Did not find USB device 05ac:12a8  

libvirtd status also confirms the device isn't found:

[orca@orcacomputers ~]$ systemctl status libvirtd -l  ● libvirtd.service - Virtualization daemon     Loaded: loaded (/usr/lib/systemd/system/libvirtd.service; enabled; vendor preset: enabled)     Active: active (running) since Wed 2021-09-22 15:44:22 PDT; 12min ago       Docs: man:libvirtd(8)             https://libvirt.org   Main PID: 2419 (libvirtd)      Tasks: 17 (limit: 32768)     Memory: 23.4M     CGroup: /system.slice/libvirtd.service             └─2419 /usr/sbin/libvirtd    Sep 22 15:44:23 orcacomputers libvirtd[2419]: 2021-09-22 22:44:23.269+0000: 2523: error : storageDriverAutostartCallback:209 : internal error: Failed to autostart storage pool 'CentOS': cannot open directory '/mnt/raid5/VM/CentOS': No such file or directory  Sep 22 15:44:23 orcacomputers libvirtd[2419]: 2021-09-22 22:44:23.295+0000: 2523: error : virUSBDeviceFindByVendor:229 : internal error: Did not find USB device 05ac:12a8  Sep 22 15:44:23 orcacomputers libvirtd[2419]: 2021-09-22 22:44:23.386+0000: 2523: warning : virHostdevReAttachUSBDevices:1922 : Unable to find device 000.000 in list of active USB devices  Sep 22 15:44:23 orcacomputers libvirtd[2419]: 2021-09-22 22:44:23.386+0000: 2523: warning : virHostdevReAttachUSBDevices:1922 : Unable to find device 000.000 in list of active USB devices  Sep 22 15:44:23 orcacomputers libvirtd[2419]: 2021-09-22 22:44:23.386+0000: 2523: warning : virHostdevReAttachUSBDevices:1922 : Unable to find device 000.000 in list of active USB devices  Sep 22 15:44:23 orcacomputers libvirtd[2419]: 2021-09-22 22:44:23.386+0000: 2523: error : qemuAutostartDomain:258 : internal error: Failed to autostart VM 'Debian': internal error: Did not find USB device 05ac:12a8  Sep 22 15:45:18 orcacomputers libvirtd[2419]: 2021-09-22 22:45:18.706+0000: 2473: error : virUSBDeviceFindByVendor:229 : internal error: Did not find USB device 05ac:12a8  Sep 22 15:45:18 orcacomputers libvirtd[2419]: 2021-09-22 22:45:18.706+0000: 2473: warning : virHostdevReAttachUSBDevices:1922 : Unable to find device 000.000 in list of active USB devices  Sep 22 15:45:18 orcacomputers libvirtd[2419]: 2021-09-22 22:45:18.706+0000: 2473: warning : virHostdevReAttachUSBDevices:1922 : Unable to find device 000.000 in list of active USB devices  Sep 22 15:45:18 orcacomputers libvirtd[2419]: 2021-09-22 22:45:18.706+0000: 2473: warning : virHostdevReAttachUSBDevices:1922 : Unable to find device 000.000 in list of active USB devices  

Using Rsync to move then sync lots of data one way

Posted: 23 Sep 2021 09:37 AM PDT

EDIT: Based on the two indepth answers I gave it a whirl:

rsync --progress -v -az -e "ssh" /archive/images/dcam/ root@10.x.x.xxx:/data/archive/images/dcam --dry-run  

So --progress to see the results -v to make it verbose? -az to archive it (thus getting time stamps) and z to compress it to save network traffic. -e to login via ssh, of which the machine 10.x.x.xxx does have the sources ssh key in authorized key. Alas I got this error:

rsync: Failed to exec \#342\#200\#234ssh\#342\#200\#235: No such file or directory (2)  rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.6]  rsync: connection unexpectedly closed (0 bytes received so far) [sender]  rsync error: error in IPC code (code 14) at io.c(600) [sender=3.0.6]  

Which is strange since remote machine has a /data/archive/images/dcam with data in it already.

I must not understand fully how rsync works. I have two servers...one has a crap ton of data I want to move to another. So...I NFS mounted the folder onto Server A from Server B (where the backup of sorts lives).

Then because this is an important live server, I was nervous to just let RSYNC run on 2TB of data... I ran by hand like this: (inside the /archive/images folder) rsync -r imageDateXX/ /mnt/backup/archive/images/imageDateXX and repeated this for 2TB of folders and data. I finally got it working. So then I was happy I didn't bring the server to the knees and then this data updates throughout the night. So to keep server B with the latest data I set up a cronjob:

0 8 * * * rsync -r /archive/images/ /mnt/backup/archive/images  

This kicks off (I assume) but takes like 2 days to complete still. It looks like itis not just seeing what was new/or changed on server A and putting just that to server B but putting all the files back to server B again overwriting. I am not sure how to test this theory but it takes so long. Am I missing a switch in rsync or does my running rsync folder by folder make me then running rsync on the parent folder look 'different' to rsync where as it thinks its all new data and copies everything even if its to the same exact spot on Server b?

Not sure how to test this theory or be sure. Thought it was straight forward and rsync automagically just writes over the file or copies the file if it doesn't exists on serverB or has changed on Server A.

How can I start a cpp bin at every reboot?

Posted: 23 Sep 2021 08:19 AM PDT

I am beginner in LINUX operating system and my question is the next one:

I have a compiled bin from a C++ source code that uses OpenCV and another libs and it displays on the screen the images provided from a USB camera. My code works fine, the next step is to execute this bin file every time when my board have been powered on. I made some research and I found out the reliable method that can help me is to create my own service that can be enabled using systemctl. I tried it but without success but I'm not sure if my service file has been configured properly. Also, I tried with Startup Applications, again it failed. PS: my board: Nvidia Jetson Tx2, my OS: Ubuntu 18.04 LTS.

I am waiting for any advice and appreciate your effort to respond. Thank you!

Edit: My service file configuration:

[Unit]  Description=Script that will execute my bin  [Service]  ExecStart=/home/nvidia/Desktop/daemonScripts/daemonVDM.sh start  [Install]  WantedBy=multi-user.target  

The daemonVDM.sh

#!usr/bin/bash  path_vdm_bin="/home/nvidia/Desktop/running"  cd $path_vdm_bin  ./vdm --camera-sources 1  

Output systemctl status myscript

myscript.service: Main process exited, code=exited, status=203/EXEC  myscript.service: Failed with result 'exit-code'  

My shell daemonVDM.sh works fine

I executed the next commands:

sudo chmod 777 myscript.service  systemctl start myscript  systemctl enable myscript  

Why my Intel 256GB SSD disk is being detected as 32kB?

Posted: 23 Sep 2021 09:19 AM PDT

I have 256GB Intel SSD 2500 Pro series disk. It worked great on Linux Ubuntu. Now it stopped to work. Now it is detected as follows:

[69214.467957] scsi 6:0:0:0: Direct-Access     SandForc e{200026BB}           PQ: 0 ANSI: 5  [69214.468294] sd 6:0:0:0: Attached scsi generic sg3 type 0  [69214.468486] sd 6:0:0:0: [sdc] 64 512-byte logical blocks: (32.8 kB/32.0 KiB)  [69214.468746] sd 6:0:0:0: [sdc] Write Protect is off  [69214.468748] sd 6:0:0:0: [sdc] Mode Sense: 28 00 00 00  [69214.469020] sd 6:0:0:0: [sdc] No Caching mode page found  [69214.469026] sd 6:0:0:0: [sdc] Assuming drive cache: write through                                                                     [69214.537252] sd 6:0:0:0: [sdc] Attached SCSI disk  

Is it a disk or firmware failure ? Should I try to update the disk firmware ?

Update 1: I tried to update firmware by using Intel Firmware Update Tool but the tool does not recognize the disk (in this state) as an Intel SSD.

How to remove lines that have same id string

Posted: 23 Sep 2021 08:57 AM PDT

I have the following file (note that the ======== are actually present in the file):

start ======== id: 5713  start ======== id: 5911  start ======== id: 5911  end ========= id: 5911  start ======== id: 6111  end ========= id: 5713  start ======== id: 31117  

I want to remove any two lines that have the same id and have respectively start and end in them.

Based on the above example, the output will be:

start ======== id: 5911  start ======== id: 6111  start ======== id: 31117  

How to do this with bash, awk, sed ... ?

How could I find out what my desktop environment or window manager is from a command line command?

Posted: 23 Sep 2021 09:08 AM PDT

Is there a command line command to see which DE or WM you are currently using?

What is the meaning of 'efibootmgr -v' after EFI file path

Posted: 23 Sep 2021 07:58 AM PDT

When I run efibootmgr to list all my boot options, this is the output:

$ efibootmgr  BootCurrent: 0003  Timeout: 1 seconds  BootOrder: 0000,0002,0003,0001  Boot0000* (my linux distro grub boot)  Boot0001* file  Boot0002* Windows Boot Manager  Boot0003* (my linux distro systemd-boot)  

And when I want to see more detailed output, I get this:

$ efibootmgr -v  BootCurrent: 0003  Timeout: 1 seconds  BootOrder: 0000,0002,0003,0001  Boot0000* (my linux distro grub boot)       HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXXXXXX,0x800,0x82000)/File(\EFI\DISTRONAME-GRUB\GRUBX64.EFI)  Boot0001* file  VenHw(99e2XXXX-75XX-4bXX-a2XX-c538XXXXXXXX)  Boot0002* Windows Boot Manager  HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXXXXXX,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.X.X.X.X.-.5.c.X.X.-.4.e.X.X.-.a.c.X.X.-.f.3.2.b.X.X.X.X.X.X.X.X.}....................  Boot0003* (my linux distro systemd-boot)    HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXX,0x800,0x82000)/File(\EFI\DISTRONAME-SYSTEMDBOOT\systemd-bootx64.efi)  

Based on my reasoning and quick search in man pages (https://linux.die.net/man/8/efibootmgr), the format of the output is: BootNNNNA NAME WHATTOBOOT where:

NNNN = boot number (0000 until maybe 9999)  A = * if active, no asterisk if not active  NAME = string label that will be shown on vendor/motherboard BIOS (UEFI)  WHATTOBOOT = can be    - HD({NUMBER},{GPT/MBR},{UUID-from-blkid-PARTUUID})/File({\PATH\TO\EFI})    - PXE ((I have no such boot option in this PC))  

Now what I'm curious is about the meaning of efibootmgr -v output for Windows boot manager that shows as: Boot0002* Windows Boot Manager HD(1,GPT,3e1eXXXX-f3XX-40XX-b1XX-569aXXXXXXXX,0x800,0x82000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.X.X.X.X.-.5.c.X.X.-.4.e.X.X.-.a.c.X.X.-.f.3.2.b.X.X.X.X.X.X.X.X.}....................

  • Based on it's PARTUUID, it's located on my EFI partition (same with my other boot options)
  • Then it's EFI file is at \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
  • Then lastly, there's a string (or maybe binary) following: WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.X.X.X.X.-.5.c.X.X.-.4.e.X.X.-.a.c.X.X.-.f.3.2.b.X.X.X.X.X.X.X.X.}....................

What I'm asking is: what does this string mean? It seems like UUID if I remove all dot (.) characters between (which will make it into xBCOBJECT=9deaXXXX-5cXX-4eXX-acXX-f32bXXXXXXXX

I'm also curious about what is the second boot option mean: Boot0001* file or the verbose version Boot0001* file VenHw(99e2XXXX-75XX-4bXX-a2XX-c538XXXXXXXX)

  • I suspect it's a boot from flash drive / thumb drive that I forgot to delete a few years ago, is this correct? Or is it something else?

Additional information:

Version:

$ efibootmgr --version  version 17  

My setup: Windows+linux dual boot, on linux I installed these boot managers: grub and systemd-boot

How can I add the marked track to a playlist in cmus?

Posted: 23 Sep 2021 07:56 AM PDT

I'd like to quickly add the currently marked track (in view 1, 2 or 4) to my playlist of favorites with a key-bindable command in cmus.

The man page doesn't reveal a winning strategy. How to do it?

:add -p <path> only seems to accept paths as arguments, and it works on the currently marked playlist.

connection refused (os error 111) using python selenium & geckodriver

Posted: 23 Sep 2021 08:57 AM PDT

i am quit new to webscraping, i am building a personal app with python on debian buster and firefox geckodriver as follow, the server is online

firefox_binary = FirefoxBinary('/usr/bin/firefox')  opts = FirefoxOptions()  opts.add_argument("--headless")  driver = webdriver.Firefox(options=opts, firefox_binary=firefox_binary)  driver.get(url)  

i aim to triggered this app by a ajax call in a web page, it's a nginx server so the py script is called in a php exec command :

exec ('/usr/bin/python3 webdriver.py');  

it works fine in command line in debian if i am logged in root or another user. when i call the script using web interface, the user is www-data and i encounter this error : connection refused (os error 111)

i ve been searching for 3 days in all internet sources i can find and tried all i could, i haven't any solution for now

would you have any idea of the way to solve this issue?

Edit :

  • selenium version 3.141.0

  • Mozilla Firefox 78.8.0esr

  • geckodriver 0.29

  • geckodriver.log for www-data user (with error):

    • 1614703595351 geckodriver INFO Listening on 127.0.0.1:53899
    • 1614703595556 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "--headless" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile22XajP"
    • *** You are running in headless mode.
  • geckodriver.log for for admin (without error) :

    • 1614702846828 geckodriver INFO Listening on 127.0.0.1:46897
    • 1614702847019 mozrunner::runner INFO Running command: "/usr/bin/firefox" "--marionette" "--headless" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile7jTA4y"
    • *** You are running in headless mode.
    • 1614702859057 Marionette INFO Listening on port 45145
    • 1614702859109 Marionette WARN TLS certificate errors will be ignored for this session
    • JavaScript warning: https://..........................js?v=1.2.7199.0, line 119: unreachable code after return statement
    • JavaScript warning: https://..........................js?v=1.2.7199.0, line 119: unreachable code after return statement
    • 1614702872140 Marionette WARN TimedPromise timed out after 500 ms: stacktrace:
    • TimedPromise/<@chrome://marionette/content/sync.js:245:13
    • TimedPromise@chrome://marionette/content/sync.js:230:10
    • Interaction.flushEventLoop@chrome://marionette/content/interaction.js:416:10 webdriverClickElement@chrome://marionette/content/interaction.js:182:31
    • 1614702900530 Marionette INFO Stopped listening on port 45145
  • geckodriver.log for www-data with geckodriver 0.21 :

    • 1614706982655 geckodriver INFO geckodriver 0.21.0

    • 1614706982680 geckodriver INFO Listening on 127.0.0.1:33947

    • 1614706983553 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "--headless" "-foreground" "-no-remote" "-profile" "/tmp/rust_mozprofile.p37a7r0syAmR"

    • *** You are running in headless mode.

    • (firefox-esr:22409): dconf-CRITICAL **: 17:44:03.845: unable to create directory '/var/www/.cache/dconf': Permission denied. dconf will not work properly.

Video card driver problem in Debian (AMD Radeon R5 M330)

Posted: 23 Sep 2021 07:05 AM PDT

I am new to Linux. I am using Debian 8. I tried to play some games, but it seems that they are using my integrated Intel video card instead of discrete AMD Radeon: Star Conflict doesn't even show the space - everything is completely black (I can only see ship's interface components). Games with much less requirements can produce the image but they are running very slow even on low graphics settings. On the same laptop on Windows side I can play Bioshock Infinite on high settings very well. So, it seems to be linux driver's fault. I have some program called "ATI Catalyst Control Center Linux edition" in my gnome menu and when I try to run it, I get this message:

There was a problem initializing Catalyst Control Center Linux edition.  It could be caused by the following.    No AMD graphics driver is installed, or the AMD driver is not functioning properly.  Please install the AMD driver appropriate for you AMD hardware, or configure using aticonfig  

I tried installing AMD proprietary driver, but it fails to install. So, I'd like to use open-source driver, it doesn't really matter, I just want to get my graphics card working. Output of lspci | grep 'AMD' :

0d:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M] (rev ff)  

I am also curios why it says "Display controller" instead of "VGA compatible controller" like it says about Intel's integrated card.

So, the final question is: What software/driver should I install or how should I configure my system to get my discrete card working? I am sorry if I gave not enough info - I just don't know what information is needed here. I would like to provide any info you ask.

xargs and line-by-line pipe

Posted: 23 Sep 2021 08:27 AM PDT

I have 3 files: a.txt, b.txt and c.txt. I want to create 3 files: a.test, b.test and c.test containing the simple text abracadabra.

Basicaly, the point is to create the .test files for each .txt file, and fill them with some text. I am trying to use xargs to do this.

anlx2626> ls  a.txt  b.txt  c.txt    anlx2626> ls *.txt | awk -F'.txt' '{print $1}' | xargs -I {} echo "abracadabra" > {}.test    anlx2626> ls *.test  ls: No match.  

Could someone point out why using the {} placeholder for line-by-line pipe doesn't work the way I expect it to?

Arch Linux - make: error while loading shared libraries: libunistring

Posted: 23 Sep 2021 08:08 AM PDT

I keep getting this same error when trying to install various packages:

make: error while loading shared libraries: libunistring.so.0:  cannot open shared object file: No such file or directory  

It's occurred while trying to install the Ruby gem Gosu as well as some free Linux games like Alien Arena. I even tried re-installing libunistring with pacman to no avail.

No comments:

Post a Comment