Monday, November 8, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Why does apt say "selecting previously unselected package"?

Posted: 08 Nov 2021 11:35 AM PST

One of the most recognizable phrases of GNU/Linux is:

Selecting previously unselected package pkg.  

It appears in the output of apt install pkg.

Why? What is the benefit of mentioning that this package was previously unselected? Wouldn't "Selecting pkg." be sufficient? What does "previously unselected" even mean?

NFS4_Setfacl VS. Setfacl?

Posted: 08 Nov 2021 11:21 AM PST

So I have a hopefully easy question for all of the smart individuals out there regarding the commands mentioned in the title of this post. It's my understanding that when you use "setfacl" it's only directly on your NFS server and NFS_SETFACL you run on the clients only? Is that a correct statement?

If that is a correct statement, what about when your NFS server is an actual NAS filer like NetApp or Dell? Since at that point on Linux machines are clients, do you only run NFS4_setfacl?

What is the difference between the 2 commands and more importantly how or when do you decide to use which of the 2?

Hope that made sense.

Thanks in advance!

Storage Test not working

Posted: 08 Nov 2021 11:20 AM PST

My Crosh tab is saying that the storage_test_1 command is no longer supported, and I was just asking if this is a problem others had as well.

Maintenance script for "reverse login/typing"?

Posted: 08 Nov 2021 10:34 AM PST

Moin, in order to be able to help friends with problems on the RaspPi, I wrote a script that the friends start on their Rasp Pi using ssh to establish a reverse tunnel to my server. I can then log in with the default data pi:raspberry and search for errors.

I am now looking for a "reverse login" option for Linux computers without default users. Could I somehow redirect my keyboard entries to the xterm in which such a "universal" script was started? Or are there any other ideas?

Thanks

Apache PAM Credential Caching

Posted: 08 Nov 2021 10:19 AM PST

I use FreeIPA Authentication on Apache via PAM.

I am trying to enable credential caching for PAM, however socache does not cache PAM Credentials. I have tested socache using local accounts in htpasswd and those creds do get cached.

Every time there is a request on the served webpage, apache connects to FreeIPA to seek authentication.

Config:

<Location />    <If "%{SSL_CLIENT_S_DN_O} == 'IPA.CIPHER.LOCAL'">      SSLRequireSSL      AuthType Basic      AuthName "CIPHER Portal"      AuthBasicProvider socache PAM      AuthnCacheProvideFor PAM      AuthPAMService system-auth      <RequireAll>        Require ssl-verify-client        Require valid-user        Require ssl      </RequireAll>    </If>    SSLRequireSSL    AuthName "CIPHER Portal"    AuthType Basic    AuthBasicProvider socache file    AuthDigestProvider file    AuthUserFile /etc/httpd/conf/passwd    AuthnCacheProvideFor file    AuthGroupFile /etc/httpd/conf/group    <RequireAll>      Require ssl-verify-client      Require valid-user      Require ssl    </RequireAll>  </Location>    

Log File when using FreeIPA Account:

[Mon Nov 08 18:01:52.152536 2021] [socache_shmcb:debug] [pid 32678] mod_socache_shmcb.c(877): AH00851: shmcb_subcache_retrieve found no match  [Mon Nov 08 18:01:52.152544 2021] [socache_shmcb:debug] [pid 32678] mod_socache_shmcb.c(532): AH00836: leaving socache_shmcb_retrieve successfully  [Mon Nov 08 18:01:52.152550 2021] [authn_socache:debug] [pid 32678] mod_authn_socache.c(361): [client 172.27.225.10:54840] AH01684: Authn cache: no credentials found for cipher.arthur , referer: https://172.20.15.208/dashboards    

Can anyone assist in configuring a credential cache for Apache PAM Authentication so that a new request is not sent to FreeIPA every time?

Thank you

How to activate a PHP extension (php-memcached from AWS)?

Posted: 08 Nov 2021 10:09 AM PST

I want to install in Ubuntu 20.04 with PHP 7.4 the AWS ElastiCache Memcached Cluster Client to cache a WordPress website using the W3 Total Cache plugin.

For this, I followed the AWS docs, but for ubuntu I only have "To install PHP 5 on a Ubuntu server 14.04 LTS AMI (64-bit and 32-bit)". I have PHP 7.4 and Ubuntu 20.04.

