Saturday, April 16, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Extracting date from a string

Posted: 16 Apr 2022 06:49 AM PDT

I am trying to extracting date from a string but it is not obtaining.

Code

str= grep -E '[0-9]-[0-9]-[0-9]' datefile  echo $str  

Output

Empty   

File format:

created_at:          YYYY-MM-DDTHH:MM:SS  

Desired output:

YYYY-MM-DD  

linux-tools-common when on a newer kernel version

Posted: 16 Apr 2022 06:10 AM PDT

I'm currently running kernel 5.16.15-051615-generic - I've landed on it while diagnosing and trying to fix an audio issue. Everything works great now so I'm reluctant to go back to 5.4.0

I'd like to install and use perf, but the linux-tools-common package in apt shows version 5.4.0-107.121.

I've read that you need to use a version of the package compiled for your kernel version, and haven't found anything for 5.16. I guess that's to be expected - but how can I get a version for my kernel? Is there some in-development unofficial repository that has them? Or am I out of luck?

If it helps, I used Ubuntu Mainline Kernel Installer to install the new kernel.

Wifi interface doesn't load when loading iwlmvm before iwlwifi

Posted: 16 Apr 2022 05:26 AM PDT

I'm using a fresh Arch installation with KDE plamsa and NetworkManager. Sometimes when rebooting the wifi0 interface doesn't load. I found a temporary fix for this issue:

modprobe -r iwlmvm  modprobe iwlwifi  

Unfortunately this isn't really persistent. Because when after some reboots wifi0 still doesn't show up again.

To understand what is going on here I tried

modprobe -r iwlmvm  modprobe -r iwlwifi  modprobe iwlmvm  modprobe iwlwifi  

and with this configuration my wifi didn't work too. So I assume that sometimes iwlmvm gets loaded before iwlwifi. So I blacklisted it in a modprobe config (I didn't have any issues since but I haven't yet tested it thoroughly).

My question now is: Why doesn't wifi work when loading iwlmvm before iwlwifi? I would like to understand the underlying issue here.

My network controller: Intel Corporation Wireless 8265 / 8275 (rev 78)

Reading from stdin `dd` copies more data than reading the same thing from file

Posted: 16 Apr 2022 05:28 AM PDT

I encountered weird behaviour of the dd tool:

  1. I downloaded compressed "newsystem.iso.xz".
  2. I ran xz -d --stdout newsystem.iso.xz | dd of=/dev/sdb bs=1M conv=sync.
  3. The decompressed "*.iso" file weights about 4.5GB. I expect this to fit on the usb. Instead dd fails with "Not enough space" error, saying that it wrote 8.1GB (the usb is about 8GB)

But then I downloaded the already decompressed "*.iso" and ran:

  1. dd if=newsystem.iso of=/dev/sdb bs=1M conv=sync
  2. Command succeeds after writing the expected 4.5GB.

I can verify that xz -d --stdout newsystem.iso.xz | shash512sum is the same as shash512sum newsystem.iso.

The sync option means

sync pad every input block with NULs to ibs-size

The dd version is "GNU coreutils 9.0" and the iso image is "FreeBSD-13.0-RELEASE-amd64-dvd1.iso".

Thanks in advance!

How to reset this command `xset r rate 300 50`?

Posted: 16 Apr 2022 05:15 AM PDT

The title says it all.

Machine: Debian 11
Terminal: kitty

Pop OS: How to switch to previous workspace?

Posted: 16 Apr 2022 04:20 AM PDT

I want a keyboard shortcut for switching back and forth between (at least) the last two workspaces I visited.

Something similar to how ALT+TAB switches between the previously-focused windows.

Can this be done somehow in Pop OS 20 or 21?

Shell script refer to another directory when building Dockerfile

Posted: 16 Apr 2022 04:07 AM PDT

I am using MacOS.

My project directory structure is like this:

myapp/    app.js    Dockerfile    subapp/        Dockerfile    script/       - myshell.sh  

In myshell.sh , I write shell script to build the Dockerfile located under subapp/ directory:

#!/usr/bin/env bash  docker build -t myreg/my-sub-app:1.0 -f ../subapp/Dockerfile .  

In my terminal, under project root myapp/ I run my shell script:sh script/myshell.sh

I get docker error:

failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount330496679/Dockerfile: no such file or directory  

I see it is a context related issue. could someone please elaborate for me what is the cause of the error & what is the right way in shell script to refer to another directory like this case?

Finding default process scheduler

Posted: 16 Apr 2022 02:40 AM PDT

Where in the Linux code, I can find the default process scheduler at the time of launching a process. For a running process, chrt shows SCHED_OTHER. On the hand, in various websites, I see that the default scheduler is CFS. So, are these the same? I know SCHED_OTHER and SCHED_NORMAL are equal, but not sure about CFS.

