Tuesday, September 7, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


i install xming in my windows system and Enable X11 forwarding" box is checked but no output

Posted: 07 Sep 2021 11:05 AM PDT

installed xming (6.9.0.31)in my windows system and Enable X11 forwarding" box in checked in putty but no output Command :xclock -bash: xclock: command not found

what are the other configuratons i need to check.

building Debian package without associated packages that are bundled together

Posted: 07 Sep 2021 10:54 AM PDT

When I am building a debian package, often many related packages that are bundled together are being build, and also the foo-dbgsym-* versions and foo-doc packages.

For example, even relatively simple package such as make, will build additional packages:

make-dbgsym_4.2.1-1.2_amd64.deb  make-guile-dbgsym_4.2.1-1.2_amd64.deb  make-guile_4.2.1-1.2_amd64.deb  make_4.2.1-1.2_amd64.deb  

Can I tell the build system to only build make and not make-guile ?

Here is the process that I am using for building the package:

apt-get source make  cd make*  dpkg-buildpackage --build=binary --no-sign  

Is there a general process how I can specify which packages I want to build?

Make is a simple example, but larger packages build many versions of package which I am not interested in, which need dependent libraries installed, and the build process takes longer.

Is it possible to pipe output of ls into grep, but with grep standing first?

Posted: 07 Sep 2021 10:33 AM PDT

I'm doing a small exercise with command injections, and I have this statement that I can make injections into:

grep -i $key dictionary.txt  

Where $key is the part I can inject something into. Now, I know the intended solution here is to use ; to terminate one statement, and then construct a new one. But I wanted to see if I could use the grep in my attempt.

So what I want to do is to run ls, in order to see the files in a specific directory. What I want to do, is to use the two in conjunction like so:

ls | grep -i "."  

But, Since I'm doing an injection, I need the grep -i to be first. So is there anything I can do? perhaps a pipe operator that works in the "reverse" order?

grep -i "." <| ls  

EDIT

There seems to be a bit of confusion as to what I am doing here, and what I am trying to achieve.

I am doing some introductory exercises on pen-testing.

My current exercise is to do a injection on a website, that has this string in it:

grep -i $key dictionary.txt  

and then uses that string to run a command. I need to inject something into this string, which will be a command injection. I do no have control over the string as it is already written on the server, and thus I cannot put anything in to the left of grep -i

I have a solution already, where I inject the following:

; ls /etc/natas_webpass #  

Which then (when I inject it) creates this command which runs on the server

grep -i ; ls /etc/natas_webpass # dictionary.txt  

Buy I would like to try to solve this exercise not using the semicolon, but perhaps actually use grep that i already there

EDIT 2

A suggestion has been made that I am simply looking for <(ls). I tried testing this by running:

$ grep -i <(ls)  

This does not work though, nothing happens

Easiest IMAP archiver for multiple accounts

Posted: 07 Sep 2021 09:56 AM PDT

I'm pretty new to linux, Im running Ubuntu at the moment. On windows I was using a service called "mailstore" to archive the entire contents of multiple email accounts. I've seen a few searching google, but a lot of the "verbage" goes way over my head at the moment. All the accounts being archived use yahoo, and I dont need to be able to send mail.

Would be great to be able to add a full list of the accounts instead of manually adding them one by one. Also a plus if it has an integrated mail client for viewing emails as well, but thats not completely necessary. Would love any suggestions or links to any great guides for newbies to linux like me. Thanks!

How do I connect to a smb (samba) share using midnight commander?

Posted: 07 Sep 2021 11:14 AM PDT

After I select left/SMB link... and enter the urn and user name and password I see this error message

Cannot chdir to "/smb://host.network/share"

I've tried different variant of the urn

  • smb://host.network/share
  • smb://user@host.network/share
  • //host.network/share
  • //user@host.network/share

Where on the first two are documenten in the F1 screen. Could this related to a version restriction on the server side? Needless to say \\host.network\share works like a breeze in Microsoft Window's File Explorer. Also smbclient //host.network/share gets a connection.