I use this docs as a reference, and did:

sudo apt-get update   sudo apt-get install gcc g++ php-pear  

I've downloaded the correct php-memcached package from the AWS console. In this case, PHP 7.4 and AMD (the VM is a t4g.xlarge).

tar -xvf latest-64bit-arm  cp amazon-elasticache-cluster-client.so /usr/lib/php/20190902/  echo "extension=elasticache-cluster-client.so" | sudo tee --append memcached.ini  sudo systemctl restart php7.4-fpm.service   sudo systemctl restart nginx.service  

After this config, the W3 Total Cache plugin doesn't recognize Memcached.

I gave up on this specific AWS config and went with php-memcached:

sudo apt install php-memcached  sudo systemctl restart php7.4-fpm.service   sudo systemctl restart nginx.service  

The W3 Total Cache plugin recognizes Memcached but says Amazon Node Auto Discovery is unavailable because it doesn't find the ElastiCache PHP module.

I went to /etc/php/7.4/cli/conf.d and I see that my memcached.ini is white while the remaining extensions (including standard 25-memcached.ini) are blue:

/etc/php/7.4/cli/conf.d

However, running php --ini I see Additional .ini files parsed: (..) /etc/php/7.4/cli/conf.d/memcached.ini.

What are my next steps?

Partitions /dev/loopXX

Posted: 08 Nov 2021 10:32 AM PST

While I was checking my disk space today with df -h I noticed all these /dev/loopXX partitions which I don't know what they really are.

enter image description here

What are them? Should I keep it?

Thank you.

Sync shared folder in RCLONE

Posted: 08 Nov 2021 10:04 AM PST

I am trying to share a folder in ONEDRIVE. In the browser application, I can see the folder and I can also see it in the Windows app, but in Linux I can't. I checked if the sync is working and confirmed that it is.

The command I used to sync:

rclone --vfs-cache-mode writes mount ITSA: /home/linux/ITSA/  

enter image description here version

linux@linux-OptiPlex-745:~$ rclone --version  rclone v1.57.0    os/version: linuxmint 20.2 (64 bit)  os/kernel: 5.4.0-88-generic (x86_64)  os/type: linux  os/arch: amd64  go/version: go1.17.2  go/linking: static  go/tags: none  

Creating Kernel Module

Posted: 08 Nov 2021 10:16 AM PST

