Wednesday, September 22, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to split a line of text separated by "," into a file containing one string per line?

Posted: 22 Sep 2021 11:03 AM PDT

I have a file containing strings in the format of A,B,C,D..., and I would like to save them into a file by using standard Linux utilities as:

A  B  C  D   ...  

The content in the original file is dynamic, which could contain 0, 1, 2, or more strings. How do I do that?

Windows is not present in grub menu

Posted: 22 Sep 2021 10:40 AM PDT

(I don't know if this question belongs here, but here we go)

I bought a new HP 14(2021) last week, with 11th gen core i3 and Xe graphics. It came with Windows 10. After a few days, I installed Manjaro on it, along with windows but Manjaro had some problems booting up. I watched a few YT tutorials and found out that it could be associated with grub.

Yesterday, I booted into a live user in manjaro and was gonna fix grub. There was a part in which I would have to mount the root partition of Manjaro, but I accidentally mounted the Windows partition. Then, I was trying to unmount it, but the partition was busy, so I powered off the pc. I turned on the lap again, but the grub menu was not shown and it directly booted into Manjaro, which had some rootfs problems.

Then, I installed elementary os, without formatting the efi, but the grub menu still didn't show Windows. I checked the uefi firmware, and it still showed windows boot manager. On selecting it, a grub rescue screen was shown. From elementary, I tried os-prober and update-grub, but both didn't show the windows partition.

The EFI partition currently has manjaro,windows boot manager,ubuntu and elementary os. The last 2 came after installing EOS.

When I booted from the Windows 10 iso and executed some commands in the command prompt of the troubleshoot, it could not find any windows installation. So,has windows been uninstalled or is it some Linux related problem? (I can still access files in the Windows Partition from Elementary)

P.S: The link of the video which I referred to: https://youtu.be/8hxLIua8SS4?t=163

PPS: I am ready to install windows again, if required.

PPPS: The windows install came with ms office, is there any way to get them again?

Network access issue on Kali in VirtualBox

Posted: 22 Sep 2021 10:34 AM PDT

I just installed Kali Linux on a virtual machine with VirtualBox, but I cannot access the internet or ping the host machine, yet the access mode is set to bridge access. For Internet access I use a HUAWEI MOBILE key. Here is a capture of the ifconfig and ping commands to the host machine:

    [![Capture of commands result][1]][1]  

Thanks for your help !

How to check how my process' CPUs are affined?

Posted: 22 Sep 2021 09:55 AM PDT

When I log into my host, I find that my processes are affined to a subset of cores:

# taskset -cp $$  pid 2040's current affinity list: 0-15,17,19,24-39,41,43  

I don't know why. This occurs for root or any other login shell. I have scoured /etc/, looking for strings 'affin' or 'taskset' in the files:

find /etc -type f -exec grep -i taskset {} \; -print  find /etc -type f -exec grep -i affin {} \; -print  

...nothing. I have performed

# pwd  /sys/fs/cgroup/cpuset  # cat cpuset.cpus  0-47  

...the whole boat is in there. I can't for the life of me figure out where that affinity list is being set.

I should mention perhaps that I did have the cpu-partitioning tuning on this machine previously, but I changed it to 'throughput-performance' and removed the cpu-partitioning-variables.conf file from /etc/tuned, and I think there may be an artifact left over from that procedure, but I can't find it.

BTW, we have:

# cat /proc/cmdline  BOOT_IMAGE=/vmlinuz-3.10.0-1160.36.2.el7.x86_64 root=/dev/mapper/vg00-root ro nofb splash=quiet crashkernel=auto rd.lvm.lv=vg00/root nosoftlockup mce=ignore_ce ipv6.disable=1 transparent_hugepage=never spectre_v2=off nopti LANG=en_US.UTF-8  

Thanks.

Why doesn't bash interpret the asterisk character when used with xargs command?

Posted: 22 Sep 2021 10:14 AM PDT

As far as I understand, the asterisk character * has a special meaning in Bash and in order to print the literal character we need to either escape it (\*) or quote it ("*" or '*'.

However, when I have tried the following:

$ seq 3 |  xargs -I *  echo *  1  2  3  

Why doesn't Bash interpret * in the example above? But in the following example it did interpret it as a wildcard character (it matches the file in the current directory):

$ seq 3 |  xargs -I*  echo * # no space between -I and *  main.py  main.py  main.py  

Could you please explain the logic behind this?

Thank you

How do I get sed to delete the second block of lines in a file?

Posted: 22 Sep 2021 10:51 AM PDT

I have hundreds of badly-written HTML files that have two HTML sections, like this:

<HTML>  <HEAD>  several header lines  </HEAD>  <BODY>  hundreds of lines of content  </BODY>  </HTML>  <HTML>  dozens of lines  </HTML>  

I want to delete the entire second HTML section using GNU sed 4.7 on Linux. I've tried things like:

sed '0,/<HTML>/! /<HTML>/,/<\/HTML>/d'  

but that doesn't work. I'd like to do something like this but it's not syntactically correct:

sed '/<HTML>/2,/<\/HTML>/d'  

Help please.

7z command to create a XZ file

Posted: 22 Sep 2021 10:08 AM PDT

The man page says 7z tool supports 7z, LZMA2, XZ, ZIP, Zip64, CAB, RAR, ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO, most filesystem images and DEB formats.

And it says we could pass the type as -t{Type}. The following command is success.

7z a -tzip archive.zip dir1 dir2 file1 file2  

But I can't archive the files into .xz using the following command.

7z a -txz archive.zip dir1 dir2 file1 file2  
$ 7z a -txz archive.xz dir1 dir2 file1 file2    7-Zip [64] 16.02 : Copyright (c) 1999-2016 Igor Pavlov : 2016-05-21  p7zip Version 16.02 (locale=en_GB.UTF-8,Utf16=on,HugeFiles=on,64 bits,4 CPUs Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (806E9),ASM,AES-NI)    Scanning the drive:  2 folders, 7 files, 196192711 bytes (188 MiB)    Creating archive: archive.xz    Items to compress: 9        System ERROR:  E_INVALIDARG  

Anything I am doing wrong here? How to create .xz file using 7z command?

EDIT: The following command successful.

7z a -txz archive archive.tar  

Does it mean we can use -txz or -tbzip2 on only archive files as we can't directly use compression on files without archiving the files first?

eth0 and eth1 configs are opposite of ifconfig

Posted: 22 Sep 2021 09:45 AM PDT

cat /etc/os-release

NAME=Fedora  VERSION="19 (Schrödinger's Cat)"  

I was tasked with doing some maintenance on an old server that I did not set up or normally maintain, during my initial investigation of the server I ran into some strange problems. This server has two Ethernet ports and two Ethernet cables plugged into it. eth0 is set up so that outside access can be allowed, not my preferred way of doing things but I did not set it up. eth1 gives access to the internal network the server is on, there's no gateway because there's nothing outside the 10.10.X.X network this server needs to access.

vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0  ONBOOT=yes  NM_CONTROLLED=NO  TYPE=Ethernet  NAME="System eth0"  IPADDR=56.231.148.147  BOOTPROTO=  NETMASK=255.255.255.224  GATEWAY=56.231.148.129  

vim /etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1  ONBOOT=yes  TYPE=Ethernet  NAME="System eth1"  NM_CONTROLLED=NO  IPADDR=10.10.162.56  BOOTPROTO=  NETMASK=255.255.0.0  GATEWAY=  

However, I noticed when I did ifconfig that the configurations are essentially swapped.

ifconfig

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500      inet 10.10.162.56  netmask 255.255.0.0  broadcast 10.10.255.255      inet6 fe80::265:90ef:feb6:1c89  prefixlen 64  scopeid 0x20<link>      ether 00:25:90:d6:1c:59  txqueuelen 1000  (Ethernet)      RX packets 3351413769  bytes 2323498061925 (2.1 TiB)      RX errors 0  dropped 12067472  overruns 0  frame 0      TX packets 189334141  bytes 12955319604 (12.0 GiB)      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      device interrupt 5  memory 0xdfa00000-dfa20000    eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500      inet 56.231.148.147  netmask 255.255.255.224  broadcast 56.231.148.159      inet6 fe80::2f5:90ff:fad6:1c68  prefixlen 64  scopeid 0x20<link>      ether 00:25:90:d6:1c:58  txqueuelen 1000  (Ethernet)      RX packets 286092293  bytes 22758079138 (21.1 GiB)      RX errors 0  dropped 7464799  overruns 0  frame 0      TX packets 850398759  bytes 1147424844194 (1.0 TiB)      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0      device interrupt 11  memory 0xdf900000-df920000    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536      inet 127.0.0.1  netmask 255.0.0.0      inet6 ::1  prefixlen 128  scopeid 0x10<host>      loop  txqueuelen 0  (Local Loopback)      RX packets 3395394  bytes 849447163 (810.0 MiB)      RX errors 0  dropped 0  overruns 0  frame 0      TX packets 3395394  bytes 849447163 (810.0 MiB)      TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  

Any idea what could've caused this? Everything works just fine with the server, the configuration is just opposite of what ifconfig says.

When I rebooted the server it no longer had any network access, from the outside or from the inside. I had to attach a keyboard/mouse/monitor and when I did an ifconfig I saw that both eth0 and eth1 had the same IP of 56.231.148.147. I disabled eth0 and got network access back on the external network. I restarted network services and brought eth0 back online and it had the IP 10.10.162.56 as it originally had and the server started functioning as usual.

how to share file with socat in RW

Posted: 22 Sep 2021 09:31 AM PDT

I want to share usb dongle in my local network with socat.I managed to do this with following commands but on the client side i am not able to mount it rw it works as read-only:

socat FILE:/dev/sdd1 192.168.8.111:5778,reuseaddr  socat TCP:192.168.8.111:5778 /dev/sdd1  

Thank you

bash script for not starting more than once

Posted: 22 Sep 2021 09:40 AM PDT

So I have a bash script which will notify me, if the battery is low.

The script is here

#!/bin/bash    BATTERY=$(upower -e | grep 'BAT')    while :  do      BATTERY_PERCENTAGE=$(upower -i $BATTERY | grep percentage | awk '{ print $2 }' | sed s/'%'/''/g)      CABLE=$(upower -d | grep -n2 line-power | grep online | awk '{ print $3 }')        if [[ "$BATTERY_PERCENTAGE" -lt "10" && $CABLE = "no" ]]; then          notify-send --urgency=critical "WARNING: Battery is about to die"  "Plug in the power cable"      fi    sleep 60    done  

So I am currently using the dwm window manager with Arch Linux. The issue is that if I just close the window manager, & again launch it, it actually shut down all the programs I was using (for instance flameshot & dunst), but it fails to kill my battery script. Here is my autostart script which I am running in .xinitrc file.

# My .xinitrc file  # This file will run as autostart    dunst &  flameshot &  setxkbmap -option caps:escape &  sxhkd -c ~/suckless/dwm/sxhkdrc &  ~/.fehbg &  ~/scripts/battery-notification &   xrdb ~/.Xresources &  exec dwm   

And I run this file through xorg's startx. If I do a ps -ef | grep battery-notification, it shows more than 2 instances (which include battery script & grep).

Answers are appreciated :)

Use MD5 OSPF authentication in FRR on FIPS enabled RHEL 8 machine?

Posted: 22 Sep 2021 09:19 AM PDT

We're in the process of upgrading to Redhat 8.4. Our organization requires that we enable FIPS on all of our machines. FIPS does not allow the machine to use weak encryption algorithms like MD5.

In Redhat 8, the default dynamic routing software package is now FRR (FRRouting). FRRouting has replaced quagga. We use FRR to turn our machines into routers. I'm finding that we can't enable OSPF MD5 authentication on this machine and therefore cannot form an encrypted OSPF neighbor relationship with any neighboring routers. And this is all because of FIPS.

I'm wondering if there's a workaround that I could implement.

An example of the type of workaround I'm looking for might be similar to what is available for FreeRADIUS on Redhat. FreeRADIUS support MD5 authentication on FIPS enabled servers by implementing the workaround found here: https://access.redhat.com/solutions/4650511

It'd be great if there was a similar solution for FRR. Thanks!

How to block specific desktop notifications?

Posted: 22 Sep 2021 09:04 AM PDT

I subscribe to the Boston Globe. I get unwanted news alerts from them as desktop notifications. I never asked for them. I don't want them. I contacted the Boston Globe and they won't help me. I logged on to bostonglobe.com and looked for a relevant setting - no luck. I get many desktop notifications. I only want to stop the ones from the Globe. I know how to programmatically throw up a notification, but I have no idea how to turn off or block specific notifications. And I would like to continue my Globe subscription. I'm running Pop!_OS 20.04 LTS and I login to i3 window manager. Thanks in advance.

Bash hotkey to retrieve the last value sent to stdout

Posted: 22 Sep 2021 09:28 AM PDT

I know you can use the last argument passed to last the last command by hitting Alt-.. Is there a similar binding to get the output of the last command, or in other words the last value printed to stdout?

These questions are closely related but are not focused an a binding:
bash: get last stdout
How do I reuse the last output from the command line?

Cannot renable wifi on Linux Mint 20.2 (Xfce)

Posted: 22 Sep 2021 09:45 AM PDT

I'm running linux mint 20.2 (Xfce). I'm also dual booting along side windows if that's relevant. When I booted into my computer this morning the WIFI was disabled. The F12 button on my keyboard for enabling/disabling wireless is red, when it's usually blue.

I've tried enabling it again by pressing the button (with and without the function key) but that didn't work. I've also tired running sudo service network-manager restart which didn't help either. I've tried running sudo rfkill list all and sudo rfkill unblock all but none of the rfkill commands are out putting anything.

When I plug in my live USB (which I am using to post start this thread on the same hardware), the WiFi works perfectly fine.

Upon running iwconfig I get this output if this helps:

linkio@linkio:~$ iwconfig  anbox0    no wireless extensions.    lo        no wireless extensions.    enp8s0    no wireless extensions.  

Output of networkctl -a:

linkio@linkio:~$ networkctl -a  WARNING: systemd-networkd is not running, output will be incomplete.    IDX LINK   TYPE     OPERATIONAL SETUP        1 lo     loopback n/a         unmanaged    2 enp8s0 ether    n/a         unmanaged    3 anbox0 bridge   n/a         unmanaged    3 links listed.  

Output of lsusb:

linkio@linkio:~$ lsusb  Bus 001 Device 003: ID 05c8:036e Cheng Uei Precision Industry Co., Ltd (Foxlink) Webcam  Bus 001 Device 002: ID 8087:8000 Intel Corp.   Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub  Bus 002 Device 002: ID 062a:4101 MosArt Semiconductor Corp. Wireless Keyboard/Mouse  Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub  

Output of lspci:

linkio@linkio:~$ lspci  00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)  00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)  00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)  00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)  00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)  00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)  00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4)  00:1c.1 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 2 (rev e4)  00:1c.2 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)  00:1c.5 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 6 (rev e4)  00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)  00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)  00:1f.2 SATA controller: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] (rev 04)  00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)  02:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader (rev 01)  08:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 07)  09:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8188EE Wireless Network Adapter (rev 01)  