$ mc --version  GNU Midnight Commander 4.8.26  Built with GLib 2.68.0  Built with S-Lang 2.3.2 with terminfo database  With builtin Editor  With subshell support as default  With support for background operations  With mouse support on xterm and Linux console  With support for X11 events  With internationalization support  With multiple codepages support  With ext2fs attributes support  Virtual File Systems:   cpiofs, tarfs, sfs, extfs, ftpfs, sftpfs, fish, smbfs  Data types:   char: 8; int: 32; long: 64; void *: 64; size_t: 64; off_t: 64;  

Problem with XServer - _XSERVTransSocketUNIXAccept: accept() failed

Posted: 07 Sep 2021 10:17 AM PDT

I run a headless Manjaro server with Xhost and Xvfb (for a display) and after about 236 instances of a program running, the server starts lagging a lot and the error _XSERVTransSocketUNIXAccept: accept() failed is printed infinitely on the screen. Does anybody know of a fix for this? I've searched the Internet for solutions, but I've come up empty. I've read in one forum post that it's because of «clients using lots of true-type fonts», but even if it is I have no idea what to do to fix it.

Can't acces Kali Linux interface

Posted: 07 Sep 2021 09:49 AM PDT

I'm using Kali Linux OS I'm a beginner yesterday I opened Linux OS but I can't access it's interface it's just showing terminal and I can't even close it because the closing buttons are missing in the terminal and I also can't do anything except typing in terminal please help me with this problem as I said before iam a beginner in Linux OS I can turn on Firefox but I couldn't type anything and closing Firefox button is missing too enter image description here

Failed to install Debian11 using apt-get command

Posted: 07 Sep 2021 09:27 AM PDT

I tried to install Debian with "apt-get install [-Y] package" And the result is "unable to locate package package" Anyone can help to solved this problem?

Installing Nodejs on Kali Linux (E: Sub-process /usr/bin/dpkg returned an error code (1))

Posted: 07 Sep 2021 08:52 AM PDT


Trying to install NodeJS on Kali Linux but then i got error, Idk what to do cuz this is my first time using kali.

dpkg: error processing archive /var/cache/apt/archives/nodejs_16.8.0-deb-1nodesource1_amd64.deb (--unpack):   trying to overwrite '/usr/share/doc/nodejs/api/process.html', which is also in package nodejs-doc 12.21.0~dfsg-3  dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)  Errors were encountered while processing:   /var/cache/apt/archives/nodejs_16.8.0-deb-1nodesource1_amd64.deb  E: Sub-process /usr/bin/dpkg returned an error code (1)  

Problem with command for memory stress in linux - Unexpected end of string

Posted: 07 Sep 2021 09:36 AM PDT

I've problem with this command in python.

stress-ng --vm-bytes $(awk '/MemAvailable/{printf "%d\n", $2 * 0.95;}' < /proc/meminfo)k --vm-keep -m 1  

I need a double quotation marks on the beginning and end of command, like:

"stress-ng --vm-bytes $(awk '/MemAvailable/{printf "%d\n", $2 * 0.9;}' < /proc/meminfo)k --vm-keep -m 1"  

After escape inside quotation marks, I have unexpected end of string.

"stress-ng --vm-bytes $(awk '/MemAvailable/{printf \"%d\n\", $2 * 0.9;}' < /proc/meminfo)k --vm-keep -m 1"  

Does anyone have an idea how to deal with this?

Permanently open tun0 interface

Posted: 07 Sep 2021 08:31 AM PDT

I have CentOS on the host server and I installed OpenVPN on it. when I run openvpn --config config.ovpn tun0 opens and I can login to the host server from jumpbox server.

but when I do ctrl+c on the host server, the command openvpn --config vpn.servers-hroffice-proxmox-pbx3.ovpn terminates and so does the interface tun0 which kills connection from jumpbox server.

What shall I do to keep tun0 interface alive? Iptables are not running on the server and netstat doesn't show 1194 to be opened

WGET gives "No such file or directory" error when -O option is a variable

Posted: 07 Sep 2021 08:52 AM PDT

When I do this, it works perfectly and downloads the file at the required path.

wget -O ~/Temp/my.file "https://github.com/sometool/releases/latest/download/the.file"  

But when I do this:

PATH="~/Temp/my.file"  wget -O $PATH "https://github.com/sometool/releases/latest/download/the.file"  

It says:

~/Temp/my.file: No such file or directory

I've tried with or without quotes, wrapped in $(echo $PATH), always the same error.

I am using MacOS Terminal.

Difference between linux file system and directory

Posted: 07 Sep 2021 07:44 AM PDT

I am bit confused between file systems and directories in Linux, what is the difference and when do I need to create file system and mount it while I can simply create a directory ?

Odd behaviour of find command

Posted: 07 Sep 2021 08:05 AM PDT

I have come across some odd behaviour while using the find command that I cannot find an explanation for.

I have a .txt file with 1 filename per line and I am using the find command to recursively search through my database for that file. When I use the command like this:

for filename in `cat filelist.csv`; do  find /location*/time*/ -name *${filename}*txt  done  

I get the expected output of 1 output per line. However when I then use the same command but set the output as a variable (which I ultimately need to do):

for filename in `cat filelist.csv`; do  out=`find /location*/time*/ -name *${filename}*txt`  echo ${out}  done  

The find command seems to be printing all the matching files in a folder in on the same line. I have 2 questions:

  1. What is causing this behaviour?
  2. How can I get find to output each matching file (even if there are many matching files in a folder) to a new line as a variable?

Cheers!

Run foreground process until background process exited in shell

Posted: 07 Sep 2021 09:42 AM PDT

I'm running QEMU virtual machine in -daemonize mode and then spawn an arbitrary foreground (possibly interactive) process intended to interact with the QEMU instance. In general once foreground process completes I do a cleanup of QEMU instance via pidfile:

qemu-system ... -pidfile ./qemu.pid -daemonize    /my/custom/interactive/process    pkill -F ./qemu.pid  

However in some scenarios QEMU could exit independently and my foreground process continues to run. But I would like to stop it in case. So the behavior of my custom interactive process should be like:

tail -f --pid=./qemu.pid /dev/null  

How can I do that nicely? Maybe there is some kind of timeout-like wrapper, so I could run something like:

trackpid ./qemu.pid /my/custom/interactive/process  

How to update initramfs from kickstart when installing to eMMC disk

Posted: 07 Sep 2021 08:56 AM PDT

I'm trying to install Centos 8 to an embedded computer fitted with onboard eMMC storage. The installation completes successfully but the system does not boot.

After reset, the boot menu is displayed showing the kernel versions but the boot process goes no further.

A few articles mention that Centos/anaconda does not include the proper drivers for accessing eMMC devices in the newly created initramfs file on the target machine:

Which says you need to add some additional drivers to the initramfs files:

dracut -f --add-drivers " mmc_core mmc_block sdhci sdhci-pci "  

I tried that by switching to a different console after a normal installation completed but dracut failed with:

dracut: Cannot find /usr/lib/dracut/dracut-init.sh.

This Red Hat article supposedly explains how to get around that problem and update the initramfs but I cannot access.

Anyone know how I can get the correct drivers into the initramfs during the kickstart installation?

How to change a column name in multiple files?

Posted: 07 Sep 2021 07:55 AM PDT

I am wanting to change the name of column number 5 in each file to the file name itself for all files in a given directory. I have 250 files in the directory and the column names are tab-delimited.

At the moment, all files have identical column names. Example of file met-d-Glucose.txt:

                  FID  IID  PHENO    CNT SCORESUM    3999347013_R01C01    1     -9     21 -0.217178    3999347013_R01C02    1     -9     21 -0.054835    3999347013_R02C01    1     -9     21 -0.130287    3999347013_R02C02    1     -9     21 0.0062288    3999347013_R03C01    1     -9     21 -0.0933029    3999347013_R03C02    1     -9     21 0.0434727  

I want to change the name of column 5 to the file name. e.g. the output for the example file named met-d-Glucose.txt above would be:

                  FID  IID  PHENO    CNT met-d-Glucose.txt    3999347013_R01C01    1     -9     21 -0.217178    3999347013_R01C02    1     -9     21 -0.054835    3999347013_R02C01    1     -9     21 -0.130287    3999347013_R02C02    1     -9     21 0.0062288    3999347013_R03C01    1     -9     21 -0.0933029    3999347013_R03C02    1     -9     21 0.0434727  