Any thoughts on that?

Smooth movement for one mouse but not the other

Posted: 16 Apr 2022 05:21 AM PDT

I'm using Bloody P91s Gaming Mouse my device and it isn't smooth on my Debian OS. It's displaying difference in acceleration on various axis. For example, if I move my mouse left-right over x-axis, the pointer proceeds to go down on y-axis. Also, it feels slower to move mouse pointer up whilst way much faster when I'm moving down.

So I got myself a A4Tech OP-730D for testing and found out that the later one operates smoothly on any OS. I've tested on Debian, Ubuntu, Kali and PopOS - all have same results.

However, It may be noted both mouse shows satisfactory performance over Windows and even on Linux VMs hosted on Windows.

I've tried to find proper driver for the P91s for Linux over the internet but only found Windows executables. So I was hoping for a solution, may be any open source driver that works well for a gaming mouse like P91s on Linux.

Is there a with context or function decorator in bash?

Posted: 16 Apr 2022 04:20 AM PDT

I use several small bash utility functions, which all start with "set -ux" and end with "set +xu". How can I avoid such repetition?

In python, I'd use a function decorator or with-context, but I don't yet have a good idea for bash.

How to control webcam's exposure time (using V4L2) based on the certain pixel's value?

Posted: 16 Apr 2022 01:09 AM PDT

I'd like to control the exposure time such that certain average value of certain window (e.g. 10x10+230+70) always fall between 100 to 220.

/p.s. Camera is monochrome/

Something like following:

loop      if average value > 220:          v4l2: lower the exposure      else if average value > 100:          v4l2: higher the exposure      else if 100 < average value < 220:          break the loop  

I can do this with Python with OpenCV. I'm looking for another solutions

Is there any solutions with ffmpeg, or imagemagick?

get all the files to be compiled from .config file

Posted: 16 Apr 2022 01:04 AM PDT

I have an old kernel and I didn't manage to get the toolchain to cross compile it. So I decided to upgrade this version of the kernel. My question is how can I know all the files(source, blobs and probably scripts ) that will be integrated in the final kernel image bzImage ?

Can I deduce this from .config/Makefiles ?

In a Bash script, not able to use while and for loop together. Getting unexpected end of file error

Posted: 16 Apr 2022 04:27 AM PDT

#!/bin/bash  while read -r col1 col2 col3 col4 col5 col6 col7 col8 col9  for i in 8.00 7.50 7.00 6.50 6.00 5.50 5.00 ;  do  echo '6.0' $i $col6 >> 1.dat   done < "sih1.66"  

getting error - syntax error: unexpected end of file

remove everything before a character in a column

Posted: 16 Apr 2022 05:59 AM PDT

I have a table like this

start end chr    1   10  H300Chr01    10  50  H500Chr02  

I would like to replace everything before Chr con column 3

My desired output would be

start end chr    1   10  Chr01    10  50  Chr02  

I know that sed can do things like this:

sed 's/^.*Chr/Chr/' table.txt  

Could you please tell me how I could achieve this for a specific column or a couple of columns?

Motion doesn't detected my webcam : UNABLE TO OPEN VIDEO DEVICE

Posted: 16 Apr 2022 04:05 AM PDT

I would use a USB webcam with Motion software, installed in Ubuntu on my Windows PC (WSL2 ) But when I started Motion as a service and i check on browser at the address [LOCALHOLST:port 8080 or 8081 ] it appears the Motion interface but never has been detected my webcam. Always It is showed a gray screen, for the MyCam1 option, with written at the top on the left "UNABLE TO OPEN VIDEO DEVICE".

I tried many types of configurations in the camera1-dist.conf and motion.conf files, but unfortunately they still doesn't work

Someone who could suggest me what type of configurations and in wich file, do I have to use to detected a USB webcam with Motion software ?

Thank you in advance.

Hi, i attached only the end of the output, after the sudo dmseg command :

[ 4.426329] hv_pci e4b1fa33-c88f-4255-a486-270c24fb24e9: PCI VMBus probing: Using version 0x10002

[ 4.481630] hv_pci e4b1fa33-c88f-4255-a486-270c24fb24e9: PCI host bridge to bus c88f:00

[ 4.481633] pci_bus c88f:00: root bus resource [mem 0xbffe08000-0xbffe0afff window]

[ 4.482359] pci c88f:00:00.0: [1af4:1049] type 00 class 0x010000

[ 4.485356] pci c88f:00:00.0: reg 0x10: [mem 0xbffe08000-0xbffe08fff 64bit]

[ 4.486844] pci c88f:00:00.0: reg 0x18: [mem 0xbffe09000-0xbffe09fff 64bit]

[ 4.488159] pci c88f:00:00.0: reg 0x20: [mem 0xbffe0a000-0xbffe0afff 64bit]