I am currently reading a book on Linux Kernel Module Programming - [https://tldp.org/LDP/lkmpg/2.4/lkmpg.pdf][1] and I am running into a compilation error when running make.

/*  hello.c − The simplest kernel module.   *   */  /* Kernel Programming */    #define MODULE  #define LINUX  #define __KERNEL__    #include <linux/module.h>  /* Needed by all modules */  #include <linux/kernel.h>  /* Needed for KERN_ALERT */    int init_module(void)  {     printk("<1>Hello world 1.\n");     // A non 0 return means init_module failed; module can't be loaded.     return 0;  }    void cleanup_module(void)  {    printk(KERN_ALERT "Goodbye world 1.\n");  }    MODULE_LICENSE("GPL");  
TARGET  := hello  WARN    := −W −Wall −Wstrict−prototypes −Wmissing−prototypes  INCLUDE := −isystem /lib/modules/`uname −r` /build/include  CFLAGS  := −O2 −DMODULE −D__KERNEL__ ${WARN} ${INCLUDE}  CC      := gcc    ${TARGET}.o: ${TARGET}.c    .PHONY: clean    clean: rm −rf ${TARGET}.o  
gcc −O2 −DMODULE −D__KERNEL__ −W −Wall −Wstrict−prototypes −Wmissing−prototypes −isystem /lib/modules/`uname −r` /build/include   -c -o hello.o hello.c  uname: extra operand '−r'  Try 'uname --help' for more information.  gcc: error: −O2: No such file or directory  gcc: error: −DMODULE: No such file or directory  gcc: error: −D__KERNEL__: No such file or directory  gcc: error: −W: No such file or directory  gcc: error: −Wall: No such file or directory  gcc: error: −Wstrict−prototypes: No such file or directory  gcc: error: −Wmissing−prototypes: No such file or directory  gcc: error: −isystem: No such file or directory  gcc: error: /build/include: No such file or directory  make: *** [<builtin>: hello.o] Error 1  

The errors that i receive are command options defined in the Makefile. What am I not understanding?

dnsmasq doesn't handle default DNS for unqualified names as expected

Posted: 08 Nov 2021 10:01 AM PST

I'm trying to setup DoH for all hostnames except some local domains that should be resolved by DNS provided by DHCP.

It works with fully-qualified names as expected, that is, local names are sent to DHCP assigned server and everything else is sent to my DoH client stubby. However, I'm having issues with handling of unqualified names.

Here is my configuration /etc/NetworkManager/dnsmasq.d/example.conf:

cache-size=1000  log-queries  server=//#  server=/example.com/#  server=/#/127.0.0.1#8053  

Note that stubby is running on port 8053. For brevity, here is my /etc/NetworkManager/NetworkManager.conf:

[main]  plugins=ifupdown,keyfile  dns=dnsmasq    [ifupdown]  managed=false  

Here is a part of journalctl output after restartng NetworkManager:

dnsmasq[10692]: using nameserver 127.0.0.1#8053 for default  dnsmasq[10692]: using standard nameservers for domain example.com  dnsmasq[10692]: using standard nameservers for unqualified names    <<< NOTICE THIS  dnsmasq[10692]: cleared cache  dnsmasq[10692]: setting upstream servers from DBus  dnsmasq[10692]: using nameserver 127.0.0.1#8053 for default  dnsmasq[10692]: using standard nameservers for domain example.com  dnsmasq[10692]: using standard nameservers for unqualified names  dnsmasq[10692]: using nameserver 10.X.X.X#53(via enp0s31f6)  dnsmasq[10692]: using nameserver 10.X.X.X#53 for domain example.com  dnsmasq[10692]: using nameserver 10.X.X.X#53 for domain X.X.X.10.in-addr.arpa  dnsmasq[10692]: using nameserver 10.X.X.X#53 for domain X.X.X.10.in-addr.arpa  

After dig asdfg.com, I get this:

dnsmasq[10692]: query[A] asdfg.com from 127.0.0.1  dnsmasq[10692]: forwarded asdfg.com to 127.0.0.1  

So, DoH works as expected.

After dig asdfg.example.com, I get this:

dnsmasq[10692]: query[A] asdfg.example.com from 127.0.0.1  dnsmasq[10692]: forwarded asdfg.example.com to 10.X.X.X  

So, forwarding to local DNS also works.

After dig asdfg, I get this:

dnsmasq[10692]: query[A] asdfg from 127.0.0.1  dnsmasq[10692]: forwarded asdfg to 127.0.0.1  

Since it sends it to 127.0.0.1 instead of 10.X.X.X, it's clear it is sent to DoH.

How can I fix this?

ps. Debian 11, Dnsmasq version 2.85

creating a nested json file from variables using jq

Posted: 08 Nov 2021 10:54 AM PST

I have a script where I am storing variables and using that I am trying to create a json output to a file. here is my json build format

#!/bin/bash  JSON_STRING=$(jq -n \                    --arg configId "$configid" \                    --arg objectname "tempfile" \                    --arg artifacts "[{ "name" : "oer", "version" : "$ot" }]" \                    --arg test "2021" \                     '$ARGS.named') > output.json                      

desired json o/p (output.json) -

{ "configId": "c8f", "objectname": "tempfile", "artifacts": [{ name : oer, version : 1.01 }], "test" : "2021"}  

here I am not getting the desired output. any help would be great

Map drawing tablet to one monitor or program in KDE Plasma Wayland

Posted: 08 Nov 2021 08:50 AM PST

I have a hardware setup with two monitors and a USB drawing tablet that I find useful for taking notes during meetings. My ideal is to have videoconferencing software maximized on one monitor and Xournal++ open on the other. By default, the left half of the tablet corresponds to the notes monitor and the right half corresponds to the meeting monitor. To make writing easier, I remap it so that tablet's entire area is bound to the notes monitor. With Xorg, this is done with

xinput map-to-output $tablet device name$ $monitor name$

I want to accomplish the same thing in an Wayland-based KDE Plasma install without using xinput. I found this solution for input mapping in Wayland, but it looks like it's specific to the Sway compositor. How can I achieve the same thing with one of KDE's supported compositors, preferably the default?

How can i only include the whole number and two decimal points in my output

Posted: 08 Nov 2021 09:31 AM PST

Code is functioning correctly although I need it to be reduced to only two decimal points for example 38374.96 not 38374.967777777

#!/usr/bin/python3   amount = float(input("Enter a starting value: "))    result = {}    # looping for 10 times  for i in range(1,11):            # updating amount      amount = amount * 1.01        # updating result      result[str(i) + " years"] = amount    # printing result  print(result)  

skypeforlinux won't work anymore on Debian

Posted: 08 Nov 2021 08:47 AM PST

It happens again :(

After a reboot, skypeforlinux does not work any more on my bookworm (testing) Debian installation. It starts, goes through authentication, then stops there with a blank window. Calling it on the command line shows no messages or errors.

I tried with the latest 8.79.76.22 version and with the oldest 8.74.0.152 version on the repo, no change.

Any ideas?

switch_root: failed to execute /sbin/init: Too many levels of symbolic links

Posted: 08 Nov 2021 10:42 AM PST

So, recently I was doing the Linux from scratch project and I had multiple terminals open, so I was continuing to make it, and by accident I typed the line in another terminal tab (root), and it messes up symlinks completely!, I can't run any commands on bash.

    case $(uname -m) in   i?86) ln -sfv ld-linux.so.2 $LFS/lib/ld-lsb.so.3   ;;   x86_64) ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64   ln -sfv ../lib/ld-linux-x86-64.so.2 $LFS/lib64/ld-lsb-x86-64.so.3   ;;  esac  

