Tuesday, July 6, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


Autocompletion of makefile with makro in zsh not correct (works in bash)

Posted: 06 Jul 2021 10:28 AM PDT

I have a makefile that has the targets

  • start-prod
  • start-test
  • stop-prod
  • stop-test
  • restart-prod
  • restart-test

Autocompletion works in bash without problems but in zsh it will only complete start- etc. not start-prod.

The targets are defined with makros.

define commands =  $(eval  restart-$(1):   stop-$(1) start-$(1)  start-$(1):     ; docker-compose up -d --remove-orphans $(1)  stop-$(1):      ; docker-compose stop $(1)  )  endef      $(call commands,prod)  $(call commands,test)  

My assumption is that bash evaluates the makefiles to get the targets while zsh try to parse it.

Is there any way to get this working in zsh.

I tried to use the bash command in zsh like mentioned in this question. But this only got me an error when I try to complete an makefile

_init_completion: command not found zsh  

Ethernet config for computer-USRP communication

Posted: 06 Jul 2021 10:28 AM PDT

I am trying to set up communication between my laptop computer, running Ubuntu 20.04.2 LTS, and an Ettus Research USRP N210. I have been consulting the following resources:

They all tell me to configure the ethernet adapter to use an IP address of 192.168.10.1 with a netmask of 255.255.255.0, so I did so using the GUI utilities:

Network configuration.

Then I should be able to ping the N210 at its default IP of 192.168.10.2, but all I get is Destination Host Unreachable:

~$ ping 192.168.10.2  PING 192.168.10.2 (192.168.10.2) 56(84) bytes of data.  From 192.168.10.1 icmp_seq=1 Destination Host Unreachable  From 192.168.10.1 icmp_seq=2 Destination Host Unreachable  From 192.168.10.1 icmp_seq=3 Destination Host Unreachable  ...  

It has been many years since I had a computer networking course (and I am not a programmer or network admin by trade), so I feel sort of clueless. Does anyone here have some tips on how to proceed? If the N210, for some reason, is configured to use a non-default IP, how do I find its IP?

Details

The physical setup (schematically):

laptop - USB/ethernet adapter - ethernet cable - N210  

The above sources emphasize that the connection must be Gigabit Ethernet. The cable has HYPER-DATA 1000 written on it, so it seems to be up to spec. Additionally, as can be seen below, the Ethernet interface seems to automatically configure itself with speed=1Gbit/s, so that also seems correct.

Some additional information (... means I have removed one or more lines):

~$ ifconfig  enx9cebe8351e07: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500          inet 192.168.10.1  netmask 255.255.255.0  broadcast 192.168.10.255          inet6 fe80::d645:c1a1:99ea:a022  prefixlen 64  scopeid 0x20<link>          ether 9c:eb:e8:35:1e:07  txqueuelen 1000  (Ethernet)          RX packets 6  bytes 384 (384.0 B)          RX errors 0  dropped 0  overruns 0  frame 0          TX packets 283  bytes 44546 (44.5 KB)          TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  ...  ~$ route  Kernel IP routing table  Destination     Gateway         Genmask         Flags Metric Ref    Use Iface  default         _gateway        0.0.0.0         UG    600    0        0 wlp2s0  ...  link-local      0.0.0.0         255.255.0.0     U     1000   0        0 wlp2s0  192.168.10.0    0.0.0.0         255.255.255.0   U     100    0        0 enx9cebe8351e07  ~$ sudo lshw -c network  ...    *-network         description: Ethernet interface         physical id: 1         bus info: usb@1:3         logical name: enx9cebe8351e07         serial: 9c:eb:e8:35:1e:07         size: 1Gbit/s         capacity: 1Gbit/s         capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation         configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.11.11 duplex=full firmware=rtl8153a-2 v1 10/23/19 ip=192.168.10.1 link=yes multicast=yes port=MII speed=1Gbit/s  

IPv6 router not forwarding for clients

Posted: 06 Jul 2021 10:21 AM PDT

I have been trying to get IPv6 running on my network, but I am having some issues. I can reach the Internet on my router itself. I can reach the router from clients, but I cannot seem to reach the Internet from clients. The router runs Raspberry Pi OS Buster and the client system I am using for testing is also Debian. The setup uses wide-dhcpv6-client and radvd, and the internet connection is via pppoe.

I suspect the issue might be that clients are not getting the relevant routing information from the router. Here is output from ip -6 route on a client system which seems to be using a linklocal address as the default route...

::1 dev lo proto kernel metric 256 pref medium  2001:XXXX:XXXX:XX00::/64 dev eth0 proto kernel metric 256 expires 86215sec pref medium  fe80::/64 dev eth0 proto kernel metric 256 pref medium  fe80::/64 dev tun0 proto kernel metric 256 pref medium  default via fe80::dea6:32ff:fecc:25c5 dev eth0 proto ra metric 1024 expires 1615sec hoplimit 64 pref medium  

The routers address which can be reached from this client is 2001:XXXX:XXXX:XX00::1 and even if I manually remove that route shown above, and replace it with the routers IP, I still cannot reach the Internet.

This is my radvd config...

interface eth0    {          AdvSendAdvert on;          IgnoreIfMissing on;          AdvLinkMTU 1500;          AdvDefaultPreference high;          prefix 2001:XXXX:XXXX:XX00::/64          {                  AdvOnLink on;                  AdvAutonomous on;                  AdvRouterAddr on;          };            route ::/0 {};  };  

Here is everything essential from wide-dhcpv6-client...

profile default {    information-only;      request domain-name-servers;    request domain-name;    script "/etc/wide-dhcpv6/dhcp6c-script";  };    interface ppp0 {      send ia-pd 1;  };    id-assoc pd {      prefix-interface eth0 {          sla-id 0;          sla-len 8;          ifid 1;      };  };  

Here are the values of relevant sysctl values...

net.ipv6.conf.all.forwarding=2  net.ipv6.conf.default.forwarding=2  net.ipv6.conf.all.accept_ra = 2  net.ipv6.conf.default.accept_ra = 2  net.ipv6.conf.all.autoconf=1  net.ipv6.conf.default.autoconf=1  net.ipv6.conf.ppp0.accept_ra=0  

There are currently no firewall rules for IPv6 on the router. The policy for ip6tables is allow for all chains.

To demonstrate the problem I described in the first paragraph, here I ping an Internet IPv6 address from my router, which works...

root@gateway:~# ping 2001:67c:2db8:301:138:0:103:110  PING 2001:67c:2db8:301:138:0:103:110(2001:67c:2db8:301:138:0:103:110) 56 data bytes  64 bytes from 2001:67c:2db8:301:138:0:103:110: icmp_seq=1 ttl=39 time=347 m  

I can ping the gateway from my client system...

root@dns0:~# ping 2001:XXXX:XXXX:XX00::1  PING 2001:XXXX:XXXX:XX00::1(2001:XXXX:XXXX:XX00::1) 56 data bytes  64 bytes from 2001:XXXX:XXXX:XX00::1: icmp_seq=1 ttl=64 time=0.974 ms  

But I cannot ping the internet from my client, and there are no errors it just hangs for a while and times out...

# ping -c2 2001:67c:2db8:301:138:0:103:110  PING 2001:67c:2db8:301:138:0:103:110(2001:67c:2db8:301:138:0:103:110) 56 data bytes    --- 2001:67c:2db8:301:138:0:103:110 ping statistics ---  2 packets transmitted, 0 received, 100% packet loss, time 19ms  

avoid awk conditionals on cenrtain fields

Posted: 06 Jul 2021 10:19 AM PDT

I have "|" delimited file, something like this

firstname|secondname|Kernel|Version|Year  Linus|Torvald|VMLINUZ||1994  Jochen|Liedtke|L4|||  Apple||Darwin||2000  

I want "\t" delimited results, with few conditionals. If any column is empty, it'll substitute with "-", but it gets complex in few cases, where any of first or second name is empty. I don't want it to happen.

Simply, concatenate first & second name, but if any of these columns empty, don't replace with "-" otherwise this condition applies on other empty fields.

I wrote this, but it replaces empty first or second name with "-" too.

BEGIN {  FS="|";  OFS="\t"  }  $1" "$2  { for (i = 1; i <= NF; ++i) sub(/^$/, "-", $i) }  {  print $5, $4, $2" "$1  }  

It gives this output:

1994    -   Torvald Linus  -   -   Liedtke Jochen  2000    -   - Apple  

so the last line should be

2000    -   Apple  

scp: why "Name or service not known" has priority over "No such file or directory"?

Posted: 06 Jul 2021 10:22 AM PDT

Consider:

$ file xxx  xxx: cannot open `xxx' (No such file or directory)  

Then why:

$ scp xxx user@xxx.xx  ssh: Could not resolve hostname xxx.xx: Name or service not known  lost connection  

instead of:

$ scp xxx user@xxx.xx  xxx: cannot open `xxx' (No such file or directory)  

If there is no such file or directory, then why trying to connect in the first place?

Is it a bug in scp's logic?

how to distinguish ssh from scp in ~/.ssh/rc?

Posted: 06 Jul 2021 10:06 AM PDT

I'd like to launch neofetch (a small utility that displays a banner) each time I log into a remote server via OpenSSH. So, I just added /usr/bin/neofetch into my ~/.ssh/rc file, and it works fine. The problem is that ~/.ssh/rc is also parsed when I scp into the server. A complete scp command works just fine, there is however a problem when I try to use the autocomplete feature of scp, when I type <Tab><Tab> so it displays the files/folders available on the remote server, example :

$ scp remote-host:/t <TAB><TAB>  \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\`\\\"\\\"\\\"\\\    \\\ \\\$\\\$\\\:\\\ \\\ \\\ \\\ \\\ \\\ \\\$\\\$.\\\ \\\ \\\ ^[\\\[0m^[\\\[31m^[\\\[1m-^[\\\[0m^[\\\[1m\\\ \\\ \\\ \\\ \\\,d\\\$\\\$\\\'\\\    \\\ \\\ \\\ \\\ \\\ \\\`\\\$\\\$b.\\\    \\\ \\\,\\\$\\\$P\\\'\\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\`\\\$\\\$\\\$.\\\    \\\ \\\$\\\$P\\\ \\\ \\\ \\\ \\\ \\\ d\\\$\\\'\\\ \\\ \\\ \\\ \\\ ^[\\\[0m^[\\\[31m^[\\\[1m\\\,^[\\\[0m^[\\\[1m\\\ \\\ \\\ \\\ \\\$\\\$P\\\    \\\'\\\,\\\$\\\$P\\\ \\\ \\\ \\\ \\\ \\\ \\\ \\\,ggs.\\\ \\\ \\\ \\\ \\\ \\\`\\\$\\\$b\\\:\\\    \\\ \\\$\\\$\\\;\\\ \\\ \\\ \\\ \\\ \\\ Y\\\$b._\\\ \\\ \\\ _\\\,d\\\$P\\\'\\\    ^[\\\[0m^[\\\[1m\\\ \\\`\\\$\\\$b\\\ \\\ \\\ \\\ \\\ \\\ ^[\\\[0m^[\\\[31m^[\\\[1m\\\"-.__\\\    ^[\\\[0m^[\\\[1m\\\ \\\ \\\`Y\\\$\\\$\\\   (...)  

Usually $ scp remote-host:/t <TAB><TAB> shows me the files/folders starting with /t (for example /tmp), but now it executes the neofetch banner.

Is there a way to distinguish $ ssh from $ scp in ~/.ssh/rc (to launch neofetch only when I ssh into the server, not when I scp into it) ?

Note : I don't want to launch neofetch each time I launch bash, nor each time I launch a login shell, so putting it in /etc/bash.bashrc or in /etc/profile is not an option. I only want to launch it after an SSH connection.

I did some research and tried a few things :

  • Inspired by this post, I tried :

    if [ -t 0 ]; then /usr/bin/neofetch; fi

    and

    if tty > /dev/null; then /usr/bin/neofetch; fi

    But it's not working (neofetch is never launched, not even after an $ ssh)

  • Inspired by that post, I also tried to use the $- environment variable to distinguish between interactive and non interactive sessions, but it doesn't work either, because ~/.ssh/rc is parsed by dash, not by bash (and $- is a bash variable)

I found however a working solution (well, sort of...). It was inspired by this post :

  • On the server, in ~/.ssh/rc, I put :

    if [ ! "$LC_SCP" = "yes" ]; then /usr/bin/neofetch; fi

  • On the client, I have to set an LC_SCP environment variable before the $ scp :

$ export LC_SCP=yes    $ scp -o SendEnv=LC_SCP remote-host:/t<TAB><TAB>  (works, doesn't launch neofetch)  

It works, but it's cumbersomee. Isn't there a better way to distinguish between ssh and scp sessions in ~/.ssh/rc ?

How to NOT show the tags?

Posted: 06 Jul 2021 09:22 AM PDT

enter image description here

wadewayne@Cheetah:~$ man sdcv  wadewayne@Cheetah:~$ sdcv GNU  Found 28 items, similar to GNU.  -->McGraw-Hill Dictionary of Science and Technology  -->gnu    <BR><BR><b>VERTEBRATE ZOOLOGY</font></b><BR> Any of several large African antelopes of the genera <i>Connochaetes</i> and <i>Gorgon</i> having a large oxlike head with horns that characteristically curve downward and outward and then up, with the bases forming a frontal shield in older individuals.    -->Merriam-Webster's Advanced Learner's Dictionary (En-En)  -->gnu      /ˈnuː/ noun, pl gnu or gnus [count]  : ↑wildebeest    -->Longman Dictionary of Contemporary English 5th Ed. (En-En)  -->gnu      gnu /nuː/ BrE bre_gnu0205.wav AmE ame_gnu.wav noun (plural gnu or gnus) [countable]  [Date: 1700-1800; Language: Bushman; Origin: nqu]   a large African animal with a tail and curved horns SYN wildebeest    -->Concise Oxford English Dictionary  -->gnu    <font color="#007000">noun</font> gnu<br>  [<font color=#009900>(g)nu:</font>, <FONT COLOR=#009900>(g)nju:</font>]<br>  <FONT face="Lucida Sans Unicode">■</FONT>  <FONT color="#990000">noun</FONT> a large African antelope with a long head, a beard and mane, and a sloping back. [Genus <FONT color="#990000">Connochaetes</FONT>: two species.] <BR> <BR><IMG src="D437C11D.bmp" align="absmiddle" width="46" height="16"><BR>C18: from Khoikhoi and San, perh. imitative of the sound made by the animal when alarmed.    -->Wikipedia English - Free Encyclopedia  -->Wildebeest    <DIV><div><dl><dd><i>For the <a href="bword://free%20software">free software</a> operating system, see <a href="bword://GNU">GNU</a>.</i></dd></dl> <br/>         <br/>   <i>Connochaetes taurinus</i><br/> <i>Connochaetes gnou</i><br/> <i>Connochaetes taurinus cooksoni</i><br/> <i>Connochaetes taurinus albojubatus</i><br/> <i>Connochaetes taurinus johnstoni</i><br/>  The <b>wildebeest</b>, also called <b>gnu</b> (<a href="bword://International%20Phonetic%20Alphabet%20for%20English">pronounced</a>  or ), is a large hooved (<a href="bword://ungulate">ungulate</a>) mammal of the <a href="bword://genus">genus</a> <i>Connochaetes</i>, which includes two species, both native to Africa: the Black Wildebeest (<i>C. gnou</i>), and the Blue &amp; White-bearded Wildebeest or Blue Wildebeest (<i>C. taurinus</i>).  The gnus belongs to the family <a href="bword://Bovidae">Bovidae</a>, which includes antelopes, cattle, goats, and other even-toed horned ungulates.</div></DIV>  <BR><TABLE><TR><TD width="40"><IMG src="BD681305.gif"/></TD><TD><A href="http://www.babylon.com/redirects/redir.cgi?type=wikipedia&full_url=http://en.wikipedia.org/wiki/Wildebeest">See more at Wikipedia.org...</A></TD></TR></TABLE>    -->Most Common Acronyms and Abbreviations  -->GNU    Gnu's Nearly Useless :-)&nbsp;<BR>Gnu's Not Unix&nbsp;<P><HR>&nbsp;<P>For more possible definitions for <STRONG>GNU</STRONG>, <A href='http://www.acronymfinder.com/af-query.asp?p=bc&acronym=GNU'>click here</A><BR>©1988-2002, All Rights Reserved, <A href='http://www.acronymfinder.com/'>AcronymFinder.com</A>    -->American Heritage Dictionary  -->gnu    <B>gnu</B> (n<IMG SRC='8B84B278.png' ALIGN='ABSBOTTOM' width='13' height='12'>, ny<IMG SRC='8B84B278.png' ALIGN='ABSBOTTOM' width='13' height='12'>)<BR><I>n.</I><BR>Either of two large African antelopes <I>(Connochaetes gnou</I> or <I>C. taurinus)</I> having a drooping mane and beard, a long tufted tail, and curved horns in both sexes. Also called <B>wildebeest</B>.<HR>[Probably from Dutch<TT> gnoe</TT>, from Xhosa<TT> i-ngu</TT>, <I>white-tailed gnu</I>, from San<TT> !nu</TT>, <I>black wildebeest</I>.]    -->Longman Pronunciation Dictionary 3rd Ed. (En-En)  -->gnu      gnu  BrE uk_gnu0205.wav AmE us_gnu.wav nuː njuː; ɡə ˈnuː, -ˈnjuː —The forms with ɡə- are jocular, as generally is the entire word. In serious discourse this animal is called a wildebeest.  ▷ gnus nuːz njuːz; ɡə ˈnuːz, -ˈnjuːz    -->FOLDOC Computer Dictionary  -->GNU    <font color="#007000">noun</font><br>  &lt;<A href="bword://body">body</A>, <A href="bword://project">project</A>&gt; /g*noo/ 1. A <A href="BWORD://recursive acronym">recursive acronym</A>: "GNU's Not Unix!". The <A href="BWORD://Free Software Foundation">Free Software Foundation</A>'s project to provide a freely distributable replacement for <A href="BWORD://Unix">Unix</A>. The GNU Manifesto was published in the March 1985 issue of Dr. Dobb's Journal but the GNU project started a year and a half earlier when <A href="BWORD://Richard Stallman">Richard Stallman</A> was trying to get funding to work on his freely distributable editor, <A href="BWORD://Emacs">Emacs</A>.<BR><A href="BWORD://Emacs">Emacs</A> and the GNU <A href="BWORD://C">C</A> compiler, <A href="BWORD://gcc">gcc</A>, two tools designed for this project, have become very popular. GNU software is available from many <A href="BWORD://GNU archive site">GNU archive site</A>s.<BR>See also <A href="BWORD://Hurd">Hurd</A>.<BR>2. <PERSON> <A href="BWORD://John Gilmore">John Gilmore</A>.<BR>[<A href="BWORD://Jargon File">Jargon File</A>]<BR>(1997-04-12)<BR>    -->Microsoft Computer Dictionary  -->GNU    <FONT color='0080FF'>n.</FONT> Acronym for <FONT color='FF0000'>G</FONT>NU's <FONT color='FF0000'>N</FONT>ot <FONT color='FF0000'>U</FONT>NIX. A collection of software based on the UNIX operating system maintained by the Free Software Foundation. GNU is distributed under the GNU General Public License, which requires that anyone who distributes GNU or a program based on GNU may charge only for distribution and support and must allow the user to modify and redistribute the code on the same terms. <FONT color='008000'> See also</FONT> <FONT color='0000FF'>Free Software Foundation</FONT>, <FONT color='0000FF'>General Public License</FONT>. <FONT color='008000'>Compare</FONT> <FONT color='0000FF'>Linux</FONT>.    -->MacMillan English Dictionary -American  -->gnu    gnu <font color="green" face="Lucida Sans Unicode"> / nu / </font> noun [count]<br>a WILDEBEEST<br>    -->wikt-en-en-2018-10-07  -->GNU    n.  Name of the http://en.wikipedia.org/wiki/Free%20Software%20Foundation project to develop a free UNIX-like operating system, including the legal framework, such as the source code and documentation licenses.    -->Acronyms from A - Z  -->GNU    [1] GNU's Not Unix - Initiative zur Entwicklung einer freien Version von Unix der FSF nach der erfolgreichen Lizensierung durch AT&T <BR>[2] Goodnews Bay, AK, USA -internationale Fughafen-Kennung    -->Merriam-Webster Collegiate® Dictionary  -->wildebeest    <font color="#007000">noun</font> wil·de·beest<br>  <TABLE cellpadding="3" cellspacing="0" border="0"><TR valign="top"><TD nowrap="nowrap" style="vertical-align:top;">Pronunciation:    </TD><TD><B>'</B>wil-də-<FONT face="lucida sans unicode">ˌ</FONT>bēst</TD></TR> <TR valign="top"><TD nowrap="nowrap" style="vertical-align:top;">Function:          </TD><TD><I>noun</I></TD></TR> <TR valign="top"><TD nowrap="nowrap" style="vertical-align:top;">Inflected Form:   </TD><TD><I>plural</I> <B>wildebeests</B> <I>also</I> <B>wildebeest</B></TD></TR> <TR valign="top"><TD nowrap="nowrap" style="vertical-align:top;">Etymology:         </TD><TD>Afrikaans <I>wildebees,</I> from <I>wilde</I> wild + <I>bees</I> ox</TD></TR> <TR valign="top"><TD nowrap="nowrap" style="vertical-align:top;">Date:              </TD><TD>circa 1824</TD></TR></TABLE><BR><B>: </B>either of two large African antelopes (<I>Connochaetes gnou</I> and <I>C. taurinus</I>) with a head like that of an ox, short mane, long tail, and horns in both sexes that curve downward and outward ― called also <I>gnu</I>    -->CMU American English spelling  -->gnu    [nu:]    -->Merrian Webster 10th dictionary  -->gnu    noun  : either of two large African antelopes (Connochaetes gnou and C. taurinus) with a head like that of an ox, short mane, long tail, and horns in both sexes that curve downward and outward    -->Oxford Talking Dictionary  --><p>gnu    <B><FONT SIZE='+1'>gnu</FONT></B><BR>/<FONT face='Lucida Sans Unicode' color='Blue'>nu<FONT face='Ipa-samd Uclphon1 SILDoulosL'>:</FONT></FONT>, <FONT face='Lucida Sans Unicode' color='Blue'>ɲu<FONT face='Ipa-samd Uclphon1 SILDoulosL'>:</FONT></FONT>; <FONT face='Lucida Sans Unicode' color='Blue'>gn-</FONT>/<BR><I><FONT color='Teal'><FONT color='Green'>n.</FONT></FONT></I> <FONT SIZE='-2'>L18</FONT>. [f. Khoisan, prob. through Du. <I><FONT color='Teal'>gnoe</FONT></I>.] <S1>= <FONT SIZE='-2'>WILDEBEEST</FONT>.<FIELDSET><LEGEND>Quotation</LEGEND><FONT SIZE='-1'><B>brindled gnu</B> = <I><FONT color='Teal'>blue <FONT SIZE='-2'>WILDEBEEST</FONT></FONT></I>.</FONT><BR><FONT SIZE='-1'><B>white-tailed gnu</B> = <I><FONT color='Teal'>black <FONT SIZE='-2'>WILDEBEEST</FONT></FONT></I>.</FONT></FIELDSET>    -->Collins COBUILD Advanced Learner's English Dictionary  --><p>gnu    gnu gnus<BR><FONT color='#800000'>[N-COUNT]</FONT><BR> A <B>gnu</B> is a large African deer.<BR>    -->Columbia Encyclopedia  -->gnu    <TABLE ALIGN="CENTER" BORDER="0" WIDTH=95% CELLSPACING="0" CELLPADDING="3"><TR><TD>(n<FONT FACE="MS Reference Sans Serif"></FONT>)   or <B>wildebeest</B> (wĭl´dəbēst´´)  , large African <A HREF="bword://antelope">antelope</A>, genus <I>Connochaetes.</I> Its heavy head and humped shoulders resemble those of a buffalo, while the compact hindquarters are like those of a horse. The gnu has a beard, a short, erect mane, and a long, flowing tail. Members of both sexes have large horns that curve down, outward, and up. Gnus are grazing animals and live in herds on open grassland. They constantly move in an effort to locate new pastures. The sight of a gnu migration, with its distinctive style of movement, is perhaps the most impressive group event in the animal kingdom. There are two species. The brindled gnu, or blue wildebeest (<I>Connochaetes taurinus</I>), is a large, fierce-looking animal of S and E Africa. It stands 41/2 ft (135 cm) high at the shoulder and weighs about 500 lb (225 kg); its coat is bluish-gray mottled with brown on the sides. The tail, mane, and beard are black. In the northern variety of this species (called the white-bearded gnu), which ranges as far N as Kenya, the beard is white. The brindled gnu lives in herds of 20 to several thousand individuals, often led by one or several old females and often found grazing with herds of zebra. Gnus are swift runners and herds engage in elaborate evasive maneuvers when threatened; their chief predator is the lion. They graze in the morning and evening, resting during the heat of the day; they often travel long distances in search of water. The white-tailed gnu, or black wildebeest (<I>C. gnou</I>), is a somewhat smaller animal once abundant in S Africa. It is now probably extinct in the wild, but is protected in parks and reserves, where its numbers are increasing. <I>Gnu</I> is the San (Bushman) term for these animals; <I>wildebeest</I> is Afrikaans. Gnus are classified in the phylum <A HREF="bword://Chordata">Chordata</A>, subphylum Vertebrata, class Mammalia, order Artiodactyla, family Bovidae.</TD></TR></TABLE>    -->Cambridge Advanced Learner's Dictionary  -->gnu    <span style="font-size: medium;font-weight: bold;color : #005c9c;">gnu</span> <font face="Lucida Sans Unicode">/nuː/</font><br> <span style="font-size: small;color: #333333;">noun</span> <span style="font-size: small;color: #333333;">[C]</span> <span style="background: #eeeecc;border: 3px solid black;">plural</span> <span style="font-size: small;color: #333333;font-weight : bold;">gnu</span> or <span style="font-size: small;color: #333333;font-weight : bold;">gnus</span><br><span style="font-size: small;color: #000000;font-style : normal;">a large African animal with a long tail and horns that curve to the sides, which lives in areas covered with grass</span><br>    -->Oxford Advanced Learner's Dictionary 8th Ed.  -->gnu      gnu  [gnu gnus] BrE  [nuː] z_gnu__gb_1.wav NAmE  [nuː] z_gnu__us_1.wav BrE  [njuː] z_gnu__gb_2.wav NAmE  [njuː] z_gnu__us_2.wav  noun (pl.  gnu or  gnus) =  ↑wildebeest    Word Origin:   late 18th cent.: from  Khoikhoi  and  San, perhaps imitative of the sound made by the animal when alarmed. Khoikhoi and San are southern African languages.     -->New Oxford English Dictionary  -->gnu    <span style="FONT-FACE: Arial; FONT-SIZE: 12pt; FONT-WEIGHT:bold;"><b>gnu</b></span>  <table><tr><td class="s1"> <span style="COLOR: red; font-weight:bold; size: 10pt;">noun</span> <df style="FONT-FAMILY: Times New Roman; FONT-SIZE: 12pt">a large dark antelope with a long head, a beard and mane, and a sloping back.</df> Also called <xr><a style="cursor:hand;" href="bword://WILDEBEEST"><span style="FONT-FAMILY: Verdana; FONT-SIZE: 7pt; TEXT-TRANSFORM: uppercase;">WILDEBEEST</span></a></xr>.<br><br><div class="tec">• Genus <i>Connochaetes</i>, family <txf>Bovidae</txf>: two species, in particular the abundant <ll>brindled gnu</ll> or blue wildebeest (<txb>C. taurinus</txb>).</div><br></td></tr></table><table><tr><td style="FONT-FAMILY: Arial; FONT-SIZE: 10pt;"><font face="Arial" style="size: 9pt; color: green"><b><i>ORIGIN</b></i></font> <d>late 18th cent.</d>: from Khoikhoi and San, perhaps imitative of the sound made by the animal when alarmed.</td></tr></table>    -->Oxford Advanced Learner's Dictionary 7th  -->gnu    gnu<br>/   nuː; <i>NAmE </i>   ;    njuː; <i>NAmE </i>/<br> <font color="blue"><i>noun</i></font><br>(pl. gnu or gnus) = wildebeest<br><font color="#F14B35"><b>WORD ORIGIN</b></font><br>gnu<br> late 18th cent.: from Khoikhoi and San, perhaps imitative of the sound made by the animal when alarmed. Khoikhoi and San are southern African languages.<br>    -->The CMU Pronouncing Dictionary  -->gnu    'nu:    -->Longman Dictionary of Contemporary English  -->gnu    <span style="color: #0000D0"><b>gnu</b></span> /<span style="font-family: awlunicode; font-size: 110%">nuː</span>/ <i><span style="color: #000000"> noun</span></i> (<i>plural </i><b><span style="color: #0000D0">gnu</span></b><i> or</i> <b><span style="color: #0000D0">gnus</span></b>)<span style="color: #008500"> [countable]</span><BR>[<span style="color: #030303; font-weight: bold">Date: </span><span style="color: #303030">1700-1800</span>; <span style="color: #030303; font-weight: bold">Language: </span><span style="color: #303030">Bushman</span>; <span style="color: #030303; font-weight: bold">Origin: </span><span style="color: #303030">nqu</span>]<BR>a large African animal with a tail and curved horns<b><span style="color: #000060"> SYN </span></b><b>wildebeest</b>    -->The Oxford World Encyclopedia  -->gnu    (or <b>wildebeest</b>) A grazing antelope belonging to the same tribe (a taxonomic group below the subfamily) as the <A HREF="bword://hartebeest">hartebeest</A>. The two species of gnu are found on the African veld, where they are perhaps the fastest of the animals. The brindled gnu, <i>Connochaetes taurinus</i>, travels in herds of a dozen to several hundred individuals, frequenting the open plains in search of grass and a regular supply of water. Brindled in colour, it has brown stripes on the neck and shoulders, and a black tail; the horns are smooth and spread outwards. A single calf is born after a gestation period of eight and a half months. The white-tailed gnu, <i>C. gnou</i>, once common over much of the South African veld, is now restricted to reserves.    -->Britannica Pocket Encyclopedia  -->gnu    <font color="#007000">noun</font> gnu<br>  <BR><I>or <B>wildebeest</B></I><BR><BR>Either of two species of African <A href="bword://antelope">antelope</A> (genus <I>Connochaetes</I>).<BR><BR>The gnu stands higher at the shoulder than at the rump, reaching a shoulder height of 3–4 ft (1–1.3 m). The southern African form, the white-tailed gnu, or black wildebeest, is dark brown with long black tufts on the snout, chin, throat, and chest, and a black mane and flowing white tail. Today it exists only in national parks and preserves. The brindled gnu, or blue wildebeest, is reasonably abundant over much of central and South Africa. It is silvery gray with dark vertical bands on the sides and has a black mane, tail, and face, whitish cheeks, and a tuft of dark hair on chin and throat. Both sexes of both species have horns. Gnu live in often large, constantly moving herds and graze on the grasses and scrub of open plains.<BR><BR><IMG src="30A4098B.jpg" align="absmiddle" width="100" height="74"><BR>White-bearded gnu (<I>Connochaetes taurinus albojubatus</I>)<BR><BR>Leonard Lee Rue III    -->Computer Abbreviations v1.5  -->GNU    Gnu's Not Unix (operating system)    wadewayne@Cheetah:~$   

Hi. I've installed sdcv yesterday.

But as you can see in the screenshot and code sample, it even shows the tags. Is there any way to not get the tags?

Automatic Configuration Using Bonjour

Posted: 06 Jul 2021 09:43 AM PDT

enter image description here

I'm on http://localhost:631/admin (fedora) and attempting to install a printer via CUPS. I'm trying to find my URI to use:

lpinfo --include-schemes dnssd -v  

returns no results? Is anyone skilled at setting up printers as this is kicking my ass - nothing will print.

Some app is unable to connect on specific port or at all while firewall is disabled

Posted: 06 Jul 2021 09:12 AM PDT

I've strange issue and I cannot deal with it by self. I'm owning dedicated server from rent company. I'm hosting on it few applications, well many, for example standard apache2 web server or teamspeak server. I recently wanted to host application created in C# that I found on GitHub. Same application works under Windows fine but when I downloaded release for linux unpacked it and started it is not connecting to other servers while supposed to do since this is app for reading game chat on specific ports and pass it to another game servers. Of course I reach out to the creator of app but he or she answered that this is issue on my side and I believe that is true because when I ran debian on WSL same app from same release worked fine. I don't believe that I have firewall, I especially downloaded package for ufw and set it to disable so I've no idea what is blocking that specific app or ports that its trying to connect. Could someone advice where to look for issue?

Ok so app is supposed to connect to these ports: 15092 9778 19092 13778

I set for app chmod 744 and created separate account but it is not working even on root account tbh.

When I ran app it after few seconds says its unable to connect to servers that I listed in config file which is exactly same config file copied from local Windows version of same app and works.

Screenshot: enter image description here

This is the story that I reported to the author: https://github.com/spikeydragoon/Cross-Ark-Chat/issues/59

so I would need help to figure out what is blocking connection on these ports.

I've debian 10.10. I've also many apps like teamspeak, appache2, mysql, tbh I don't even remember what exactly is hosted on this server but nothing should interfere in any ports.

I'm beginner in linux administrative, I'm self learner I dig at google but the only thing I could found were about iptables and ufw thats why I decided to download ufw and disable it but it changed nothing.

Any words would be useful, I like resolve issues by self so I would be thankful at least for advise or pointing a way to figure it out.

edit: forgot to mention that hosting provider is ovh/kimsufi if that matter.

Unwanted automatically started tmpfs and lib/systemd/systemd --user process for not logged in user

Posted: 06 Jul 2021 09:09 AM PDT

Debian 11 Bullseye pc, systemd, no display manager, startx is used to start X, multiple users.

When I login with a user, let's say auser-UID 1000, I see this on process list:

USER     PID %CPU %MEM    VSZ   RSS TTY     STAT START   TIME COMMAND  foo      550  0.0  0.1  15280  8928 ?       Ss   16:18   0:00 /lib/systemd/systemd --user  foo      554  0.0  0.0 166520  2732 ?       S    16:18   0:00 (sd-pam)  auser    657  0.0  0.1  15280  8928 ?       Ss   16:18   0:00 /lib/systemd/systemd --user  auser    658  0.0  0.0 166520  2732 ?       S    16:18   0:00 (sd-pam)  

Apparently they are related to these mounts (foo-UID 1001):
cropped mount command result:

tmpfs on /run/user/1001 type tmpfs (rw,nosuid,nodev,relatime,size=791080k,nr_inodes=197770,mode=700,uid=1001,gid=1001)  tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,size=791080k,nr_inodes=197770,mode=700,uid=1000,gid=1000)  

That's prior to starting X, very few processes, nothing in my knowledge is started automatically by foo which is not logged in.

How can I locate what starts these 2 foo processes? It happens automatically at boot, there is an entry in journal:

systemd[542]: pam_unix(systemd-user:session): session opened for user foo(uid=1001) by (uid=0)  

There are also other local users on the system, but no tmpfs is started automatically for them.

Mount mirror XFS RAID with write capability

Posted: 06 Jul 2021 09:06 AM PDT

i have a buffalo NAS. Mirror RAID. Two drives. XFS file system. I put larger disks and want to copy data back but it is painfully slow over the network or over built in "USB3" port.

Is there a way to mount both drives on linux machine with write capability so I could copy files over SATA and then just pop the drives back to NAS?

Python nmap - PortScannerAsync(), cannot trap callback function data globally

Posted: 06 Jul 2021 09:07 AM PDT

I am using the nma = nmap.PortScannerAsync()

from nma.scan(target, port, arguments='-A', callback=callback_p)

From the function callback_p() I can print each return without difficulty, what I cannot seem to do it trap each globally.

Globally I declared a dictionary data_dict = dict()

def callback_p(host, result):      global data_dict      print('---')      print(host, result)      print('---')      data_dict[host] = result  

However, the data_dict stubbornly remains empty. I have even declared it as a global variable within the function but alas no avail. Surely there is a way to trap the asynchronous data and use it globally after the nma.still_scanning() == False?

Code

#! /usr/bin/env python3  ''' NMAP Asynchronous Scan '''    import sys  import nmap    target = '192.168.0.10-12'  port = '22-1024'  data_dict = dict()    def callback_p(host, result):      ''' Callback Printer '''      global data_dict      print('\n---')      print(host, result)      data_dict[host] = result      return 0    # // Create an NMAP object //  nma = nmap.PortScannerAsync()    # // Asynchronous scan and callback as results come in //  nma.scan(target, port, arguments='-A', callback=callback_p)    #// Print dots to indicate program is working //  while nma.still_scanning():      print('.', end=' ', flush=True)      nma.wait(1)    # // Print dictionary output //  print()  print('data_dict', data_dict)  

Print all files whose path is shared by more than one file in a list of files

Posted: 06 Jul 2021 08:56 AM PDT

I have around 200+ files, some in the same directory as others in the list, and some which are the only ones in their respective directory. I need to print the files which share their path with at least one other file in the list.

Example:

  • Source list of files
    1.a/b/c/d/aar  2.a/b/c/d/aar1  3.e/f/g/h/gggg  4.i/j/k/l/dddd  5.i/j/k/l/dddd1  
  • Desired output:
    a/b/c/d/aar  a/b/c/d/aar1  i/j/k/l/dddd  i/j/k/l/dddd1  

How to seperate fields in a column (into their own named columns) and then remove repeated words from each entry

Posted: 06 Jul 2021 09:25 AM PDT

I have a tsv file with 9 variables, as follows:

> seqnames  start   endwidth    strand  metadata    X.10logMacsq    annotation  distanceToTSS  

The metadata column contains information I want to do some analysis on, but I first need to split the entries and put them into their own columns (with a heading). The metadata looks like this (1st row):

ID=SRX067411;Name=H3K27ac%20(@%20HMEC);Title=GSM733660:%20Bernstein%20HMEC%20H3K27ac;Cell%20group=Breast;<br>source_name=HMEC;biomaterial_provider=Lonza;lab=Broad;lab%20description=Bernstein%20-%20Broad%20Institute;datatype=ChipSeq;datatype%20description=Chromatin%20IP%20Sequencing;cell%20organism=human;cell%20description=mammary%20epithelial%20cells;cell%20karyotype=normal;cell%20lineage=ectoderm;cell%20sex=U;antibody%20antibodydescription=rabbit%20polyclonal.%20Antibody%20Target:%20H3K27ac;   

There are 27 entries for this column (per row) in total (not all shown here) but I thought I'd write them all into their own columns first, and then remove the ones I don't need afterwards. Once they have a descriptive column heading, then I could also remove their names (e.g.: ID=SRX would simply be SRX and so forth)

Can anyone help me out with this or give some advice? I am fairly new to Bash and not very comfortable with the commands yet.

So far I've just managed to clean the file up a bit with:

cut --complement -f 9-14 hisHMECanno.tsv | sed 's/%20/ /g' > hisHMECannoFilt.tsv  

(the orginal files had some unneccessary columns that I just removed as well)

Then I have been trying to use awk to separate the entries into tab separated columns, but to no avail..

Any help would be greatly appreciated!

In unix-like systems, is there an anonymous login and how to disable it?

Posted: 06 Jul 2021 09:05 AM PDT

I am a DevOps engineer working with AWS. My company is under a security audit and we got a report stating the following points:

--- REPORT BEGIN ---

Observation: In some EC2 instances, anonymous logins are allowed which in turn allows users with root privileges to login without a password.

Consequences: It can grant non-authorized access to the console which might cause privilege scalation or issues with data confidentiality.

Recommendation: To always ask password when logging in and also when executing root commands.

Action: Implement .pem certificates and disable anonymous login for the given ec2 list.

--- REPORT END ---

All instances listed in their report have already these mitigations in place:

  • To SSH to them you need a .pem file
  • You cannot SSH to them with the root user (you must login with another user e.g. centos, ubuntu)
  • Once you are connected to an instance with a user that can executes root commands, if you try to execute a root command you have to type the user's password.
  • There were around 27 instances reported. Almost all of them have Ubuntu or CentOS.

So having said that, my questions are...

  • What am I missing to meet the audit requirements?
  • What would they mean by anonymous login?
  • How to disable whatever this "anonymous login" is?

My only idea as of now is to ask for both KeyAuthentication and PasswordAuthentication when SSH, but not sure if that would help or hurt.

How to Install Specific versions of Kernal from Vault (CentOS)

Posted: 06 Jul 2021 08:21 AM PDT

Do to compatibility issues with our Backup Software, and Anti-Virus. I need to install a specific version of the kernal. Our current (4.18.0-147.el8.x86_64) isn't compatible with A/V and our Backup hasn't updated to support the newest kernal.

Relevent Server information  OS: CentOS 8  Kernel (current): 4.18.0-147.el8.x86_64  Kernal (Needed): 4.18.0-240.22.1.el8_3  Use: Test WebServer  Backup Software: Veeam  A/V: VmWare Carbon Black  

I have located the version I want in the CentOS vault (https://vault.centos.org/) but I can't figure out how to add the vault as a repo.

From what I have read I either need to get an rpm or create the file myself. But I am not sure how/where to get the information/rpm.

How to create CSV with headers from JSON using jq

Posted: 06 Jul 2021 10:21 AM PDT

I am trying to create a csv file with headers from a json using jq.

I have the following snippet https://jqplay.org/s/H_U5mxbTFW

Question: How can I print the values of peerings > accept_vpc_info > tenant_id and peerings > accept_vpc_info > vpc_id

What i tried:

The JSON

{      "peerings": [          {              "accept_vpc_info": {                  "tenant_id": "184a5",                  "vpc_id": "0d11f"              },              "created_at": "2018-11-07T08:53:43",              "description": null,              "id": "0b19d",              "name": "NAME1",              "request_vpc_info": {                  "tenant_id": "08a7b",                  "vpc_id": "1645f"              },              "status": "ACTIVE",              "updated_at": "2018-11-07T09:47:44"          },          {              "accept_vpc_info": {                  "tenant_id": "067eb",                  "vpc_id": "17944"              },              "created_at": "2019-06-12T08:29:08",              "description": null,              "id": "0d34a",              "name": "NAME2",              "request_vpc_info": {                  "tenant_id": "0fd7b",                  "vpc_id": "102c9"              },              "status": "ACTIVE",              "updated_at": "2019-06-12T12:04:56"          },          {              "accept_vpc_info": {                  "tenant_id": "0ae21",                  "vpc_id": "071c4"              },              "created_at": "2019-02-21T09:07:35",              "description": null,              "id": "173e2",              "name": "NAME3",              "request_vpc_info": {                  "tenant_id": "05a21",                  "vpc_id": "0586e"              },              "status": "ACTIVE",              "updated_at": "2019-02-21T09:10:41"          }              ]      }  

JQ:

.[] | flatten | map({created_at,description,id,name,status,updated_at}) | (first | keys_unsorted) as $keys | map([to_entries[] | .value]) as $rows | $keys,$rows[] | join (", ")  

It is working without adding accept_vpc_info and request_vpc_info.

I try to add these as header: accept_vpc_info, accept_vpc_info_tenant_id, accept_vpc_info_vpc_id, created_at, description, id, name,request_vpc_info, request_vpc_info_tenant_id, request_vpc_info_vpc_id, status, updated_at

Something like this:

"accept_vpc_info__tenant_id","accept_vpc_info__vpc_id","created_at","description","id","name","request_vpc_info__tenant_id","request_vpc_info__vpc_id","status","updated_at"  "184a5","0d11f","2018-11-07T08:53:43","null","0b19d","NAME1","08a7b","1645f","ACTIVE","2018-11-07T09:47:44"  "067eb","17944","2019-06-12T08:29:08","null","0d34a","NAME2","0fd7b","102c9","ACTIVE","2019-06-12T12:04:56"  "0ae21","071c4","2019-02-21T09:07:35","null","173e2","NAME3","05a21","0586e","ACTIVE","2019-02-21T09:10:41"  

How can I print also the values of peerings > accept_vpc_info > tenant_id and peerings > accept_vpc_info > vpc_id ?

Thank you

What Username launch the service?

Posted: 06 Jul 2021 09:04 AM PDT

OS: Debian 10.10

I'm searching other command than cat /lib/systemd/system/rsyslog.service to show the user running the service.

Thank's

How to run a command everytime that I exit a shell

Posted: 06 Jul 2021 08:47 AM PDT

I have been trying to run a command to cleanup some of my temporary files every time I exit a shell.

I initially thought that this would be the job of .zlogout but it doesn't seem to be executed if I, for example, have multiple shells open in my terminal emulator (kitty). From what I have found in the doc, .zlogin and .zlogout apply to login shells only, which, correct me if I am wrong, is not the case when you simply open different tabs or windows in your terminal emulator.

What is the equivalent of .zlogout for non-login shells and alternatively what would be the recommended way to achieve a similar effect in non-login shells.

Debian revision suffixes - why do they change during apt upgrade when I have not run apt update?

Posted: 06 Jul 2021 09:26 AM PDT

For example, I have the libxml2 package installed. Its version is 2.9.4+dfsg1-2.2+deb9u4.

What does the u4 part mean at the end?

If I run apt -y upgrade without running apt update first, why will this upgrade the package to 2.9.4+dfsg1-2.2+deb9u5 (everything is the same, but now u5 is on the end)?

Edit: I have noticed the same thing happen with many other packages, where they will upgrade with no apt update if the only thing changing is that final u number.

Extracting domains from a CSV URL column using Miller

Posted: 06 Jul 2021 08:40 AM PDT

Having CSV content similar to this:

Family,URL,IP,FirstSeen  Pony,http://officeman.tk/images/admin.php,207.180.230.128,01-06-2019  Pony,http://learn.cloudience.com/ojekwaeng/yugo/admin.php,192.145.234.108,01-06-2019  Pony,http://vman23.com/ba24/admin.php,95.213.204.53,01-06-2019  

I'm aware that the URL column can be selected using:

mlr --mmap --csv --skip-comments --headerless-csv-output cut -f 'URL'  

How could domains be extracted using Miller w/out piping to other commands?

Desired Output:

officeman.tk  learn.cloudience.com  vman23.com  

netstat cannot find opened port by iptables

Posted: 06 Jul 2021 08:08 AM PDT

My Linux command is following:

iptables -I INPUT -p tcp --dport 5002 -j ACCEPT  iptables-save  netstat -natp  

but the result of netstat has no item about 5002.

List all files with extensions .tif, .tiff, .TIF, .TIFF

Posted: 06 Jul 2021 09:28 AM PDT

Given a nested directory, I would like to list all tif files with extension .tif, .TIF, .tiff, .TIFF.

Currently I'm using

find . -type f -iname *.TIF -print ; find . -type f -iname *.TIFF -print;  

Using -iname allows me to be case-insensitive but it goes through the directory twice to get files with .tif and .tiff. Is there a better way to do this? Perhaps with brace expansion?

Why not *.tif*?

In some cases, my directories might have auxiliary files with extension .tif.aux.xml alongside the tiffs. I'd like to ignore those.

My RF wireless keyboard keeps sending XF86Forward KeyPress and KeyRelease events to the system after each keypress/keyrelease I do

Posted: 06 Jul 2021 10:22 AM PDT

After one fall, my RF wireless keyboard keeps sending XF86Forward KeyPress and KeyRelease events to the system after each keypress/keyrelease I do :

$ xev -event keyboard | egrep -w "KeyPress|KeyRelease|keycode"  KeyRelease event, serial 34, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyPress event, serial 37, synthetic NO, window 0x3c00001,      state 0x10, keycode 24 (keysym 0x61, a), same_screen YES,  KeyPress event, serial 37, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyRelease event, serial 38, synthetic NO, window 0x3c00001,      state 0x10, keycode 24 (keysym 0x61, a), same_screen YES,  KeyRelease event, serial 39, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyPress event, serial 311, synthetic NO, window 0x3c00001,      state 0x10, keycode 56 (keysym 0x62, b), same_screen YES,  KeyPress event, serial 312, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyRelease event, serial 312, synthetic NO, window 0x3c00001,      state 0x10, keycode 56 (keysym 0x62, b), same_screen YES,  KeyRelease event, serial 313, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyPress event, serial 313, synthetic NO, window 0x3c00001,      state 0x10, keycode 54 (keysym 0x63, c), same_screen YES,  KeyPress event, serial 313, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyRelease event, serial 314, synthetic NO, window 0x3c00001,      state 0x10, keycode 54 (keysym 0x63, c), same_screen YES,  KeyRelease event, serial 315, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyPress event, serial 315, synthetic NO, window 0x3c00001,      state 0x10, keycode 40 (keysym 0x64, d), same_screen YES,  KeyPress event, serial 315, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  KeyRelease event, serial 316, synthetic NO, window 0x3c00001,      state 0x10, keycode 40 (keysym 0x64, d), same_screen YES,  KeyRelease event, serial 317, synthetic NO, window 0x3c00001,      state 0x10, keycode 167 (keysym 0x1008ff27, XF86Forward), same_screen YES,  

Because of this, I'm unable to log on to my tty[1-6] consoles because each character I type gets a ^@ character appended to it :

$ showkey -k   kb mode was UNICODE   [ if you are trying this under X, it might not work   since the X server is also reading /dev/console ]     press any key (program terminates 10s after last keypress)...   keycode  28 release   keycode  16 press   keycode 159 press   keycode  16 release   keycode 159 release   keycode  48 press   keycode 159 press   keycode  48 release   keycode 159 release   keycode  46 press   keycode 159 press   keycode  46 release   keycode 159 release   keycode  32 press   keycode 159 press   keycode  32 release   keycode 159 release  

EDIT0 : According to /proc/bus/input/devices I have 2 /dev/input/eventX entries for my RAPOO wireless keyboard+mouse combo :

$ cat /proc/bus/input/devices  | grep -P '^[NH]: ' | paste - - | grep RAPOO  N: Name="RAPOO RAPOO 5G Wireless Device"    H: Handlers=sysrq kbd event2 leds   N: Name="RAPOO RAPOO 5G Wireless Device"    H: Handlers=kbd mouse0 event3   

Seems logical because the mouse uses the same RF channel as the keyboard to communicate with the USB mini-receiver.

EDIT1 : According to the Handlers value above /dev/input/event2 seems to receive events from the keyboard alone. Here's an evtest output for /dev/input/event2 :

$ sudo evtest /dev/input/event2  Input driver version is 1.0.1  Input device ID: bus 0x3 vendor 0x24ae product 0x2003 version 0x110  Input device name: "RAPOO RAPOO 5G Wireless Device"  Supported events:    Event type 0 (EV_SYN)    Event type 1 (EV_KEY)  ...    Event type 4 (EV_MSC)      Event code 4 (MSC_SCAN)    Event type 17 (EV_LED)      Event code 0 (LED_NUML) state 0      Event code 1 (LED_CAPSL) state 0      Event code 2 (LED_SCROLLL) state 0      Event code 3 (LED_COMPOSE) state 0      Event code 4 (LED_KANA) state 0  Key repeat handling:    Repeat type 20 (EV_REP)      Repeat code 0 (REP_DELAY)        Value    250      Repeat code 1 (REP_PERIOD)        Value     33  Properties:  Testing ... (interrupt to exit)  Event: time 1625417787.379951, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70058  Event: time 1625417787.379951, type 1 (EV_KEY), code 96 (KEY_KPENTER), value 0  Event: time 1625417787.379951, -------------- SYN_REPORT ------------  Event: time 1625417794.923958, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004  Event: time 1625417794.923958, type 1 (EV_KEY), code 30 (KEY_A), value 1  Event: time 1625417794.923958, -------------- SYN_REPORT ------------  qEvent: time 1625417795.051954, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70004  Event: time 1625417795.051954, type 1 (EV_KEY), code 30 (KEY_A), value 0  Event: time 1625417795.051954, -------------- SYN_REPORT ------------  Event: time 1625417797.083970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005  Event: time 1625417797.083970, type 1 (EV_KEY), code 48 (KEY_B), value 1  Event: time 1625417797.083970, -------------- SYN_REPORT ------------  bEvent: time 1625417797.187973, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70005  Event: time 1625417797.187973, type 1 (EV_KEY), code 48 (KEY_B), value 0  Event: time 1625417797.187973, -------------- SYN_REPORT ------------  Event: time 1625417798.363970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70006  Event: time 1625417798.363970, type 1 (EV_KEY), code 46 (KEY_C), value 1  Event: time 1625417798.363970, -------------- SYN_REPORT ------------  cEvent: time 1625417798.459960, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70006  Event: time 1625417798.459960, type 1 (EV_KEY), code 46 (KEY_C), value 0  Event: time 1625417798.459960, -------------- SYN_REPORT ------------  Event: time 1625417799.195958, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70007  Event: time 1625417799.195958, type 1 (EV_KEY), code 32 (KEY_D), value 1  Event: time 1625417799.195958, -------------- SYN_REPORT ------------  dEvent: time 1625417799.259976, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70007  Event: time 1625417799.259976, type 1 (EV_KEY), code 32 (KEY_D), value 0  Event: time 1625417799.259976, -------------- SYN_REPORT ------------  Event: time 1625417801.379970, type 4 (EV_MSC), code 4 (MSC_SCAN), value 700e0  Event: time 1625417801.379970, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1  Event: time 1625417801.379970, -------------- SYN_REPORT ------------  Event: time 1625417801.587964, type 4 (EV_MSC), code 4 (MSC_SCAN), value 70006  Event: time 1625417801.587964, type 1 (EV_KEY), code 46 (KEY_C), value 1  Event: time 1625417801.587964, -------------- SYN_REPORT ------------  

EDIT2: Whereas /dev/input/event3 seems to receive events from both the keyboard and the mouse. Here's an evtest output for /dev/input/event3 (notice the KEY_FORWARD events after each keypress and keyrelease) :

$ sudo evtest /dev/input/event3  Input driver version is 1.0.1  Input device ID: bus 0x3 vendor 0x24ae product 0x2003 version 0x110  Input device name: "RAPOO RAPOO 5G Wireless Device"  Supported events:    Event type 0 (EV_SYN)    Event type 1 (EV_KEY)      ...    Event type 3 (EV_ABS)      Event code 32 (ABS_VOLUME)        Value      0        Min        0        Max      896    Event type 4 (EV_MSC)      Event code 4 (MSC_SCAN)  Properties:  Testing ... (interrupt to exit)  Event: time 1625418203.492208, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418203.492208, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0  Event: time 1625418203.492208, -------------- SYN_REPORT ------------  Event: time 1625418205.620275, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418205.620275, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1  Event: time 1625418205.620275, -------------- SYN_REPORT ------------  aEvent: time 1625418205.908189, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418205.908189, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0  Event: time 1625418205.908189, -------------- SYN_REPORT ------------  Event: time 1625418207.076271, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418207.076271, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1  Event: time 1625418207.076271, -------------- SYN_REPORT ------------  bEvent: time 1625418207.348222, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418207.348222, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0  Event: time 1625418207.348222, -------------- SYN_REPORT ------------  Event: time 1625418208.356296, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418208.356296, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1  Event: time 1625418208.356296, -------------- SYN_REPORT ------------  cEvent: time 1625418208.660204, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418208.660204, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0  Event: time 1625418208.660204, -------------- SYN_REPORT ------------  Event: time 1625418209.636254, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418209.636254, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 1  Event: time 1625418209.636254, -------------- SYN_REPORT ------------  dEvent: time 1625418209.924202, type 4 (EV_MSC), code 4 (MSC_SCAN), value c0225  Event: time 1625418209.924202, type 1 (EV_KEY), code 159 (KEY_FORWARD), value 0  Event: time 1625418209.924202, -------------- SYN_REPORT ------------  Event: time 1625418211.564204, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001  Event: time 1625418211.564204, type 1 (EV_KEY), code 272 (BTN_LEFT), value 1  Event: time 1625418211.564204, -------------- SYN_REPORT ------------  Event: time 1625418211.620212, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90001  Event: time 1625418211.620212, type 1 (EV_KEY), code 272 (BTN_LEFT), value 0  Event: time 1625418211.620212, -------------- SYN_REPORT ------------  Event: time 1625418216.572202, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002  Event: time 1625418216.572202, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 1  Event: time 1625418216.572202, -------------- SYN_REPORT ------------  Event: time 1625418216.644212, type 4 (EV_MSC), code 4 (MSC_SCAN), value 90002  Event: time 1625418216.644212, type 1 (EV_KEY), code 273 (BTN_RIGHT), value 0  Event: time 1625418216.644212, -------------- SYN_REPORT ------------  Event: time 1625418218.780207, type 2 (EV_REL), code 0 (REL_X), value -1  Event: time 1625418218.780207, -------------- SYN_REPORT ------------  Event: time 1625418218.788214, type 2 (EV_REL), code 0 (REL_X), value -1  Event: time 1625418218.788214, -------------- SYN_REPORT ------------  ^C  

EDIT3: sudo timeout 5s evtest --grab /dev/input/eventX works but the pb. is that :

/dev/input/event2 only receives all EV_KEY keyboard events WITHOUT extra KEY_FORWARD EV_KEY events and no mouse events. And /dev/input/event3 seems to receive mouse events and ONLY KEY_FORWARD EV_KEY keyboard events (no other EV_KEY events).

So, I use only /dev/input/event2, the mouse will not work and if I use only /dev/input/event3, the keyboard will not work.

udevadm info confirms that /dev/input/event2 is used for the keyboard events and /dev/input/event3 is used for the mouse events:

$ udevadm info /dev/input/event2 | grep event-  S: input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-event-kbd  S: input/by-path/pci-0000:00:1d.3-usb-0:1:1.0-event-kbd  E: DEVLINKS=/dev/input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-event-kbd /dev/input/by-path/pci-0000:00:1d.3-usb-0:1:1.0-event-kbd  $ udevadm info /dev/input/event3 | grep event-  S: input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-if01-event-mouse  S: input/by-path/pci-0000:00:1d.3-usb-0:1:1.1-event-mouse  E: DEVLINKS=/dev/input/by-path/pci-0000:00:1d.3-usb-0:1:1.1-event-mouse /dev/input/by-id/usb-RAPOO_RAPOO_5G_Wireless_Device-if01-event-mouse  

How can I stop my RF keyboard from sending those XF86Forward KeyPress and KeyRelease events ?

Too many open files despite a sufficiently high open files limit

Posted: 06 Jul 2021 10:17 AM PDT

I'm running a daemon that routinely stats and opens files. It also copies the data from these files over the network to various cloud providers. The daemon runs as a single process. After the process starts I increase the open file limit from the system default of 1024 to 32768 with prlimit --pid <the process id> --nofile=32768:32768. I've verified that the soft and hard file limits do actually get updated.

Note: When I mention currently open files, I'm referring to the value as returned by lsof continually running in another window (while [ true ]; do sudo lsof -p <the process id> | wc -l; done;). It's not just some guess.

The server runs fine for a while, and even under high load it has <3500 files open. However, sometimes under moderate load when only a few hundred files are open (<500) the process starts receiving "too many open files" errors when trying to create sockets, open files, stat files, etc.

Is there some other variable/limit that I'm not accounting for that would cause 'too many open files' even though the soft limit is at 32768 and only a few hundred are actually shown to be open?

Relevant info:

  • Red Hat Enterprise Linux Server 7.6
  • Kernel 3.10.0-957.el7.x86_64 (I know it's ancient. It's not in my control)

Just to be completely clear, by the kernel's own records (via lsof), the process is not using too many open files. When these errors start occurring the kernel reports only a few hundred open file descriptors (with a process limit of 32768).

Why can't I see new NIC with nmtui on CentOS 8 and how to resolve?

Posted: 06 Jul 2021 08:09 AM PDT

In a nuthsell:

I cannot see my newly added NIC with nmtui on CentOS 8. How to resolve it?

Detail:

I've installed a CentOS 8 VM on VirtualBox.

Usually I configure two NICs during the installation:

  • One as NAT so it can connect to the outside network
  • The other as Host Only so I can access it with internal IP

I didn't use Bridged network for I don't want to expose those VMs to the outside world.

It works well for all my VMs.

But when installing a new server I forgot to set a second NIC on VirtualBox during the OS installation, so I added a new NIC in VirtualBox after the installation.

Now I'm able to see the the newly added NIC with both "ip addr" :

[root@cent8-4 ~]# ip addr  1: lo: ...  2: enp0s3: /*My working NIC*/ <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000      link/ether 08:00:27:de:33:18 brd ff:ff:ff:ff:ff:ff      inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic noprefixroute enp0s3         valid_lft 84236sec preferred_lft 84236sec      inet6 ...  3: enp0s8: /*The newly added NIC*/ <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000      link/ether 08:00:27:a7:c7:56 brd ff:ff:ff:ff:ff:ff  4: virbr0: ...  5: virbr0-nic: ...  

and "nmcli device":

[root@cent8-4 ~]# nmcli device  DEVICE      TYPE      STATE         CONNECTION  enp0s3      ethernet  connected     enp0s3  /*My working NIC*/  virbr0      bridge    connected     virbr0  enp0s8      ethernet  disconnected  --      /*The newly added NIC*/  lo          loopback  unmanaged     --  virbr0-nic  tun       unmanaged     --  

Note that enp0s3 is the NIC which I've configured during the installation, while enp0s8 is the one that I added after the installation.

But when I use nmtui to configure the IP address of the newly added NIC, I just can't see it in "Edit a connection" screen:

enter image description here

Neither can I see it in "Activate a connection" screen:

enter image description here

So how can I make nmtui recognize this new NIC?

Some articles say that I have to use "auto enp0s8" to initialize the NIC, but it seems that CentOS 8 doesn't have that tool:

[root@cent8-4 network-scripts]# auto enp0s8  bash: auto: command not found...  

How do I set mirrors in /etc/apt/sources.list with a Debian preseed file?

Posted: 06 Jul 2021 08:48 AM PDT

I'm building a custom ISO image of Debian 10 stable ("buster") using preseeding, and my custom preseed.cfg file works perfectly except for one thing: I'd like it to configure /etc/apt/sources.list with my chosen repositories so that I don't have to do it manually every time I install a new system.

The goal is an /etc/apt/sources.list that looks like this (https is a necessity here):

deb https://deb.debian.org/debian buster main contrib non-free  deb-src https://deb.debian.org/debian buster main contrib non-free    deb https://deb.debian.org/debian-security/ buster/updates main contrib non-free  deb-src https://deb.debian.org/debian-security/ buster/updates main contrib non-free    deb https://deb.debian.org/debian buster-updates main contrib non-free  deb-src https://deb.debian.org/debian buster-updates main contrib non-free  

My preseed.cfg file looks like this:

#### Contents of the preconfiguration file (for buster)  ### Localization  # Preseeding only locale sets language, country and locale.  d-i debian-installer/locale string en_US    # Keyboard selection.  d-i keyboard-configuration/xkb-keymap select us  # d-i keyboard-configuration/toggle select No toggling    ### Network configuration  d-i netcfg/choose_interface select auto  d-i netcfg/get_hostname string unassigned-hostname  d-i netcfg/get_domain string unassigned-domain  d-i netcfg/hostname string vienna1-preseed    d-i netcfg/wireless_wep string    ### Mirror settings  d-i mirror/country string manual  d-i mirror/http/hostname string http.us.debian.org  d-i mirror/http/directory string /debian  d-i mirror/http/proxy string    ### Account setup  d-i passwd/root-login boolean false    # To create a normal user account.  d-i passwd/user-fullname string theusername  d-i passwd/username string theusername  d-i passwd/user-password-crypted password $6$qVk198UWGPxpW$tzMYxQyiOrI4ClDJdDGALsyYq1j1IbXWbpem3JevFT9Krqdmt4wKdvtiY8ry3PRh277V6GHzSKP3zSI7jt04Y/    ### Clock and time zone setup  d-i clock-setup/utc boolean true  d-i time/zone string US/Eastern    d-i clock-setup/ntp boolean true    ### Partitioning  d-i partman-auto/method string regular  d-i partman-lvm/device_remove_lvm boolean true  d-i partman-md/device_remove_md boolean true  d-i partman-lvm/confirm boolean true  d-i partman-lvm/confirm_nooverwrite boolean true  d-i partman-auto/choose_recipe select atomic    d-i partman-partitioning/confirm_write_new_label boolean true  d-i partman/choose_partition select finish  d-i partman/confirm boolean true  d-i partman/confirm_nooverwrite boolean true    d-i partman-md/confirm boolean true  d-i partman-partitioning/confirm_write_new_label boolean true  d-i partman/choose_partition select finish  d-i partman/confirm boolean true  d-i partman/confirm_nooverwrite boolean true      # https://serverfault.com/a/622818  d-i apt-setup/use_mirror boolean false  d-i apt-setup/cdrom/set-first boolean false  d-i apt-setup/cdrom/set-next boolean false  d-i apt-setup/cdrom/set-failed boolean false    ### Base system installation  # Configure APT to not install recommended packages by default. Use of this  # option can result in an incomplete system and should only be used by very  # experienced users.  #d-i base-installer/install-recommends boolean false    ### Apt setup  # You can choose to install non-free and contrib software.  d-i apt-setup/non-free boolean true  d-i apt-setup/contrib boolean true    ### Package selection  tasksel tasksel/first multiselect standard  d-i pkgsel/upgrade select full-upgrade  popularity-contest popularity-contest/participate boolean false    ### Boot loader installation  d-i grub-installer/only_debian boolean true  d-i grub-installer/with_other_os boolean true  d-i grub-installer/bootdev  string default    d-i finish-install/reboot_in_progress note  d-i debian-installer/exit/poweroff boolean true  

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

Posted: 06 Jul 2021 08:04 AM PDT

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?

Desktop completely freezing on I/O operations

Posted: 06 Jul 2021 09:07 AM PDT

In my old system, I was already having desktop freezes on some heavy I/O operations like apt-get dist-upgrade and copying 4 GB video files. But now, it has become a lot worse: any apt-get install is enough the freeze the whole desktop, and copying the videos with nice -c 3 does not help at all, I cannot do any operation for minutes. According to man ionice, the impact of an idle I/O process on normal system activity should be zero.

One weird swap problem appeared as well: I had disabled the swap partition, and twice an OOM was triggered. But instead of killing the process that trigerred the OOM (I set vm.oom_kill_allocating_task=1), the disk started spinning and totally froze the desktop for a long time, although I had run sudo swapoff -a and checked whether it worked.

The old hardware and system:

  • Hard drive: 500 GB Toshiba
  • System: Debian 7.9 (32 bits)
  • Kernel: 3.15.10-zen-686 (Liquorix)
  • Disk scheduler: BFQ
  • Filesystem: ext4

The new hardware and system:

  • Hard drive: 1 TB Samsung
  • System: Ubuntu 15.10 (64 bits)
  • Kernel: 4.2.0-30-generic
  • Disk scheduler: Deadline (default)
  • Filesystem: encrypted LVM with Btrfs

I have found many people who have solved similar problems by changing from the CFQ scheduler to Deadline, but Deadline is the default on the Ubuntu kernel. And I already had problems with the supposedly fast BFQ disk scheduler with no encryption.

php drop down menu to execute script with argument

Posted: 06 Jul 2021 10:07 AM PDT

I have shell script which I run like this

/var/www/test.sh 2015  

or

/var/www/test.sh 2014  

When this script runs, it actually takes data from freeradius and generates gnuplot base graph for the specific year in the www folder like

/var/www/output.jpg   

Now I want to make a php drop down menu with years like 2015, 2014 and so on, and when user select any year, it should run the script with the specific choice year. But how can I pass year to the shell script.

so far I have tried this but its not working.

root@rm:/var/www# cat test5.php    <html>  <head><title>some title</title></head>  <body>    <form method="post" action="">      <input type="text" name="something" value="<?= isset($_POST['something']) ? htmlspecialchars($_POST['something']) : '' ?>" />      <input type="submit" name="submit" />    </form>    <?php  if(isset($_POST['submit'])) {  echo ($_POST['something']);  // Now the script should be executed with the selected year         $message=shell_exec("/var/www/test.sh $something");  // and after executing the script, this page should also open the output.jpg in the browser    }  ?>  </body>  <html>  root@rm:/var/www#  

No comments:

Post a Comment