The original column name is always SCORESUM. The header line is always the first line. There are never columns after the 5th column. SCORESUM does not appear anywhere else.

Can not execute hello world c program with user other than root

Posted: 07 Sep 2021 10:10 AM PDT

I have hello world c file myCFile.c on x86 embedded board on Debian OS.

#inlcude <stdio.h>  int main()  {    printf("hello\n")  }  

I compile the program: gcc myCFile.c however

tester@localhost:~/test$ ./a.out  -bash: ./a.out: Permission denied  tester@localhost:~/pravin$ ls -lrt  total 44  -rwxrwxrwx 1 tester test   54 Sep  7 07:33 myCFile.c  -rwxrwxrwx 1 tester test   16608 Sep  7 07:33 a.out  

however if I copy a.out to /run/user/1000, i can execute it.

tester@localhost:/run/user/1000$ ls  a.out  bus  gnupg  systemd  

Also, I can execute when I compile c file with root user and execute it, I can execute it.

root@localhost:~# gcc myCFile.c  root@localhost:~# ./a.out  hello  root@localhost:~#  

Is it something related NOEXEC flag?

My /etc/fstab:

$ cat /etc/fstab   # Begin /etc/fstab   /dev/root   /       ext4        defaults        0   0 proc        /proc       proc        nosuid,noexec,nodev 0   0 sysfs     /sys        sysfs       nosuid,noexec,nodev 0   0 devpts          /dev/pts    devpts      gid=5,mode=620      0   0 tmpfs       /run        tmpfs       defaults,size=1500M 0   0 devtmpfs    /dev        devtmpfs    mode=0755,nosuid    0   0    # End /etc/fstab   LABEL=persistent    /persistent ext4    defaults,data=journal,noatime,nosuid,nodev,noexec   0   2   /persistent/home    /home   none    defaults,bind   0   0   /persistent/tmp /tmp    none    defaults,bind   0   0   

Find all files in directory that have over 130 English characters or 43 asian characters

Posted: 07 Sep 2021 09:05 AM PDT

I'm trying to transfer files on my NAS, but I will get this error "The name of a file or a folder within an encrypted shared folder cannot exceed 143 English characters or 47 Asian (CJK) characters" is there a command in the shell to find every file that meets that?

AWK: Get the line where the maximum of a column value occurs

Posted: 07 Sep 2021 10:22 AM PDT

I am interested in the maximum value of the 5th column. But, I also want to be able to capture the 6th and the 9th values of that row into an array. How do I do this?

The command below tries to get only the 5th column value.

myVar=$(bash myScript.sh | awk -v max=0 '{if($5>max){max=$5;max6=$6;max9=$9}}END{print $5}')  

Edit: print $5 is printing the maximum of the 5th column.

Thanks.

How can I get xeyes to work? - XQuartz Display Error on Local System

Posted: 07 Sep 2021 08:06 AM PDT

I installed XQuartz on my Mac (Big Sur, v. 11.5.2) using the download available on https://www.xquartz.org/ (XQuartz-2.8.1.dmg), but I have been unable to use it. I've been failing to fix this issue for the past couple of weeks, and I'm really hoping someone can help point me in the right direction.

I've been using xeyes to test the installation and get the following response:

(base) magnoliafork ~ % xeyes                              Error: Can't open display: :0.0  (base) magnoliafork ~ % echo "$DISPLAY"  :0.0  

One of the ways in which I have tried fixing it is to set my DISPLAY inside my .zshrc file to :0, localhost=0, and just the number 0. I also tried putting my IP address in front of the :0.0 at one point. None of those solutions worked.

##### DISPLAY, for plotting  PATH="/opt/:$PATH"  export DISPLAY  DISPLAY=":0.0"  

Someone in another thread recommended changing the default options in the sshd_config file, so I updated the X11 options as shown below:

#AllowAgentForwarding yes  #AllowTcpForwarding yes  #GatewayPorts no  X11Forwarding yes  X11UseForwarding yes  X11DisplayOffset 10  X11UseLocalhost yes  #PermitTTY yes  #PrintMotd yes  #PrintLastLog yes  #TCPKeepAlive yes  #PermitUserEnvironment no  #Compression delayed  #ClientAliveInterval 0  #ClientAliveCountMax 3  #UseDNS no  #PidFile /var/run/sshd.pid  #MaxStartups 10:30:100  #PermitTunnel no  #ChrootDirectory none  #VersionAddendum none  

It's still not working, and I suspect the previous solution was to fix the case where you can get XQuartz to work locally but not through ssh. I can't even get it to work locally, and at this point, I have no idea what to try next. Any ideas would be really helpful!

Don't know if this is helpful, but I copied this from my console:

X11.app: do_start_x11_server(): argc=7       argv[0] = /opt/X11/bin/Xquartz       argv[1] = :0       argv[2] = -nolisten       argv[3] = tcp       argv[4] = -iglx       argv[5] = -auth       argv[6] = /Users/magnoliafork/.serverauth.2211  

More info for comments:

  • When I run xeyes from the Apple terminal, the XQuartz icon does not pop up.
  • If I try to run XQuartz directly from the Apple terminal using the xquartz command, the XQuartz icon pops up, and then I get a problem report from Apple that says, "Cannot establish any listening sockets - Make sure an X server isn't already running"
  • I can run xeyes from the XQuartz terminal "xterm", but I would really prefer the Apple terminal since it is more functional.

Current date in cal is not highlighted in recent Debian

Posted: 07 Sep 2021 08:02 AM PDT

As answered in Highlight the current date in cal

the current date in output form cal is automatically highlighted (reverse colors) if the output goes to terminal.

That's what I had always been getting.

However, with my current Debian GNU/Linux, it is not the case any more, and I'm wondering what the fix is.

enter image description here

$ echo $TERM  xterm    $ lsb_release -a   No LSB modules are available.  Distributor ID: Debian  Description:    Debian GNU/Linux bullseye/sid  Release:        testing  Codename:       bullseye  

Command to DD Write Only if Different?

Posted: 07 Sep 2021 10:05 AM PDT

I usually keep image based backups of certain computer drives that I generally create with a dd command piped into gzip (or similar). To restore a backup I simply reverse the process. Works great for spinning drives, however, with SSDs I hate wasting writes to restore data that is already present on the drive. I might write 1TB to an SSD and shorten it's life by a percent or two when technically only a few gigabytes of data differed between what's already on the drive and what's in the image backup.

So I was wondering, is there a way to restore a dd image but only write data to the drive if the data differs? It doesn't have to be a byte by byte check, even if it compares blocks of data and then writes that block only if any data in that block differed that would be very helpful.

htop / top with specifying process name filter on the command line - at program startup?

Posted: 07 Sep 2021 11:04 AM PDT

I'm on Ubuntu 18.04. I'm already aware that I can start htop, and then hit F4 for filter, then type or paste a process name search query (say, gphoto2 for looking for gvfs-gphoto2-volume-monitor.service), and then htop filters the shown processes: if there is no such process, it shows nothing, if it starts later, htop shows it then.

Now, I would like to start htop with filtering already from the command line, say:

htop --filter="gphoto2"  

... and get the exact same behavior as if hitting F4 and typing in the terminal UI. This would be useful if integrating the command into, say, a tmux session.

I browsed through man htop, but unfortunately I cannot see such command line/option. Closest I've seen is -p, which as noted in how to show only processes *not* matching a filter? :

Something like

htop -p "$(pgrep -vfd, 'java|python')"  

This has the obvious disadvantage of not accounting for processes that start after htop starts running

So, is there a way to set up process name filtering on the command line at startup, such that it takes account for newly killed or spawned processes (as if hitting F4 in htops terminal UI) - for htop, or top, or any other similar program?

Send command to USB device (FingerPrint Scanner) with no driver for Linux

Posted: 07 Sep 2021 08:35 AM PDT

I am trying to create an application with remote controlling a Fingerprint sensor (Guide included on link) for enrolling and identifying fingerprints on are Raspberry PI 3 Model. There is a SDK_DEMO for this particular functionality on Windows only, which you can find in the Guile I mentioned above.

  • SDK_DEMO is written in C++ on Visual studio so I can't manipulate the code to run it on Raspberry Pi 3.