[ 4.495400] pci c88f:00:00.0: BAR 0: assigned [mem 0xbffe08000-0xbffe08fff 64bit]

[ 4.496019] pci c88f:00:00.0: BAR 2: assigned [mem 0xbffe09000-0xbffe09fff 64bit]

[ 4.496607] pci c88f:00:00.0: BAR 4: assigned [mem 0xbffe0a000-0xbffe0afff 64bit]

[ 4.519444] hv_pci 40b88200-f631-41d0-9e50-24f0a19b3b28: PCI VMBus probing: Using version 0x10002

[ 4.571731] hv_pci 40b88200-f631-41d0-9e50-24f0a19b3b28: PCI host bridge to bus f631:00

[ 4.571734] pci_bus f631:00: root bus resource [mem 0xbffe0c000-0xbffe0efff window]

[ 4.572901] pci f631:00:00.0: [1af4:1049] type 00 class 0x010000

[ 4.575904] pci f631:00:00.0: reg 0x10: [mem 0xbffe0c000-0xbffe0cfff 64bit]

[ 4.577026] pci f631:00:00.0: reg 0x18: [mem 0xbffe0d000-0xbffe0dfff 64bit]

[ 4.578131] pci f631:00:00.0: reg 0x20: [mem 0xbffe0e000-0xbffe0efff 64bit]

[ 4.584268] pci f631:00:00.0: BAR 0: assigned [mem 0xbffe0c000-0xbffe0cfff 64bit]

[ 4.584855] pci f631:00:00.0: BAR 2: assigned [mem 0xbffe0d000-0xbffe0dfff 64bit]

[ 4.585421] pci f631:00:00.0: BAR 4: assigned [mem 0xbffe0e000-0xbffe0efff 64bit]

Counting file extensions in a string array

Posted: 16 Apr 2022 02:03 AM PDT

I have a $FILES array which consists of strings of 4 filenames:

FILES=$(ls /my/directory | shuf -n 4)  

The contents of the array look something like: file1.jpg file2.jpg file3.gif file4.mp4

I want to count how many of each file types there are. Currently I am doing this:

nrofimg=$( grep -o .jpg <<< ${FILES[*]} | wc -l )  nrofgif=$( grep -o .gif <<< ${FILES[*]} | wc -l )  

but this is not optimal, because if a file is called file.jpgfile.jpg, it will count it twice. What is a better error-proof precise way of counting how many of each file extensions there are in the array?

EDIT: This seems to work:

nrofjpg=$( grep -c '\.jpg$' <<< ${FILES[*]} )  

the grep -c and '\.jpg$' seems to do what I want...

EDIT 2: Later in the code I am checking file extensions in a loop with a if statement, and files with spaces are seen as 2 files. This is not good, the double quotes around $f do not help.

for f in $FILES; do      if [[ "$f" == *.jpg || "$f" == *.png || "$f" == *.jpeg || "$f" ==   *.bmp ]]; then          ..code..      fi  done  

A2 on four A4 pages? | Convert A4 PDF to "A2 on four A4" PDF?

Posted: 16 Apr 2022 01:06 AM PDT

Given e.g. pdf (in any size) how to enlarge it to A2 size and print on four A4 pages?

(if possible it would be great if pdf having multiple pages we could split like this, so if there is pdf with posters to print multiple at once)

(of course command line solutions proffered ;) )

Given we have the API /proc/pid/status should/could /proc/pid/stat be deprecated?

Posted: 16 Apr 2022 05:44 AM PDT

I have a few questions about the process information avaiable in GNU/Linux via procfs. This was originally prompted by a desire to extract vmPeak, vmSize, vmRSS & vmHWM from within an application.

I started with the working assumption that /proc/<pid>/status is a human readable version of /proc/<pid>/stat which is machine readable as per the kernel.org commentry:

stat - Process status

status - Process status in human readable form

I realised this was not quite correct when I noticed vmPeak is only available from /proc/pid/status.

It seems that /proc/pid/status actually combines values from several places and adds some of its own.

Given we have /proc/pid/status if there any reason to use /proc/pid/stat at all? What needs it? Why have two APIs? Could /proc/pid/stat be deprecated or does it have a use?

stat is not equivalent. It has less fields on offer. It is only slightly easier to parse (with a subtle bug if you do it naively). Any programs using stat could easily switch to using status instead. How many would really break?

I have just written parsers for both (though ultimately I binned the one for stat as the API is less useful). For machine readable there is not much in it. In fact the parser for 'status' ends up being more elegant as you can read it directly into any kind of key value store you like. Status seems easier to parse from any language and extensible.

How many programs actually depend on 'stat' rather than 'status'? Do any of them really need the trivial parsing speed up that this might offer?

Now I understand that stat couldn't be removed for years because of backwards compatibility but you could say 'this is now deprecated' unless there is a very good reason to keep it (which would be one possible answer to my question).