I'm on arch linux, when I restarted the computer, also the kernel panic happened and it says: "switch_root: failed to execute /sbin/init: Too many levels of symbolic links."

Any solutions? I hope if someone helps.

Bash negation of -a (file exists) does not change result, whereas for -e ! changes result

Posted: 08 Nov 2021 10:24 AM PST

I'm perplexed but still guess I misunderstood bash somehow.

/$ if [ -e /bin/grep ]; then echo yey; else echo ney ; fi  yey  /$ if [ ! -e /bin/grep ]; then echo yey; else echo ney ; fi  ney  /$ if [ -a /bin/grep ]; then echo yey; else echo ney ; fi  yey  /$ if [ ! -a /bin/grep ]; then echo yey; else echo ney ; fi  yey  

Why negation ! reverses effect of -e test but not -a test? Man bash:

3 arguments The following conditions are applied in the order listed. If the second argument is one of the binary conditional operators listed above under CONDITIONAL EXPRESSIONS, the result of the expression is the result of the binary test using the first and third argu‐ ments as operands. The -a and -o operators are considered binary operators when there are three arguments. If the first argument is !, the value is the negation of the two-argument test using the second and third arguments.

CONDITIONAL EXPRESSIONS Conditional expressions are used by the [[ compound command and the test and [ builtin commands

-a file True if file exists. -b file True if file exists and is a block special file. -c file True if file exists and is a character special file. -d file True if file exists and is a directory. -e file True if file exists.

Why bash aliases commands are not working?

Posted: 08 Nov 2021 11:31 AM PST

I am facing a problem with bash alias in Kali linux. Let me tell from the beginning.

I want to set some command to save time from writing it again and again. So, I used

nano /.bash_aliases  

and set a command line

alias up='sudo apt update && sudo apt full-upgrade'  

then I press Ctrl+V and hit y then hit enter. I closed the terminal and open it. When I put up and press enter it shows:

up: command not found  

Then I searched for solution and find one telling to do this.

gedit .bashrc  

In the .bashrc file this is written without any '#'

if [ -f ~/.bash_aliases ]; then      . ~/.bash_aliases  fi  

Then I get into bash_aliases file with this command

gedit bash_aliases  

And write this and save...

alias up='sudo apt update && sudo apt full-upgrade'  

and close the terminal. In new terminal that same error happens. No command found. I have also do these in order to solve this problem:

  • reboot my pc

  • totally turned off and again turn on my pc

  • Try some random solutions like

     source ~/.bashrc   bash -i -c my_alias  

But I found the problem again and again. Here is a screen shot if I forgot to add any details. Thanks in advance. Screen Shot of error

pkill in server ubuntu [closed]

Posted: 08 Nov 2021 11:37 AM PST

I used the command pkill as root on my vps ubuntu, and I got kicked out of the server and can't access it.

What is the solution?

tar list full filename without directory

Posted: 08 Nov 2021 08:49 AM PST

I have a tgz file with the following file structure

- folder      - subdir1        - file1.txt        - file2.text      - subdir2        - file1.txt  

When i run tar -tf folder.tgz, it outputs the following:

folder/  folder/subdir1/  folder/subdir1/file1.txt  folder/subdir1/file2.txt  folder/subdir2/  folder/subdir2/file1.txt  

How can i exclude directory names so that the outputted list is:

folder/subdir1/file1.txt  folder/subdir1/file2.txt  folder/subdir2/file1.txt  

Running python script many times in a bash file

Posted: 08 Nov 2021 09:37 AM PST

I want to run a python script many times with various arguments. To do that, I've written the following bash script:

requests=(25 50 75 100)  factors=(3 6)  graphsizes=(25 50 75)    for request in "${requests[@]}"; do      for factor in "${factors[@]}"; do          for size in "${graphsizes[@]}"; do              echo "Now Running: n = ${request}, factor = ${factor}, size = ${size}" >> nohup.out;              echo nohup python3 -u main.py "$request" 50 "$factor" "$size" > ${request}_${factor}_${size}.log &              echo "Done Running: n = ${request}, factor = ${factor}, size = ${size}" >> nohup.out;          done      done  done  

I added ; at the end of the first and last echo because I do not want them to be run in parallel. In fact I want every call to the python script main.py to be run sequentially not in parallel, since the script itself is already parallelized and don't want any race conditions.

I know normally we use a ; to make jobs run sequentially, but if I do that after the & in the nohup line, I get the error

syntax error near unexpected token `;'  

How do I make each iteration of the loop run sequentially?

How can I use sem to run a shell command in parallel in a for loop?

Posted: 08 Nov 2021 09:24 AM PST

This isn't speeding anything up for me:

domains=()    for i in `seq 1 100`; do      echo $i      word=`sem "xidel -s 'https://www.thisworddoesnotexist.com/' -e '//div[@id="definition-word"]/text()'"`      len=${#word}      if [ "$len" -lt "8" ]; then          word=`echo $word | sed 's/[^a-z A-Z]//g'`          domains+=(${word}.com)      fi  done  sem --wait    printf '%s\n' "${domains[@]}"  

I'm trying to run the for loop body in parallel with sem.

How to rename multiple files by changing one component of the file name?

Posted: 08 Nov 2021 10:56 AM PST

I found lots of questions about how to rename multiple files using the command line. However I am not able to solve my specific issue which is renaming this file name:

something_4M_something_something_manyothersomethings.csv  

into this:

something_4_M_something_something_manyothersomethings.csv  

What I need is to split the 4M field into 4_M but I am not able to do it (notes: every something is separated by an underscore, there are many other fields, and I believe this is not important for the task).

What I did is the following but it does not work as I am expecting I think it is a problem with the regexp, but I can't figure out a better one:

rename -n 's/.4M/$&_4_M/' *  

Also, I don't know how exactly the thing I wrote is working, since I found something similar in a comment to one of the similar-to-this-questions but I can't find it anymore.

Changing keyboard language layout in linux mint doesn't work for second time

Posted: 08 Nov 2021 09:29 AM PST

I have added second keyboard language layout (Persian) in Linux Mint 20.2 Cinnamon and in keyboard setting I've set it to use shortcut win+space to change the layout. It works fine when the selected layout is the primary (US English) and the shortcut changes the layout to secondary layout (Persian) but when I want to change from (Persian) to (English) it doesn't work and I have to use mouse and change it from the panel icon. I've changed the shortcut to alt+shift but the problem still remains.

Unlock Gnome Keyring Daemon from command line

Posted: 08 Nov 2021 11:37 AM PST

I am trying to unlock the Gnome Keyring Daemon from the command line, by directly passing it a password. I tried a few variations of --daemonize, --login, --start, but I can't get it to work.

echo $password | gnome-keyring-daemon --unlock returns SSH_AUTH_SOCK=/run/user/1000/keyring/ssh but doesn't unlock anything.

Basically I want something along the lines of:

gnome-keyring-daemon unlock --pw $password

Not sure if it makes any difference, but I'm on Manjaro i3wm version, so not using a desktop environment.

Background:

I'm using KeePassXC to manage my keyring. The one downside to this is, that I can't automatically unlock the keyring on login. Since I don't want to enter two long passwords I came up with the following script as a workaround:

  • Logging in automatically unlocks Gnome Keyring Daemon
  • Gnome Keyring Daemon contains (a part of) the PW to KeePassXC as the only entry
  • enter the last characters of the pw in a prompt
  • kill Gnome Keyring Daemon
  • use the combined pw to unlock KeePassXC

Now I want to do the opposite to lock KeePassXC again:

  • Get PW to Gnome Keyring Daemon from KeePassXC
  • Kill KeePassXC
  • Unlock GnomeKeyringDaemon <- this is the part I can't get to work

How to reinstall the packages that has been removed in the last remove command in arch linux?

Posted: 08 Nov 2021 11:04 AM PST

So recently I have installed Manjato linux with i3wm. It came with urxvt and urxvt-perls pre installed so I've switched to st terminal emulator and decided to remove urxvt-perls, and urxvt-perls. So I ran pacman -Rcns urxvt-perls

And even before seeing what is being removed I confirmed the removal. At it removed crucial packages such as dunst, nitrogen and lot of other packages required by i3. So i3 crashed. So im looking for a way to get things working again. What would be a clean way to fix this situation?

ping to IP address works but ping to domain name not working

Posted: 08 Nov 2021 10:02 AM PST

EDIT: I have 2 machine setup, Machine A only has internet connection, Machine B ens192 interface connects directly with Machine A interface ens192.

So configured iptables in MachineA to make sure Machine B also has the connectivity. ping to ip address works but domain name fails. Below provided each machine network config details.

Machine A:

Network config:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00      inet 127.0.0.1/8 scope host lo         valid_lft forever preferred_lft forever      inet6 ::1/128 scope host          valid_lft forever preferred_lft forever  2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000      link/ether 00:50:56:11:8a:1a brd ff:ff:ff:ff:ff:ff      inet 20.1.1.27/24 brd 20.1.1.255 scope global noprefixroute ens192         valid_lft forever preferred_lft forever      inet6 fe80::88f2:48b:daef:7b0d/64 scope link noprefixroute          valid_lft forever preferred_lft forever  3: ens224: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000      link/ether 00:0c:29:1a:4b:09 brd ff:ff:ff:ff:ff:ff      inet 192.168.43.67/24 brd 192.168.43.127 scope global noprefixroute ens224         valid_lft forever preferred_lft forever      inet6 fe80::65cb:5a44:210b:1ef3/64 scope link noprefixroute          valid_lft forever preferred_lft forever  

I have configured iptables NAT to allow packet comes from private network interface(ens192) to reach other interface(ens224) for intenet connectivity. Below is the config used.

iptables --table nat --flush  iptables --table nat --delete-chain  iptables --table nat --append POSTROUTING --out-interface ens224 -j MASQUERADE  iptables --append FORWARD --in-interface ens192 -j ACCEPT  

Machine B:

After configuring NAT rules in Machine A, Now able to ping 8.8.8.8 or any IP address from machine B, but unable to resolve any hostname.

[root@localhost ~]# ping 8.8.8.8  PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.  64 bytes from 8.8.8.8: icmp_seq=1 ttl=56 time=1.78 ms  64 bytes from 8.8.8.8: icmp_seq=2 ttl=56 time=1.90 ms    [root@localhost ~]# ping google.com  ping: google.com: Name or service not known  

Network config:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000      link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00      inet 127.0.0.1/8 scope host lo         valid_lft forever preferred_lft forever      inet6 ::1/128 scope host          valid_lft forever preferred_lft forever  2: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000      link/ether 00:50:56:11:23:3a brd ff:ff:ff:ff:ff:ff      inet 20.1.1.201/24 brd 20.1.1.255 scope global noprefixroute dynamic ens192         valid_lft 15108sec preferred_lft 15108sec      inet6 fe80::250:56ff:fe11:233a/64 scope link noprefixroute          valid_lft forever preferred_lft forever  

ip route:

[root@localhost ~]# ip route  default via 20.1.1.27 dev ens192 proto dhcp metric 100   20.1.1.0/24 dev ens192 proto kernel scope link src 20.1.1.201 metric 100  

resolv.conf

[root@localhost ~]# more /etc/resolv.conf   # Generated by NetworkManager  nameserver 9.9.9.9  nameserver 20.1.1.27  

How to resolve this issue?

Find all .php files inside directories with writable permissions

Posted: 08 Nov 2021 09:04 AM PST

I'm looking for a linux command to scan through all writable directories on the server and show ones with .php and .html files inside them.

Something like:

find -type d -writable -exec find {} -iname '*.php' -o -iname '*.html' \;  

10x!

Resume failed download using Linux command line tool

Posted: 08 Nov 2021 09:37 AM PST

How do I resume a partially downloaded file using a Linux commandline tool?

I downloaded a large file partially, i.e. 400 MB out of 900 MB due to power interruption, but when I start downloading again it resumes from scratch. How do I start from 400 MB itself?

Tails OS - Modifying boot options

Posted: 08 Nov 2021 11:37 AM PST

When Tails OS boots, you can press tab to modify the startup options. Is there any way I can save an iso with these options already set? It's a real pain to have to press tab and set them up every time. Surely there must be a better way?

Disabling MMC in uboot

Posted: 08 Nov 2021 09:05 AM PST

Following is the log message related to u-boot on Xilinx zynq platform:

[Fri Apr 04 19:57:50.990 2014] U-Boot 2013.07 (Apr 04 2014 - 19:38:00)  [Fri Apr 04 19:57:50.990 2014]   [Fri Apr 04 19:57:50.990 2014] Memory: ECC disabled  [Fri Apr 04 19:57:50.990 2014] DRAM:  1 GiB  [Fri Apr 04 19:57:51.007 2014] MMC:   zynq_sdhci: 0  [Fri Apr 04 19:57:51.007 2014] SF: Detected N25Q128A with page size 64 KiB, total 16 MiB  [Fri Apr 04 19:57:51.038 2014] *** Warning - bad CRC, using default environment  [Fri Apr 04 19:57:51.038 2014]   [Fri Apr 04 19:57:51.038 2014] In:    serial  [Fri Apr 04 19:57:51.038 2014] Out:   serial  [Fri Apr 04 19:57:51.038 2014] Err:   serial  [Fri Apr 04 19:57:51.038 2014] U-BOOT for Xilinx-ZC702-14.7  [Fri Apr 04 19:57:51.038 2014]   [Fri Apr 04 19:57:51.038 2014]   [Fri Apr 04 19:57:51.038 2014] SF: Detected N25Q128A with page size 64 KiB, total 16 MiB  [Fri Apr 04 19:57:51.354 2014] SF: 1963200 bytes @ 0x520000 Read: OK  [Fri Apr 04 19:57:51.354 2014] ## Loading kernel from FIT Image at 01000000 ...  [Fri Apr 04 19:57:51.354 2014]    Using 'conf@1' configuration  [Fri Apr 04 19:57:51.354 2014]    Trying 'kernel@1' kernel subimage  [Fri Apr 04 19:57:51.354 2014]      Description:  PetaLinux Kernel  [Fri Apr 04 19:57:51.354 2014]      Type:         Kernel Image  [Fri Apr 04 19:57:51.354 2014]      Compression:  gzip compressed  [Fri Apr 04 19:57:51.354 2014]      Data Start:   0x010000f0  [Fri Apr 04 19:57:51.354 2014]      Data Size:    1630119 Bytes = 1.6 MiB  [Fri Apr 04 19:57:51.354 2014]      Architecture: ARM  [Fri Apr 04 19:57:51.354 2014]      OS:           Linux  [Fri Apr 04 19:57:51.354 2014]      Load Address: 0x00008000  [Fri Apr 04 19:57:51.354 2014]      Entry Point:  0x00008000  [Fri Apr 04 19:57:51.354 2014]      Hash algo:    crc32  [Fri Apr 04 19:57:51.354 2014]      Hash value:   01dece90  [Fri Apr 04 19:57:51.354 2014]    Verifying Hash Integrity ... crc32+ OK  

My aim is to reduce boot time. The OS and the u-boot is supposed to boot from flash. But as you can on the top MMC is being detected:

    [Fri Apr 04 19:57:50.990 2014] DRAM:  1 GiB      [Fri Apr 04 19:57:51.007 2014] MMC:   zynq_sdhci: 0  

It takes 0.17 seconds.

Is there anyway I can save this time may be by disabling MMC from u-boot?If so how do we disable MMC in u-boot. What is the general procedure?

No comments:

Post a Comment