From the SDK_DEMO source code I figured out which command I need to send to execute tasks.

The Commands

CMD_NONE                = 0x00,  CMD_OPEN                = 0x01,  CMD_CLOSE               = 0x02,  CMD_USB_INTERNAL_CHECK  = 0x03,  CMD_CHANGE_BAUDRATE     = 0x04,  CMD_MODULE_INFO         = 0x06,    CMD_CMOS_LED            = 0x12,    CMD_ENROLL_COUNT        = 0x20,  CMD_CHECK_ENROLLED      = 0x21,  CMD_ENROLL_START        = 0x22,  CMD_ENROLL              = 0x23,  CMD_ENROLL1             = 0x23,  CMD_ENROLL2             = 0x24,  CMD_ENROLL3             = 0x25,  CMD_IS_PRESS_FINGER     = 0x26,    CMD_DELETE              = 0x40,  CMD_DELETE_ALL          = 0x41,    CMD_VERIFY              = 0x50,  CMD_IDENTIFY            = 0x51,  CMD_VERIFY_TEMPLATE     = 0x52,  CMD_IDENTIFY_TEMPLATE   = 0x53,    CMD_CAPTURE             = 0x60,    CMD_GET_IMAGE           = 0x62,  CMD_GET_RAWIMAGE        = 0x63,    CMD_GET_TEMPLATE        = 0x70,  CMD_ADD_TEMPLATE        = 0x71,  CMD_GET_DATABASE_START  = 0x72,  CMD_GET_DATABASE_END    = 0x73,    CMD_FW_UPDATE           = 0x80,  CMD_ISO_UPDATE          = 0x81,  CMD_FAKE_DETECTOR       = 0x91,    CMD_SET_SECURITY_LEVEL  = 0xF0,  CMD_GET_SECURITY_LEVEL  = 0xF1,    ACK_OK                  = 0x30,  NACK_INFO               = 0x31,  

SKD_DEMO recognised the FingerPrint sensor as Mass Storage and somehow was running the commands like that.

In Ubuntu though when I plug in the usb device I don't get any Mass storage mounting and on lsusb I get this:

enter image description here

I have be searching about this and tried to

echo "0x12" >> /dev/bus/usb/001/008  

But I got a write error for invalid argument.

Here are the terminal commands for the echo attempt:

enter image description here

Is there a way I can send raw commands with this format and executing actions without needing to write a driver for this USB device on Linux?

Debian + USB3 HDD + UAS: I/O errors

Posted: 07 Sep 2021 08:59 AM PDT

I'm running rsync to backup a remote machine to a USB hard drive on an ARM SBC and sometimes rsync just stops with "read error from input device (I/O error)". I believe the issue is related to UAS + USB 3.0 + rsync causing high I/O load, because of uas_eh_device_reset_handler on /var/log/messages:

sd 0:0:0:0: [sda] tag#1 data cmplt err -32 uas-tag 2 inflight:   sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x28 28 00 38 80 0a 68 00 00 a0 00  sd 0:0:0:0: [sda] tag#0 data cmplt err -32 uas-tag 1 inflight: CMD   sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 57 50 28 78 00 03 00 00  sd 0:0:0:0: [sda] tag#1 uas_eh_abort_handler 0 uas-tag 2 inflight: CMD   sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x28 28 00 38 80 0a 68 00 00 a0 00  sd 0:0:0:0: [sda] tag#2 uas_eh_abort_handler 0 uas-tag 3 inflight: CMD   sd 0:0:0:0: [sda] tag#2 CDB: opcode=0x2a 2a 00 19 47 7f 20 00 00 90 00  sd 0:0:0:0: [sda] tag#0 uas_eh_abort_handler 0 uas-tag 1 inflight: CMD   sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 57 50 28 78 00 03 00 00  scsi host0: uas_eh_device_reset_handler start  usb 5-1: reset high-speed USB device number 2 using ehci-platform  scsi host0: uas_eh_device_reset_handler success  sd 0:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08  sd 0:0:0:0: [sda] tag#0 Sense Key : 0x2 [current]   sd 0:0:0:0: [sda] tag#0 ASC=0x3a ASCQ=0x0   sd 0:0:0:0: [sda] tag#0 CDB: opcode=0x2a 2a 00 57 50 28 78 00 03 00 00  sd 0:0:0:0: [sda] tag#1 UNKNOWN(0x2003) Result: hostbyte=0x00 driverbyte=0x08  sd 0:0:0:0: [sda] tag#1 Sense Key : 0x2 [current]   sd 0:0:0:0: [sda] tag#1 ASC=0x3a ASCQ=0x0   sd 0:0:0:0: [sda] tag#1 CDB: opcode=0x2a 2a 00 19 47 7f 20 00 00 90 00  EXT4-fs warning (device sda1): ext4_end_bio:323: I/O error 10 writing to inode 13001563 (offset 0 size 73728 starting block 53014518)  