If performance is an issue surely converting this kernel information to text and back via a virtual file system is less performant than a library call would be.

It may be obnoxious to keep adding new APIs as this answer suggests but given that a great deal of this is stable why isn't there C library API like for example, sysinfo?

ping echo request interval changes when there is no echo reply

Posted: 16 Apr 2022 06:17 AM PDT

I am pinging server2 (ip:2.2.2.1) from server1 (ip:1.1.1.1) at an interval of 1ms with flooding, using the command:

ping 2.2.2.1 -i 0.001 -f

I am expecting to see ping requests leaving server1 every 1ms, which happens as long as there is a reply for the respective request, but if there is no reply for some echo request sequence, the interval of ping echo request packets changes to 10ms, then when reply resumes the interval changes again to 1ms. Is there a way to keep the ping interval to 1ms even if there is no reply? I went through some of the ping options but don't find one that will prevent the interval change from happening. Both servers are on centos 7. Thanks in advance.

How to configure Pulseaudio to make laptop speakers and headphones work simultaneously?

Posted: 16 Apr 2022 01:53 AM PDT

I have a laptop with Ubuntu Eoan. Single soundcard, single headphone jack.

I want to use both laptop speakers and headphones at the same time (no particular reason why, just because) but as soon as I plug in the headphones, the speakers become unavailable.

I tried enabling simultaneous output, removing -switch-on-connect and -switch-on-port-available modules and making a virtual sink, but nothing works. Google search returns only the reverse problem, of people not wanting speakers and headphones to play at the same time.

Anyone has any solutions?

Output of amixer -c0:

 Capabilities: pvolume pvolume-joined pswitch pswitch-joined   Playback channels: Mono   Limits: Playback 0 - 87   Mono: Playback 87 [100%] [0.00dB] [on]  Simple mixer control 'Headphone',0   Capabilities: pvolume pswitch   Playback channels: Front Left - Front Right   Limits: Playback 0 - 87   Mono:   Front Left: Playback 87 [100%] [0.00dB] [on]   Front Right: Playback 87 [100%] [0.00dB] [on]  Simple mixer control 'Speaker',0   Capabilities: pvolume pswitch   Playback channels: Front Left - Front Right   Limits: Playback 0 - 87   Mono:   Front Left: Playback 0 [0%] [-65.25dB] [off]   Front Right: Playback 0 [0%] [-65.25dB] [off]  Simple mixer control 'PCM',0   Capabilities: pvolume   Playback channels: Front Left - Front Right   Limits: Playback 0 - 255   Mono:   Front Left: Playback 255 [100%] [0.00dB]   Front Right: Playback 255 [100%] [0.00dB]  Simple mixer control 'Mic',0   Capabilities: pvolume pswitch   Playback channels: Front Left - Front Right   Limits: Playback 0 - 31   Mono:   Front Left: Playback 0 [0%] [-34.50dB] [off]   Front Right: Playback 0 [0%] [-34.50dB] [off]  Simple mixer control 'Mic Boost',0   Capabilities: volume   Playback channels: Front Left - Front Right   Capture channels: Front Left - Front Right   Limits: 0 - 3   Front Left: 0 [0%] [0.00dB]   Front Right: 0 [0%] [0.00dB]  Simple mixer control 'IEC958',0   Capabilities: pswitch pswitch-joined   Playback channels: Mono   Mono: Playback [off]  Simple mixer control 'Capture',0   Capabilities: cvolume cswitch   Capture channels: Front Left - Front Right   Limits: Capture 0 - 63   Front Left: Capture 47 [75%] [18.00dB] [on]   Front Right: Capture 47 [75%] [18.00dB] [on]  Simple mixer control 'Auto-Mute Mode',0   Capabilities: enum   Items: 'Disabled' 'Enabled'   Item0: 'Enabled'  Simple mixer control 'Internal Mic',0   Capabilities: pvolume pswitch   Playback channels: Front Left - Front Right   Limits: Playback 0 - 31   Mono:   Front Left: Playback 0 [0%] [-34.50dB] [off]   Front Right: Playback 0 [0%] [-34.50dB] [off]  Simple mixer control 'Internal Mic Boost',0   Capabilities: volume   Playback channels: Front Left - Front Right   Capture channels: Front Left - Front Right   Limits: 0 - 3   Front Left: 0 [0%] [0.00dB]   Front Right: 0 [0%] [0.00dB]  Simple mixer control 'Loopback Mixing',0   Capabilities: enum   Items: 'Disabled' 'Enabled'   Item0: 'Disabled'  

What is the avahi daemon?

Posted: 16 Apr 2022 04:20 AM PDT

I just learning about daemon, by that time I came know avahi daemon can you please explain detaily about avahi daemon and why linux has a avahi user ?

Route LAN traffic through VPN gateway