Let me know if you need anymore information, or have any solutions. Thanks.

-Linkio

PV command to show progress in Dialog with transfer rate in Mbits

Posted: 22 Sep 2021 10:30 AM PDT

I am using PV -n command to read partitions and using gzip with pipe to compress the read data and storing the file. While data is read and written I am using a while loop to show progress using linux dialog utility.

This works great, progress is updated. I want to also display the transfer speed / read speed in Mbits. Also I want to update the DB table with progress as well as transfer speed in Mbits.

Since I am using a while loop to read each line, progress should be displayed on a new line for every update. See below my code.

        (pv -n /dev/$partitions | gzip -c >$path/${filename// /_}-${partitions}.img.gz) 2>&1 | while IFS= read -r progress;                                  do                                          echo "processing /dev/$partitions currently completed $progress" >/run/log.log                                          echo $progress | dialog --title "Capturing OS image of $hdd" --gauge " now creating image of HDD $hdd writing $filename Image, please wait...\n\n\n                                          Processing Partition $i of $totalparts\n\n                                          This process may take some time to complete\n\n" 13 90 0    mysql -u root -pxxxxxx dbi -h localhost | insert into speed(progress, speed) Values ("$line", "mbits")                                      done  

if I use pv -n command it only returns numeric value of progress on a newline. See below example:

( /data/pv -n /dev/nvme0n1p1 | gzip -c >/run/test.img )   5  9  29  67  100  

Above works great for the progress bar, but I want to do update my db with average speed in mbits.

When I run pv command for progress with average speed agrument, progress is updated on the same line instead of print new lines and it breaks my script. See below example.

(pv -rep /dev/nvme0n1p1 | gzip -c >/run/test.img )   [4.9MiB/s] [====>                             ]  4% ETA 0:00:19  

ideal output should be like this.

(pv -rep /dev/nvme0n1p1 | gzip -c >/run/test.img )   [ 4.18MiB/s] [====>                          ]  14% ETA 0:00:19  [14.49MiB/s] [===========>                   ]  54% ETA 0:00:19  [24.39MiB/s] [========================>      ]  74% ETA 0:00:19  [44.29MiB/s] [===========================>   ]  78% ETA 0:00:19  [46.19MiB/s] [=============================> ]  98% ETA 0:00:19  [57.99MiB/s] [==============================>]  100% ETA 0:00:19  

I can use AWK, Sed and Grep to format the the required data and use it in my while loop. But how can I get this to work.

If I use other arguments such as pv -n -r -e, it ignores all other parameters just returns the numeric progress value on a newline.

Maybe there is an alternative to pv that I can use to achieve exactly described above or maybe someone can help with pv command.

output of which perl is /bin/perl instead of /usr/bin/perl

Posted: 22 Sep 2021 09:49 AM PDT

Hi I'm running Redhat Server 7.9 and running into an interesting issue. If I type which perl, I get /bin/perl, but it should be /usr/bin/perl. The same for git.

This same machine would print /usr/ before, but it doesn't know.

Im a little confused, why would this change?

Sort according to the last column (or any other column with a numerical value) of a csv file

Posted: 22 Sep 2021 08:51 AM PDT

I have a file with following contents. I am looking to sort this file based on the last column (and third last but for another file) while retaining rest of the contents of the row.

ABC,DEF,GHI,-5,-8,-0.6,0.488   XYZ,JKL,MNO,3,-5,0.2,-0.342   STU,WXY,DEF,-1,4,0.01,0.345   

If I use this command, it works as expected and shows the correct results:

awk '{print $NF,$0}' FILE | sort -nr | cut -f2- -d' '  
XYZ,JKL,MNO,3,-5,0.2,-0.342   STU,WXY,DEF,-1,4,0.01,0.345  ABC,DEF,GHI,-5,-8,-0.6,0.488   

But the same command on a bigger file gives an incorrect result. (The file I am looking to sort has 4M rows) Input:

ABC,DEF,GHI,-5,-8,-0.6,0.0488   XYZ,JKL,MNO,3,-5,0.2,-0.0342   STU,WXY,DEF,-1,4,0.01,0.0345   JKL,JKL,GHI,-2,-3,0.31,-0.0524   QRS,GHI,YUT,-3,-1,0.20,-0.0503   HUR,JTL,ZST,1,1,0.52,-0.0556   FTT,JL,MKI,0,2,0.21,-0.0529   FTC,JKL,ERW,-1,6,0.23,-0.0441   HJI,MHP,VGT,1,-6,0.80,-0.0433   BUT,IOP,HGT,2,2,0.2,-0.0439   XYZ,BGY,MNO,-2,1,0.01,-0.0416   

Where does systemd get the build time in order to advance?

Posted: 22 Sep 2021 09:34 AM PDT

On bootup, systemd gives me

System time before build time, advancing clock

if the hardware clock is older than the build time.

But where does it get this build time? It advances the time to 09/Sept/2020

But uname -v gives me 15/Feb/2021

and /etc/timestamp contains 21/July/2021.

So where does systemd get this build time from?

Mac Terminal Git + Less doesn't show the first line of output

Posted: 22 Sep 2021 10:12 AM PDT

I have problems with git and less commands output in the standard Mac Terminal app.

For some reason, when I do git log or something else requiring less, it always skips the first line of output. There is no way to see it.

In older OS versions I used to resize the Terminal window back and forth and the first line appeared eventually. But now this trick was "fixed" and Terminal output rendering remains the same when you resize.

Pure less call without git works fine. I can do cat file | less and I can see the first line.

What are some very basic hardening steps a novice can take to better secure their Linux system?

Posted: 22 Sep 2021 08:51 AM PDT

I've read that there are a lot of issues with Linux security. Most of them are covered in this article by a security researcher. The same security researcher also has a Linux hardening guide, but it is way too advanced for me. As someone who is totally new to Linux, are there any steps I can take to make my system reasonably secure and private?

In case it matters, I plan on using Pop!_OS 21.04 (which is an Ubuntu-based distribution) though I'm open to alternatives if there is a different "just works" distribution with more security features or faster security updates.

EDIT: I should've specified, this will be for personal use on a laptop, either at home or out and about. Not as a server or anything special.

What are my options for a mix of vm-like features and container-like speed?

Posted: 22 Sep 2021 08:53 AM PDT

I want to create "something in between a VM and a container", because:

  • A regular VM is slow
  • A container doesn't emulate a system well enough

More specific:

  • What I certainly want to avoid:
    • Virtualized hardware (too heavy)
  • What I certainly need:
    • The ability to control the resources, more specifically: memory, disk and cpu
    • A /proc that acts extremely similar to a "real" one (e.g. echo 1 > /proc/sys/kernel/sysrq ; echo b > /proc/sysrq-trigger should trigger a reboot)
    • Good isolation from the host (e.g. the previous command should not reboot the host)
    • Ability to run a lightweight Linux distro
  • What I don't need but I don't mind having:
    • The ability to use X11 without enforcing it
  • What I would like but could also live without:
    • A virtualized kernel

What technologies would fit my needs ?

Destination server files moved and Rsync copying same fiels again

Posted: 22 Sep 2021 09:06 AM PDT

I am using rsync for a longtime and it works perfectly as required, but I came across a situation where the destination server files are moved every few seconds and rsync copying the same files again from local sftp server. I was using --ignore-existing command but it does not work too in this situation.

sshpass -p "ABCDE" rsync   -avvtzh   --ignore-existing -e  "ssh -o StrictHostKeyChecking=no"  --log-file="/home/toor/log/uc.log"   admin@71.122.227.193:share/CACHEDEV1_DATA/Lanein1/Unicard/ /home/toor/UCDownloads/  

how can i see the driver in use you a curien device thats does not seam to be listed with lspci?

Posted: 22 Sep 2021 10:17 AM PDT

I am trying to find the driver in use for my touch screen but lspci don't seam to see it

however runing cat /proc/bus/input/devices i can see it as

I: Bus=0018 Vendor=0000 Product=0000 Version=0000  N: Name="Elan Touchscreen"  P: Phys=  S: Sysfs=/devices/pci0000:00/0000:00:16.3/i2c_designware.3/i2c-3/i2c-ELAN0001:00/input/input6  U: Uniq=  H: Handlers=mouse1 event6   B: PROP=2  B: EV=b  B: KEY=400 0 0 0 0 0  B: ABS=6e1800001000003  

Full output of lspci:

00:00.0 Host bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge (rev 0b)  00:00.1 Signal processing controller: Intel Corporation Device 5a8c (rev 0b)  00:00.2 Non-Essential Instrumentation [1300]: Intel Corporation Device 5a8e (rev 0b)  00:02.0 VGA compatible controller: Intel Corporation HD Graphics 500 (rev 0b)  00:03.0 Multimedia controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit (rev 0b)  00:0e.0 Multimedia audio controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster (rev 0b)  00:0f.0 Communication controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine (rev 0b)  00:14.0 PCI bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #1 (rev fb)  00:15.0 USB controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI (rev 0b)  00:16.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #1 (rev 0b)  00:16.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #2 (rev 0b)  00:16.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #3 (rev 0b)  00:16.3 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #4 (rev 0b)  00:17.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #5 (rev 0b)  00:17.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series I2C Controller #6 (rev 0b)  00:18.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #1 (rev 0b)  00:18.1 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #2 (rev 0b)  00:18.2 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series HSUART Controller #3 (rev 0b)  00:19.0 Signal processing controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SPI Controller #1 (rev 0b)  00:1b.0 SD Host controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SDXC/MMC Host Controller (rev 0b)  00:1c.0 SD Host controller: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller (rev 0b)  00:1f.0 ISA bridge: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface (rev 0b)  00:1f.1 SMBus: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller (rev 0b)  01:00.0 Network controller: Intel Corporation Wireless 7265 (rev a1)  

and full output of cat /proc/bus/input/devices:

I: Bus=0011 Vendor=0001 Product=0001 Version=ab83  N: Name="AT Translated Set 2 keyboard"  P: Phys=isa0060/serio0/input0  S: Sysfs=/devices/platform/i8042/serio0/input/input0  U: Uniq=  H: Handlers=sysrq kbd leds event0   B: PROP=0  B: EV=120013  B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe  B: MSC=10  B: LED=7    I: Bus=0019 Vendor=0000 Product=0005 Version=0000  N: Name="Lid Switch"  P: Phys=PNP0C0D/button/input0  S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:14/PNP0C09:00/PNP0C0D:00/input/input1  U: Uniq=  H: Handlers=event1   B: PROP=0  B: EV=21  B: SW=1    I: Bus=0019 Vendor=0000 Product=0001 Version=0000  N: Name="Power Button"  P: Phys=PNP0C0C/button/input0  S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0C:00/input/input2  U: Uniq=  H: Handlers=kbd event2   B: PROP=0  B: EV=3  B: KEY=10000000000000 0    I: Bus=0019 Vendor=0000 Product=0003 Version=0000  N: Name="Sleep Button"  P: Phys=PNP0C0E/button/input0  S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input3  U: Uniq=  H: Handlers=kbd event3   B: PROP=0  B: EV=3  B: KEY=4000 0 0    I: Bus=0019 Vendor=0000 Product=0001 Version=0000  N: Name="Power Button"  P: Phys=LNXPWRBN/button/input0  S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input4  U: Uniq=  H: Handlers=kbd event4   B: PROP=0  B: EV=3  B: KEY=10000000000000 0    I: Bus=0018 Vendor=04f3 Product=00b7 Version=0000  N: Name="Elan Touchpad"  P: Phys=  S: Sysfs=/devices/pci0000:00/0000:00:17.0/i2c_designware.4/i2c-4/i2c-ELAN0000:00/input/input5  U: Uniq=  H: Handlers=mouse0 event5   B: PROP=5  B: EV=b  B: KEY=e520 10000 0 0 0 0  B: ABS=663800013000003    I: Bus=0018 Vendor=0000 Product=0000 Version=0000  N: Name="Elan Touchscreen"  P: Phys=  S: Sysfs=/devices/pci0000:00/0000:00:16.3/i2c_designware.3/i2c-3/i2c-ELAN0001:00/input/input6  U: Uniq=  H: Handlers=mouse1 event6   B: PROP=2  B: EV=b  B: KEY=400 0 0 0 0 0  B: ABS=6e1800001000003    I: Bus=0003 Vendor=0bda Product=5520 Version=8511  N: Name="Integrated_Webcam_HD: Integrate"  P: Phys=usb-0000:00:15.0-5/button  S: Sysfs=/devices/pci0000:00/0000:00:15.0/usb1/1-5/1-5:1.0/input/input7  U: Uniq=  H: Handlers=kbd event7   B: PROP=0  B: EV=3  B: KEY=100000 0 0 0    I: Bus=0003 Vendor=0bda Product=565d Version=8606  N: Name="Integrated_Webcam_5M: Rear Inte"  P: Phys=usb-0000:00:15.0-8/button  S: Sysfs=/devices/pci0000:00/0000:00:15.0/usb1/1-8/1-8:1.0/input/input8  U: Uniq=  H: Handlers=kbd event8   B: PROP=0  B: EV=3  B: KEY=100000 0 0 0    I: Bus=0018 Vendor=2d1f Product=002c Version=0100  N: Name="WCOM50C1:00 2D1F:002C"  P: Phys=i2c-WCOM50C1:00  S: Sysfs=/devices/pci0000:00/0000:00:17.1/i2c_designware.5/i2c-5/i2c-WCOM50C1:00/0018:2D1F:002C.0001/input/input9  U: Uniq=  H: Handlers=mouse2 event9   B: PROP=2  B: EV=1b  B: KEY=1c03 0 0 0 0 0  B: ABS=d000003  B: MSC=10    I: Bus=0018 Vendor=2d1f Product=002c Version=0100  N: Name="WCOM50C1:00 2D1F:002C"  P: Phys=i2c-WCOM50C1:00  S: Sysfs=/devices/pci0000:00/0000:00:17.1/i2c_designware.5/i2c-5/i2c-WCOM50C1:00/0018:2D1F:002C.0001/input/input10  U: Uniq=  H: Handlers=mouse3 event10   B: PROP=0  B: EV=1b  B: KEY=c03 0 0 0 0 0  B: ABS=d000003  B: MSC=10    I: Bus=0003 Vendor=0572 Product=1b08 Version=0111  N: Name="Synaptics Hi-Res Audio"  P: Phys=usb-0000:00:15.0-1/input3  S: Sysfs=/devices/pci0000:00/0000:00:15.0/usb1/1-1/1-1:1.3/0003:0572:1B08.0002/in  U: Uniq=000000000000000000000000  H: Handlers=kbd event11   B: PROP=0  B: EV=13  B: KEY=40 0 0 0 0 0 0 1000000000 c000000000000 0  B: MSC=10  

systemd: Failed at step CHDIR spawning /bin/sh: No such file or directory

Posted: 22 Sep 2021 10:01 AM PDT

I'm trying to create a systemd service. I see this error message in my journal.

Failed at step CHDIR spawning /bin/sh: No such file or directory  

What causes this?

How to clear history in zsh

Posted: 22 Sep 2021 09:26 AM PDT

I'm looking for the zsh equivalent of the bash command history -c, in other words, clear the history for the current session. In zsh history -c returns 1 with an error message history: bad option: -c.

Just to clarify, I'm not looking for a way to delete the contents of $HISTFILE, I just want a command to reset the history to the same state it was in when I opened the terminal. Deleting the contents of $HISTFILE does the opposite of what I want: it deletes the history I want to preserve and preserves the history I want to delete (since current session's history would get appended to it, regardless if its contents was previously erased).

There is a workaround I use for now, but it's obviously less than ideal: in the current session I set HISTFILE=/dev/null and just close and reopen the terminal. This causes the history of the closed session not be appended to $HISTFILE. However, I'd really like something like history -c from bash, which is much more elegant than having to close and restart the terminal.

HPLIP -> HPAIO Error during device I/O

Posted: 22 Sep 2021 09:06 AM PDT

I'm running Chaos Calmer 15.05 (openwrt firmware) in a TPLINK WDR3600 and I'm trying to install SANE + HPLIP in order to get scanner over lan network.

I installed sane-libs and sane-daemon + dependencies from official distribuition feed (for Chaos Calmer) and because HPLIP is not available for Chaos Calmer, I had to install HPLIP for 14.07 in third distribuition url, I don't know if the error below is because of this "version", but.... Well... Using sane-find-scanner I get scanner found out by the system, and scanimage -L returns me:

device `hpaio:/usb/HP_LaserJet_Professional_M1132_MFP?serial=000000000SS17TR2PR1a' is a Hewlett-Packard HP_LaserJet_Professional_M1132_MFP all-in-one

Although scanimage -T returns:

scanimage: open of device hpaio:/usb/HP_LaserJet_Professional_M1132_MFP?serial=000000000SS17TR2PR1a failed: Error during device I/O

Can someone help me?

PS: Sane is returning me error:

root@OpenWrt:~# saned -d  [saned] main: starting debug mode (level 2)  [saned] saned (AF-indep+IPv6) from sane-backends 1.0.25 starting up  [saned] do_bindings: [0] bind failed: Address already in use  [saned] do_bindings: [1] bind failed: Address already in use  [saned] do_bindings: couldn't bind an address. Exiting.  [saned] FATAL ERROR; bailing out, waiting for children...  [saned] bail_out: all children exited  

Need write permissions to install themes on Linux Mint 17 "Rebecca" Mate

Posted: 22 Sep 2021 11:03 AM PDT

Just installed Linux Mint 17 "Rebecca" Mate. I'm trying to install a new theme and am directed to

http://gnome-look.org/index.php?xcontentmode=167

I've downloaded a couple and their instructions request that contents are copied to

/usr/share/themes

However, I don't have writing permissions to copy to this folder. I carried out a workaround to basically force the download into /themes, but encountered a fairly obstructive error upon booting wherein the ICE authority file could not be updated. This has since been resolved.

What's a successful method?

Thanks.

How to find and replace string without use command Sed?

Posted: 22 Sep 2021 09:40 AM PDT

As we all know, sed is greatly efficient to find and replace string, for example find 'a' and replace it to 'b': sed 's/a/b/g'.

Is it possible to do this with other command or shell script instead of sed?

This is for a cropped linux systems for TV that does not have the sed command. So I have to use other commands or scripts instead of sed 's/a/b/g'. –

Sending input to a screen session from outside

Posted: 22 Sep 2021 10:40 AM PDT

My scenario is this:

I have a screen session running in a remote location. Inside this screen is a consoled-based program. When run without screen, this program starts in the terminal and accepts commands on its standard input.

What I want is a way to remotely send a command to screen so that this command is received by the console program. Maybe like this:

My PC -> SSH Send Msg Auto -> Screen Session -> Program (Run command received)

So from a remote PC I can send via SSH commands to the screen which sends them to the program. The program accepts them and executes them.

No comments:

Post a Comment