This SBC doesn't have a USB 3 port, however it still loads the hard drive with UAS. According to this, UAS is broken on some HD enclosure chips. The solution provided is to disable UAS, however:

1- If I blacklist UAS completely with blacklist uas into /etc/modprobe.d/blacklist-uas.conf I get:

lsusb -t      /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M          |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=, 480M  

Looking at Class=Mass Storage, Driver=, 480M => seems like the system doesn't load any other way to deal with the drive.

2- If I just try to disable UAS for a specific USB device, like the post recommended, it still loads with UAS:

echo options usb-storage quirks=174c:55aa:u | tee /etc/modprobe.d/blacklist-uas.conf  update-initramfs -u  reboot    (...)    dmesg | grep sda  [    2.488105] sd 0:0:0:0: [sda] 2930277168 512-byte logical blocks: (1.50 TB/1.36 TiB)  [    2.488584] sd 0:0:0:0: [sda] Write Protect is off  [    2.488592] sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00  [    2.489335] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA  [    2.539288]  sda: sda1  [    2.543875] sd 0:0:0:0: [sda] Attached SCSI disk  [    6.898109] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: errors=remount-ro,data=ordered    lsusb | grep ASMedia  Bus 005 Device 002: ID 174c:55aa ASMedia Technology Inc. ASM1051E SATA 6Gb/s bridge, ASM1053E SATA 6Gb/s bridge, ASM1153 SATA 3Gb/s bridge    lsusb -t  /:  Bus 05.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M      |__ Port 1: Dev 2, If 0, Class=Mass Storage, Driver=uas, 480M  

What am I doing wrong? Is it possible to disable UAS and make the system still use the HD any other way? Why does options usb-storage quirks=174c:55aa:u doesn't disable UAS as it should?

Thank you.

Some notes:

  • OS: Debian GNU/Linux 9.4 (stretch) kernel 4.14.18-sunxi64 from armbian
  • SBC: NanoPi NEO2

ssh-keyscan has no output

Posted: 07 Sep 2021 09:32 AM PDT

I have server script that automatically pulls down and installs a github repository. As part of the script, I'm running ssh-keyscan -H github.com >> ~/.ssh/known_hosts as the git user to automatically accept github's RSA key prior to checking out the repo.