Posted: 16 Apr 2022 02:54 AM PDT

My iMac has software which connects to a remote VPN. It works well - but only that specific device.

I now want to allow other devices on my network to access the same VPN connection via the iMac. The reason for doing this is because my phone cannot connect to the VPN itself as it does not support the OpenVPN protocol.

I have enabled port forwarding with: sysctl -w net.inet.ip.forwarding=1

I have tried to add the following to line 32 in my /etc/pf.conf file: nat on utun1 from en0:network to any -> (utun1) where en0 is my ethernet port that the internet comes from and utun1 is where all the traffic is once the vpn is connected

When I run sudo pfctl -e -f /etc/pf.conf I get the error:

/etc/pf.conf:32: Rules must be in order: options, normalization, queueing, translation, filtering pfctl: Syntax error in config file: pf rules not loaded

Can anyone tell me why I'm getting this error? Am i using the nat command incorrectly?

FYI - I have been following the tutorial Set up Internet Sharing on Mac OSX using Command Line Tools

How to check/fix nvme health?

Posted: 16 Apr 2022 01:03 AM PDT

I'm running debian stable with a 2 x nvme Raid 1.
Here is the hardware/hoster it's running on https://www.hetzner.com/dedicated-rootserver/ex62-nvme?country=us
Almost every second day mdadm monitoring reports a fail event and leaves the array degraded.
It only disables 1 partition as you can see here:

This is an automatically generated mail message from mdadm  running on xxx    A Fail event had been detected on md device /dev/md/2.    It could be related to component device /dev/nvme1n1p3.    Faithfully yours, etc.    P.S. The /proc/mdstat file currently contains the following:    Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]   md2 : active raid1 nvme1n1p3[1](F) nvme0n1p3[0]        465895744 blocks super 1.2 [2/1] [U_]        bitmap: 4/4 pages [16KB], 65536KB chunk    md0 : active (auto-read-only) raid1 nvme1n1p1[1] nvme0n1p1[0]        33521664 blocks super 1.2 [2/2] [UU]    md1 : active raid1 nvme0n1p2[0] nvme1n1p2[1]        523712 blocks super 1.2 [2/2] [UU]    unused devices: <none>  

This happens on both disks. One time it's nvme0n1p3 and next time it's nvme1n1p3.
I then just re-add the failed partition with

mdadm --re-add /dev/md2 /dev/nvme0n1p3  

or

mdadm --re-add /dev/md2 /dev/nvme1n1p3  

and after the resync it works for a day or two.

In dmesg I found this:

[94879.144892] nvme nvme1: I/O 311 QID 1 timeout, reset controller  [94879.252851] nvme nvme1: completing aborted command with status: 0007  [94879.252970] blk_update_request: I/O error, dev nvme1n1, sector 452352001  [94879.253091] nvme nvme1: completing aborted command with status: fffffffc  [94879.253223] blk_update_request: I/O error, dev nvme1n1, sector 68159504  [94879.253418] md: super_written gets error=-5  

I tried to check the health of the devices with these commands, but they don't give me stats like "Reallocated_Sector_Ct" or "Reported_Uncorrect".

smartctl -x /dev/nvme1    smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.0-8-amd64] (local build)  Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org    === START OF INFORMATION SECTION ===  Model Number:                       KXG50ZNV512G TOSHIBA  Serial Number:                      28SS10F6TYST  Firmware Version:                   AAGA4102  PCI Vendor/Subsystem ID:            0x1179  IEEE OUI Identifier:                0x00080d  Total NVM Capacity:                 512,110,190,592 [512 GB]  Unallocated NVM Capacity:           0  Controller ID:                      0  Number of Namespaces:               1  Namespace 1 Size/Capacity:          512,110,190,592 [512 GB]  Namespace 1 Formatted LBA Size:     512  Local Time is:                      Mon May 13 10:34:11 2019 CEST  Firmware Updates (0x14):            2 Slots, no Reset required  Optional Admin Commands (0x0017):   Security Format Frmw_DL *Other*  Optional NVM Commands (0x005f):     Comp Wr_Unc DS_Mngmt Wr_Zero Sav/Sel_Feat *Other*  Maximum Data Transfer Size:         512 Pages  Warning  Comp. Temp. Threshold:     78 Celsius  Critical Comp. Temp. Threshold:     82 Celsius  Namespace 1 Features (0x02):        NA_Fields    Supported Power States  St Op     Max   Active     Idle   RL RT WL WT  Ent_Lat  Ex_Lat   0 +     6.00W       -        -    0  0  0  0        0       0   1 +     2.40W       -        -    1  1  1  1        0       0   2 +     1.90W       -        -    2  2  2  2        0       0   3 -   0.0500W       -        -    3  3  3  3     1500    1500   4 -   0.0050W       -        -    4  4  4  4     6000   14000   5 -   0.0030W       -        -    5  5  5  5    50000   80000    Supported LBA Sizes (NSID 0x1)  Id Fmt  Data  Metadt  Rel_Perf   0 +     512       0         2   1 -    4096       0         1    === START OF SMART DATA SECTION ===  SMART overall-health self-assessment test result: PASSED    SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)  Critical Warning:                   0x00  Temperature:                        47 Celsius  Available Spare:                    100%  Available Spare Threshold:          10%  Percentage Used:                    57%  Data Units Read:                    31,858,921 [16.3 TB]  Data Units Written:                 293,589,002 [150 TB]  Host Read Commands:                 4,130,502,428  Host Write Commands:                889,121,505  Controller Busy Time:               13,552  Power Cycles:                       7  Power On Hours:                     6,720  Unsafe Shutdowns:                   0  Media and Data Integrity Errors:    0  Error Information Log Entries:      0  Warning  Comp. Temperature Time:    0  Critical Comp. Temperature Time:    0  Temperature Sensor 1:               47 Celsius    Error Information (NVMe Log 0x01, max 128 entries)  No Errors Logged    nvme smart-log /dev/nvme1    Smart Log for NVME device:nvme1 namespace-id:ffffffff  critical_warning                    : 0  temperature                         : 47 C  available_spare                     : 100%  available_spare_threshold           : 10%  percentage_used                     : 57%  data_units_read                     : 31,858,921  data_units_written                  : 293,589,023  host_read_commands                  : 4,130,502,429  host_write_commands                 : 889,122,059  controller_busy_time                : 13,552  power_cycles                        : 7  power_on_hours                      : 6,720  unsafe_shutdowns                    : 0  media_errors                        : 0  num_err_log_entries                 : 0  Warning Temperature Time            : 0  Critical Composite Temperature Time : 0  Temperature Sensor 1                : 47 C  Temperature Sensor 2                : 0 C  Temperature Sensor 3                : 0 C  Temperature Sensor 4                : 0 C  Temperature Sensor 5                : 0 C  Temperature Sensor 6                : 0 C  Temperature Sensor 7                : 0 C  Temperature Sensor 8                : 0 C    nvme smart-log-add /dev/nvme1    NVMe Status:INVALID_LOG_PAGE(4109)    smartctl -A /dev/nvme1    smartctl 6.6 2016-05-31 r4324 [x86_64-linux-4.9.0-8-amd64] (local build)  Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org    === START OF SMART DATA SECTION ===  SMART/Health Information (NVMe Log 0x02, NSID 0xffffffff)  Critical Warning:                   0x00  Temperature:                        46 Celsius  Available Spare:                    100%  Available Spare Threshold:          10%  Percentage Used:                    57%  Data Units Read:                    31,858,924 [16.3 TB]  Data Units Written:                 293,591,327 [150 TB]  Host Read Commands:                 4,130,502,490  Host Write Commands:                889,172,096  Controller Busy Time:               13,552  Power Cycles:                       7  Power On Hours:                     6,721  Unsafe Shutdowns:                   0  Media and Data Integrity Errors:    0  Error Information Log Entries:      0  Warning  Comp. Temperature Time:    0  Critical Comp. Temperature Time:    0  Temperature Sensor 1:               46 Celsius  

I only noticed the issue after apache failed to start and I repaired the filesystem with fsck.ext4 -f. Before I didn't have setup root mail correctly.

So looks to me like a hardware error and I should get rid of both nvmes.
Is there anything I can try to fix these issues and save the nvmes? Or at least to get all the smart values like "Reported_Uncorrect" or "Offline_Uncorrectable".

upgrade qt 5.6 to 5.9 in centos 7

Posted: 16 Apr 2022 06:04 AM PDT

CentOS 7 ships with Qt 5.6, is there a way of upgrading to Qt 5.9?.

current version.

QMake version 3.0  Using Qt version 5.6.2 in /usr/lib64  

I dont want to install Qt from qt.io, as I am not going to develop applications, the application I'm trying to run requires QtQuick version 2.9 which is available in Qt 5.9.

What is preventing Firefox from opening websites?

Posted: 16 Apr 2022 02:04 AM PDT

I solved my problem but I want to know what caused it for any future reference and better understanding.


I have come across a strange behavior of Firefox on Ubuntu 14.04. I left office with my laptop turned on so I could listen to music. Before I left office, Firefox was working normally.

Now I came to library, opened my laptop and Firefox and what happened was that Firefox was unable to open any pages, including Google.com. Firefox was running smoothly, without any delays, it just returned Server not found on any page I tried. What I did was, as usual in such cases, restart NetworkManager with command

sudo killall NetworkManager  

which also automatically starts NetworkManager after it. The laptop connected to network, I relaunch Firefox and again nothing. So I ran