I have successfully used this same script in a local vagrant instance, as well as on several servers. However, on one of the servers this doesn't work, because ssh-keyscan -H github.com doesn't return any output (I've tried this as the git user, my personal user, and as root, and the command acts the same). I can ping github.com, so it's not a connection issue; I can also run ssh-keyscan successfully on another server in the same network. I've tried upgrading SSH to see if that might be the issue, but it is already on the latest version for my distribution (CentOS 7).

Where would be a good place to start in troubleshooting this? I've tried searching StackExchange for issues related to 'ssh-keyscan', but I haven't yet found anything that fits this particular problem.

Not able to run Cisco Packet Tracer 7.0 even if installation is successful

Posted: 07 Sep 2021 08:06 AM PDT

I use Kali Linux and I am having a problem in running the Cisco Packet Tracer v7.0.

I have downloaded the PacketTracer70_64bit_linux.tar.gz file from www.netacad.com/group/offerings/packet-tracer/. And then I extracted the tar.gz file by writing the command

tar -zxvf PacketTracer70_64bit_linux.tar.gz  

Then I got into the folder PacketTracer70 which got created automatically after extraction.

The folder contents were as follows:

folder screenshot Then I ran the ./install command in the terminal and I got the following:

root@hacker:~/PacketTracer70# ./install    Welcome to Cisco Packet Tracer 7.0 Installation    Read the following End User License Agreement "EULA" carefully. You must  accept the terms of this EULA to install and use Cisco Packet Tracer.  Press the Enter key to read the EULA.......  

Then I accepted the terms and conditions as usual...

Then I was asked to install the package in opt/pt folder and I agreed as follows: installation successful message

then I got to the folder /opt/pt and tried

root@hacker:~# cd /opt/pt root@hacker:/opt/pt# packettracer  

But nothing happened after that. It just gave me the message "Starting Packet Tracer 7.0" and nothing happened.

root@hacker:~# cd /opt/pt  root@hacker:/opt/pt# packettracer  Starting Packet Tracer 7.0  root@hacker:/opt/pt#  

I am trying this second time and getting the same problem. How can I fix this problem?

realm command doesn't work correctly when used in script (CentOS 7)

Posted: 07 Sep 2021 10:01 AM PDT

I try to automate the authentication on CentOS 7 Hosts over my AD with the realm commands.

It totally works when I execute the following commands by myself.

$ yum -y install realmd oddjob oddjob-mkhomedir sssd samba-common  $ realm join -U admin domain.com  $ realm permit -g LinuxAdmins@domain.com  

In addition to that I replace the following lines in /etc/sssd/sssd.conf and restart sssd service.

use_fully_qualified_names = False  fallback_homedir = /home/%d/%u    $systemctl restart sssd  

After those steps I can log in on that specific CentOS Host with any permitted user of my Active Directory

Now the Problem:

If I run the following script on a CentOS Host as root it seems like everything has worked.

 yum -y install realmd oddjob oddjob-mkhomedir sssd samba-common   echo "Password" | realm join -U admin domain.com   realm permit -g LinuxAdmins@domain.com   sed -i -e 's/use_fully_qualified_names = True/use_fully_qualified_names = False/g' /etc/sssd/sssd.conf   sed -i -e 's#fallback_homedir = /home/%u@%d#fallback_homedir = /home/%d/%u#g' /etc/sssd/sssd.conf   systemctl restart sssd  

If I try to log in as a permitted AD user it says permission denied

I checked /etc/sssd/sssd.conf for any possible sed-caused problems, but that seems fine. Also running the command realm list seems like there is no problem.

# realm list  domain.com  type: kerberos  realm-name: DOMAIN.COM  domain-name: domain.com  configured: kerberos-member  server-software: active-directory  client-software: sssd  required-package: oddjob  required-package: oddjob-mkhomedir  required-package: sssd  required-package: adcli  required-package: samba-common  login-formats: %U  login-policy: allow-permitted-logins  permitted-logins:  permitted-groups: LinuxAdmins@domain.com  

The output of this command is exactly the same when I run it after manually executing the commands.

Anybody any idea how to handle that?

How to deal with tearing in Gentoo on NVIDIA?

Posted: 07 Sep 2021 09:02 AM PDT

See Why is video tearing such a problem in Linux? for the reasons behind why tearing is a problem in the first place, and why the usual "tricks" usually suggested (like "disable compositing", GLXVBlank true) simply don't work in general.

This question is more specific but still general enough for many users: How do you deal with tearing on Gentoo, using an NVIDIA based graphics card?

By "dealing with" I mean how do you either remove it, using some very specific setup arrived at by sheer brute force, or how do you at least minimize the effects?

I have tried both the proprietary and free drivers, different versions, different kernels, different X configurations and driver options. I have yet to try different window managers, because I simply don't have time to fiddle with that as well.

Instead of reinventing the wheel, maybe someone already knows of a good setup that will minimize these adverse effects while we wait for Wayland to get more traction. As kirill-a suggests in the other question: "So screen tearing issue may be solved by trying different drivers and configuring them."

What combination of window manager, drivers, kernel (please mention specific kernel options that are crucial), X configuration and media player will give me the best results?

No comments:

Post a Comment