ps auxw | grep firefox  

to see if there is some strange Firefox background process running but everything appeared as usual. I am sorry but I didn't take a screenshot, my mistake. I closed Firefox and executed ps auxw | grep firefox again and as expected, there was only one output line like this

campovs+  2715  0.0  0.0   5924  2196 pts/0    S+   16:43   0:00 grep --color=auto firefox  

which means that grep was searching for firefox.

At this point I was 100% sure there has to be something with the internet connection and not Firefox. So I decided to proceed with regular internet connection checking, that being executing

ping google.com  

Packets were flying which also eliminated possible DNS errors, although I have no idea how those could happen since I haven't done anything on my laptop and the network I was connected to was eduroam. I ran another command

curl -v google.com  

and it, as expected, returned HTML code of google.com with last line

* Connection #0 to host google.com left intact  

which basically means everything is ok. I was left out of options and I knew that restarting the laptop will almost certainly solve the problem, although I didn't even know what was causing it. I ran sudo reboot and now Firefox is working.

So my question is, does anyone of you know, what might cause such behavior?

Can't see GRUB menu on Boot, Chromebook

Posted: 16 Apr 2022 12:03 AM PDT

I've installed Arch 2017.07.01 on a micro SD card in my Dell Chromebook 13 using this guide, and I'm using John Lewis' SeaBios to dual boot. I can successfully get into the boot menuand select the micro sd to boot from, but I then get a Welcome to GRUB! message, and, instead of a GRUB console, i get a few lines of white distortion on top of my screen, with the boot menu still frozen in the background. I believe the distortion is the console outputting incorrectly as typing seems to change it, and it disappears after a while, reappearing when i move the mouse or type, like the screen falling asleep and waking up.

I've already tried doing a full reinstall of arch, commenting out GRUB_HIDDEN_TIMEOUT and GRUB_HIDDEN_TIMEOUT_QUIET, and changing GRUB_GFXMODE to 640x480, but nothing had worked.

Any ideas?

Installing TOR on ec2 instance

Posted: 16 Apr 2022 03:01 AM PDT

As part of a research I am doing I am trying to install TOR package on a Amazon ec2 server.

I have added the repo name to my repos configuration (following this tutorial: https://www.torproject.org/docs/rpms.html.en)

When attempting to install the tor package using sudo yum install tor I get the following error:

> Loaded plugins: priorities, update-motd, upgrade-helper  amzn-main/latest                                         | 2.1 kB     00:00  amzn-updates/latest                                      | 2.3 kB     00:00  Resolving Dependencies  --> Running transaction check  ---> Package tor.x86_64 0:0.2.7.6-tor.1.rh7_1_1503 will be installed  --> Processing Dependency: openssl-libs >= 1.0.1 for package: tor-0.2.7.6-tor.1.rh7_1_1503.x86_64  --> Finished Dependency Resolution  **Error: Package: tor-0.2.7.6-tor.1.rh7_1_1503.x86_64 (tor)             Requires: openssl-libs >= 1.0.1**   You could try using --skip-broken to work around the problem   You could try running: rpm -Va --nofiles --nodigest  

And so I tried to install openssl and I found out that it is already installed.

Has anyone encountered this problem before? Any solutions would be a great help! Thank you in advance!

NFS Share on Centos 7 Fails to automount

Posted: 16 Apr 2022 05:05 AM PDT

I have a fresh install of Centos 7. I cannot seem to auto mount an NFS share located on 192.168.254.105:/srv/nfsshare from the Centos client.

Mounting the share manually however, works perfectly.

/etc/auto.master has been commented out completely to simplify the problem, save for the following line:

/-       /etc/auto.nfsshare   

/etc/auto.nfsshare holds the following line:

/tests/nfsshare       -fstype=nfs,credentials=/etc/credentials.txt    192.168.254.105:/srv/nfsshare  

/etc/credentials.txt holds:

 user=user   password=password  

The expected behavior is that when I ls -l /tests/nfsshare, I will see a few files that my fileserver's /srv/nfsshare directory holds.

It does not. Instead, it shows nothing.

The logs from sudo journalctl --unit=autofs.service shows this when it starts (debug enabled):

 Nov 20 00:25:38 localhost.localdomain systemd[1]: Starting Automounts filesystems on demand...   Nov 20 00:25:38 localhost.localdomain automount[21204]: Starting automounter version 5.0.7-48.el7, master map auto.master   Nov 20 00:25:38 localhost.localdomain automount[21204]: using kernel protocol version 5.02   Nov 20 00:25:38 localhost.localdomain automount[21204]: lookup_nss_read_master: reading master files auto.master   Nov 20 00:25:38 localhost.localdomain automount[21204]: parse_init: parse(sun): init gathered global options: (null)   Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_mount: mtab link detected, passing -n to mount   Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_umount: mtab link detected, passing -n to mount   Nov 20 00:25:38 localhost.localdomain automount[21204]: lookup_read_master: lookup(file): read entry /-   Nov 20 00:25:38 localhost.localdomain automount[21204]: master_do_mount: mounting /-   Nov 20 00:25:38 localhost.localdomain automount[21204]: automount_path_to_fifo: fifo name /run/autofs.fifo--   Nov 20 00:25:38 localhost.localdomain automount[21204]: lookup_nss_read_map: reading map file /etc/auto.nfsshare   Nov 20 00:25:38 localhost.localdomain automount[21204]: parse_init: parse(sun): init gathered global options: (null)   Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_mount: mtab link detected, passing -n to mount   Nov 20 00:25:38 localhost.localdomain automount[21204]: spawn_umount: mtab link detected, passing -n to mount   Nov 20 00:25:38 localhost.localdomain automount[21204]: mounted direct on /tests/nfsshare with timeout 300, freq 75 seconds   Nov 20 00:25:38 localhost.localdomain automount[21204]: do_mount_autofs_direct: mounted trigger /tests/nfsshare   Nov 20 00:25:38 localhost.localdomain automount[21204]: st_ready: st_ready(): state = 0 path /-   Nov 20 00:25:38 localhost.localdomain systemd[1]: Started Automounts filesystems on demand.  

The following appears in my logs when I attempt to force mounting of the nfs share via ls -l /tests/nfsshare:

 Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet: type = 5   Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet_missing_direct: token 21, name /tests/nfsshare, request pid 22057   Nov 20 00:48:05 localhost.localdomain automount[22030]: attempting to mount entry /tests/nfsshare   Nov 20 00:48:05 localhost.localdomain automount[22030]: lookup_mount: lookup(file): looking up /tests/nfsshare   Nov 20 00:48:05 localhost.localdomain automount[22030]: lookup_mount: lookup(file): /tests/nfsshare -> -fstype=nfs,credentials=/etc/credenti...fsshare   Nov 20 00:48:05 localhost.localdomain automount[22030]: parse_mount: parse(sun): expanded entry: -fstype=nfs,credentials=/etc/credentials.tx...fsshare   Nov 20 00:48:05 localhost.localdomain automount[22030]: parse_mount: parse(sun): gathered options: fstype=nfs,credentials=/etc/credentials.txt     Nov 20 00:48:05 localhost.localdomain automount[22030]: [90B blob data]   Nov 20 00:48:05 localhost.localdomain automount[22030]: dev_ioctl_send_fail: token = 21   Nov 20 00:48:05 localhost.localdomain automount[22030]: failed to mount /tests/nfsshare   Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet:      type = 5   Nov 20 00:48:05 localhost.localdomain automount[22030]: handle_packet_missing_direct: token 22, name /tests/nfsshare, request pid 22057   Nov 20 00:48:05 localhost.localdomain automount[22030]: dev_ioctl_send_fail: token = 22  

Additionally, ls -l /tests/nfsshare actually produces the error:

 ls: cannot access nfsshare/: No such file or directory  

How can I fix this issue? As stated before, manual mounting the share works fine.


EDIT: as requested, output of ls -la /etc/auto.nfsshare

-rw-r--r--. 1 root root 99 Nov 20 00:25 /etc/auto.nfsshare  

No access for user to shared libraries

Posted: 16 Apr 2022 04:03 AM PDT

I use Debian and I have a problem with executing arm-none-eabi-gdb as a user. I get the following message: arm-none-eabi-gdb: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory. The only way to run it is to type sudo arm-none-eabi-gdb . I have checked library libncurses.so.5 and found that there was no execute permission for users so I changed it with chmod. Now all users can execute it but I still get the error when calling arm-none-eabi-gdb without sudo.

Can anyone explain me what is the mechanism that is blocking me ?

Why is my keyboard typing the wrong letters?

Posted: 16 Apr 2022 02:14 AM PDT

While surfing with Iceweasel, I tried typing in a Web address, but I found, that every few keys, it started typing other letters instead of the ones I typed. For example, if I typed "c-c-c-c-c-c-c-c-c-c-c-c" it printed "ckexccccckex" or if I typed "a-b-c-d-e-f-g-h-j-i", it printed "abckexghi" instead.

  • Each time this occurs, the misplaced letters are different, but always in some pattern. Sometimes, it places backspaces or spaces, not just letters.
  • When I did not type anything, no words appeared.
  • When I unplugged and replugged the USB keyboard, it still had the problem.
  • The problem only appears in Iceweasel, in the URL bar or in text fields, but not in other applications.
  • The problem went away after closing Iceweasel and reopening it.
  • I can find no pattern in when it appears.

How can I determine the cause? Could this be the result of a security issue?

I am using Debian 7.0 with a Logitech K120 keyboard.

No comments:

Post a Comment