Friday, July 15, 2022

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


How to set bash script parameter to file minus the extension

Posted: 15 Jul 2022 04:37 PM PDT

so I have this bash file called test.sh

#!/bin/bash -l  out_file=`basename "$0"`  #SBATCH --gpus=1  #SBATCH -p long  #SBATCH -o err_${out_file::-3}.out  

and I want to output the error to err_test.out, which is what I'm trying to do in the above file, but it's giving an error. Doesn't like the = how can I set the output file to the file name I specified.

How do I resolve an error with the pNFS mapping daemon?

Posted: 15 Jul 2022 03:52 PM PDT

I get an annoying error on my Ubuntu Server installation with nfs-blkmap. Running the command

~$ systemctl status nfs-blkmap.service  

Yields the following

× nfs-blkmap.service - pNFS block layout mapping daemon       Loaded: loaded (/lib/systemd/system/nfs-blkmap.service; enabled; vendor preset: enabled)       Active: failed (Result: protocol) since Wed 2022-07-13 16:16:36 UTC; 2 days ago          CPU: 1ms    Jul 13 16:16:36 homeserver systemd[1]: Starting pNFS block layout mapping daemon...  Jul 13 16:16:36 homeserver blkmapd[1511]: open pipe file /run/rpc_pipefs/nfs/blocklayout failed: No such file or directory  Jul 13 16:16:36 homeserver systemd[1]: nfs-blkmap.service: New main PID 1511 does not exist or is a zombie.  Jul 13 16:16:36 homeserver systemd[1]: nfs-blkmap.service: Failed with result 'protocol'.  Jul 13 16:16:36 homeserver systemd[1]: Failed to start pNFS block layout mapping daemon.  

I'll admit I haven't done much except some googling because I'm kinda afraid to mess up something. Could someone help me out?

Possible missing firmware although firmware is installed

Posted: 15 Jul 2022 04:10 PM PDT

I get missing firmware messages although firmware is installed (on Debian bookworm).

sudo update-initramfs -u  update-initramfs: Generating /boot/initrd.img-5.18.0-2-amd64  W: Possible missing firmware /lib/firmware/i915/skl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/bxt_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/glk_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/kbl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/cml_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/icl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/ehl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/dg1_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/tgl_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/adlp_guc_69.0.3.bin for module i915  W: Possible missing firmware /lib/firmware/i915/adlp_dmc_ver2_14.bin for module i915  

I followed this solution Possible missing firmware /lib/firmware/i915/* for module i915

apt-file search says for all lines above that firmware-misc-nonfree is missing:

apt-file search tgl_guc  apt-file search  skl_guc  apt-file search  bxt_guc  apt-file search  kbl_guc  apt-file search  glk_guc  apt-file search  kbl_guc  apt-file search  kbl_guc  apt-file search  cml_guc  apt-file search  icl_guc  apt-file search  ehl_guc  apt-file search  ehl_guc  apt-file search  tgl_guc  apt-file search  tgl_guc  apt-file search  dg1_guc  apt-file search  tgl_guc  apt-file search  adlp_guc  apt-file search  adlp_dmc_ver2_14.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_32.0.3.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver1.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver4.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver6.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver6_1.bin  firmware-misc-nonfree: /lib/firmware/i915/skl_guc_ver9_33.bin  firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_32.0.3.bin  firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_ver8_7.bin  firmware-misc-nonfree: /lib/firmware/i915/bxt_guc_ver9_29.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_32.0.3.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_14.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_39.bin  firmware-misc-nonfree: /lib/firmware/i915/glk_guc_32.0.3.bin  firmware-misc-nonfree: /lib/firmware/i915/glk_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/glk_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/glk_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_32.0.3.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_14.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_39.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_32.0.3.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_14.bin  firmware-misc-nonfree: /lib/firmware/i915/kbl_guc_ver9_39.bin  firmware-misc-nonfree: /lib/firmware/i915/cml_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/cml_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/cml_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/icl_guc_32.0.3.bin  firmware-misc-nonfree: /lib/firmware/i915/icl_guc_33.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/icl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/icl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_33.0.4.bin  firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_33.0.4.bin  firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/ehl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_35.2.0.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_35.2.0.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/dg1_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/dg1_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_35.2.0.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_49.0.1.bin  firmware-misc-nonfree: /lib/firmware/i915/tgl_guc_62.0.0.bin  firmware-misc-nonfree: /lib/firmware/i915/adlp_guc_62.0.3.bin  

So I installed firmware-linux, firmware-linux-nonfreeand firmware-misc-nonfree they were indeed missing. But after installing them, the messages does not go away.

What am I missing here?

Dev loop0: unable to read RDB block 8

Posted: 15 Jul 2022 03:58 PM PDT

Every time I boot my laptop I see this warning and from dmesg I get this output:

[    2.895604] Dev loop0: unable to read RDB block 8  [    2.895641]  loop0: unable to read partition table  [    2.895936] loop0: partition table beyond EOD, truncated  

What does this warning means? Should I be worried? I have an SSD and it seems to be working well.

I saw that RDB means Rigid Disk Block from Wikipedia.

When I run fdisk -l I get

Disc /dev/loop0: 4 KiB, 4096 bytes, 8 sectors  Unities: sector of 1 * 512 = 512 bytes  Sector size (logic/physic): 512 bytes / 512 bytes  I/O size (minimal/optimal): 512 bytes / 512 bytes  

(n)vi - Erase in ex mode

Posted: 15 Jul 2022 03:22 PM PDT

How does one erase characters in ex mode (':' command line) of (n)vi 1.79 or make 'Backspace' behave as in Vim?

'Backspace' and 'Delete' only move the cursor left, from where new keystrokes overwrite instead of preferably inserting. This is the same for insert mode, but I can use 'Esc' to clear everything after the cursor; 'Backspace' does erase at the shell command line.

I am using (n)vi in xterm in fvwm, each of which are included in a new OpenBSD 7.1 installation. Note that Vim and its vi command, i.e. :set compatible, are not the same implementation as (n)vi. Some places I have searched:

error: *** A compiler with support for C++11 language features is required

Posted: 15 Jul 2022 02:24 PM PDT

I want to Build GCC 11 from source on Ubuntu 20.04. I had some problems in making package for ROS and hence I decide to update my GNU. my gcc and g++ versions are 11.1.0

when I extract the downloaded version of gcc and try to configure it with

../gcc-releases-gcc-11.1.0/configure -v --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --prefix=/usr/local/gcc-11.1.0 --enable-checking=release --enable-languages=c,c++,fortran --disable-multilib --program-suffix=-11.1  

I encounter below error:

checking build system type... x86_64-pc-linux-gnu  checking host system type... x86_64-pc-linux-gnu  checking target system type... x86_64-pc-linux-gnu  checking for a BSD-compatible install... /usr/bin/install -c  checking whether ln works... yes  checking whether ln -s works... yes  checking for a sed that does not truncate output... /usr/bin/sed  checking for gawk... no  checking for mawk... mawk  checking for libatomic support... yes  checking for libitm support... yes  checking for libsanitizer support... yes  checking for libvtv support... yes  checking for libhsail-rt support... yes  checking for libphobos support... yes  checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc  checking whether the C compiler works... yes  checking for C compiler default output file name... a.out  checking for suffix of executables...   checking whether we are cross compiling... no  checking for suffix of object files... o  checking whether we are using the GNU C compiler... yes  checking whether x86_64-linux-gnu-gcc accepts -g... yes  checking for x86_64-linux-gnu-gcc option to accept ISO C89... none needed  checking whether we are using the GNU C++ compiler... no  checking whether /usr/bin/gcc-11.1.0 accepts -g... no  checking whether g++ accepts -static-libstdc++ -static-libgcc... no  checking for x86_64-linux-gnu-gnatbind... no  checking for gnatbind... no  checking for x86_64-linux-gnu-gnatmake... no  checking for gnatmake... no  checking whether compiler driver understands Ada... no  checking how to compare bootstrapped objects... cmp --ignore-initial=16 $$f1 $$f2  checking whether /usr/bin/gcc-11.1.0 supports C++11 features by default... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=gnu++11... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=gnu++0x... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=c++11... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with +std=c++11... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -h std=c++11... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -std=c++0x... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with +std=c++0x... no  checking whether /usr/bin/gcc-11.1.0 supports C++11 features with -h std=c++0x... no  configure: error: *** A compiler with support for C++11 language features is required.  

I searched a lot but I could not solve. Do you have any suggestion?

Thank you

BitTorrent etiquette with multiple nodes

Posted: 15 Jul 2022 02:33 PM PDT

I have two BitTorrent nodes running, one of which is on a limited data connection. I know you're supposed to leave the node running long enough for it to upload as much as it has downloaded, but is it okay to close the one on the limited connection early if I leave the unlimited one running?

How to permanently disable delayed Ack?

Posted: 15 Jul 2022 12:53 PM PDT

I have run in to the Nagle / Delayed ACK problem that causes 40ms overhead on small TCP packets.

According to Redhat documentation I can add the quickack 1 option to the route and it will disable the Delayed ACK feature.

So, this is what I did:

[root@x]# ip route show  default via 10.100.11.1 dev ens192 proto static metric 100  10.100.11.0/24 dev ens192 proto kernel scope link src 10.100.11.13 metric 100  

And then I added the quickack option to my interface:

[root@x]# ip route change 10.100.11.0/24 dev ens192 proto kernel scope link src 10.100.11.13 metric 100 quickack 1  

This solved the problem.

However, how do I make this change permanent? Or is this even the best method for disabling this feature?

I tried to add 10.100.11.0/24 dev ens192 proto kernel scope link src 10.100.11.13 metric 100 quickack 1 to /etc/sysconfig/network-scripts/route-ens192 but it did not persist.

I am using RHEL 7.9.

Up wlan as reserve channel if eth doesn't work

Posted: 15 Jul 2022 12:50 PM PDT

I have a server (raspberrypi 4) which I don't have physical access and I want to have spare way to connect to internet.

I want to server used eth0 to connect to router and to get internet, but when internet is not accessible by eth0 then up wlan and connect to router using wlan.

Making a bash script apply to only selected files (Nautilus)

Posted: 15 Jul 2022 02:00 PM PDT

I'm trying to learn (with no programming background) to create some custom bash scripts for converting selected files from Nautilus, but I hit an issue I can't understand.

For reference, this is a script that DOES work. It converts selected .MP4 files to .mkv, copies the time stamp and prints some feedback to the user.

#!/bin/bash    for i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS  do       ffmpeg -i "$i" -movflags use_metadata_tags -c:v libx265 -crf 26 -preset slow -c:a aac -b:a 160k "${i%.*}.mkv" && touch -r "$i" "${i%.*}.mkv" && notify-send "Converted '$(basename "$i")'" || notify-send "Failed converting '$(basename "$i")'"  done    notify-send "Conversion finished"  

Now, this is a script that DOESN'T work. It should convert selected .m4a files to .mp3, add a cover image and some tags, copy the time stamp and give some feedback to the user.

#!/bin/bash    for i in $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS  do       ffmpeg -i "$i" "${i%.*}.mp3" && eyeD3 -a "Author" -A "Album" --add-image="cover.jpg":FRONT_COVER "${i%.*}.mp3" && touch -r "$i" "${i%.*}.mp3" && notify-send "Converted '$(basename "$i")'" || notify-send "Failed converting '$(basename "$i")'"  done    notify-send "Conversion finished"  

When I run this one, I get multiple errors that say "Failed converting (a part of the path to the file)"... for some parts of the path to the file, like parts of folder and file names.

I'm not sure what I'm doing differently here. I'm using the same $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS parameter, but it doesn't work the same in the second script.

As a reference, this other script, which is the same as the second one but applies to all the files in the folder, does work perfectly, so I'm sure the commands inside do do work.

#!/bin/bash    for i in *.m4a  do       ffmpeg -i "$i" "${i%.*}.mp3" && eyeD3 -a "Author" -A "Album" --add-image="cover.jpg":FRONT_COVER "${i%.*}.mp3" && touch -r "$i" "${i%.*}.mp3" && notify-send "Converted '$(basename "$i")'" || notify-send "Failed converting '$(basename "$i")'"  done    notify-send "Conversion finished"  

What am I missing? Can the $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS only work with certain file types? Is the issue somewhere else?

Why does /etc/resolv.conf keep changing?

Posted: 15 Jul 2022 02:29 PM PDT

I am running a debian based linux vm using virt-manager with two ethernet interfacs one connected with NAT and the other is bridged to br0, in /etc/network/interfaces I have the following configuration

auto lo  iface lo inet loopback    auto eth0  iface eth0 inet dhcp  

br0 has a dhcp server that in not connected to anything except for a switch

when I reboot the machine /etc/resolv.conf has the following entry

nameserver 192.168.150.1  

which is the network address assigned by NAP, that being said when I try to ping google.com I get the error temporary name resolution failure then I add another entry which is

nameserver 8.8.8.8  

and the vm works fine and I can visit any website but after some time it check /etc/resolv.conf and it has one entry again, even if i left the machine running with out starting anny services or running any programs

Is there a way to find out what is overwriting /etc/resolv.conf Is there a wat to add nameserver 8.8.8.8 to /etc/resolv.conf if it is not found (without using bash files)

dpkg-genbuildinfo: error: badly formed line in files list file, line 1

Posted: 15 Jul 2022 12:35 PM PDT

I am trying to debianize a collection of shell scripts. The build itself is quite simple, as there are no binaries to build – every file that will be installed on the target system is already present in the source tree.

Now the build process fails with an error message I cannot make sense of:

dpkg-genbuildinfo: error: badly formed line in files list file, line 1  dpkg-buildpackage: error: dpkg-genbuildinfo subprocess returned exit status 25  debuild: fatal error at line 1182:  dpkg-buildpackage -us -uc -ui failed  

What is the files list file mentioned in the error message – does that refer to the .install file? The file looks like this:

src/main/shell/autorecover      opt/autorecover  src/main/shell/autorecover.d/lib/*      opt/autorecover.d/lib/  src/main/shell/autorecover.d/mods-available/*      opt/autorecover.d/mods-available/  

The debian dir is copied and stripped down from another (more complex) package I built earlier, which completed without such errors iirc.

Nonetheless, I do end up with a deb package which seems to have everything in place – scripts as well as files to install. (Which indicates that the .install file cannot have been all that wrong, at least the files are getting collected.)

What is wrong here? What do I need to fix, or where should I start looking for the error?

enable webmin scheduled package updates in config file

Posted: 15 Jul 2022 03:34 PM PDT

I'm deploying webmin across many servers using Terraform & cloud-init. I want to enable "Scheduled Upgrades" in the "Software Package Updates" module during setup by using a config file template. I can successfully configure the action and reporting email by including the following in /etc/webmin/package-updates/config :

sched_email=sys.admin@...  sched_action=2  

However, there seems to be no entry for the schedule interval selection and enabling it. What other config file (if any) is this info stored in?

I've also tried using the webmin CLI but couldn't figure out the correct option name:

# webmin set-config -m package-updates -o schedule -value 1  # Error: Option 'schedule' is unknown in module package-updates  

.NET SDK wouldn't show up on Fedora 36

Posted: 15 Jul 2022 01:51 PM PDT

Installed .NET and its dependencies by running

sudo dnf install dotnet

After executing

dotnet --info

Host (useful for support):    Version: 6.0.6    Commit:  7cca709db2    .NET SDKs installed:    No SDKs were found.    .NET runtimes installed:    Microsoft.AspNetCore.App 6.0.6 [/usr/lib64/dotnet/shared/Microsoft.AspNetCore.App]    Microsoft.NETCore.App 6.0.6 [/usr/lib64/dotnet/shared/Microsoft.NETCore.App]    To install additional .NET runtimes or SDKs:    https://aka.ms/dotnet-download  

it showed no installed SDKs.

Reinstalled (it was installed) dotnet-sdk-6.0.

sudo dnf reinstall dotnet-sdk-6.0

Reinstalled successfully, still won't show up.

Even tried

sudo dnf install dotnet-sdk-6.0.x86_64

No result after installation.

dotnet --info

Shows that no SDKs are installed, even though they are.

Please help me or show me my mistake.

rsyslog: how to cut string from starting field to end of message

Posted: 15 Jul 2022 01:41 PM PDT

i have some messy devices which i want to handle trough rsyslog 90% of job is done, but i am stuck here

rawmsg: '<133>2022-07-15 17:11:11 eleservice-sw02 51891 Logout the web by admin on web (169.254.101.1).'  rawmsg: '<133>2022-07-15 17:11:14 eleservice-sw02 51890 Login the web by admin on web (169.254.101.1).'  rawmsg: '<132>2022-07-15 18:10:14 piknov29-sw42 43557 CPU RISING THRESHOLD: Total CPU Utilization is 83%.'  

so my question is how to select string from Field nr 5 (F,32:5) until end of line ?

Isolate sub-string after a certain pattern

Posted: 15 Jul 2022 01:53 PM PDT

I have a line in a file like this:

<TD><TR> monogram ended in 1 </TD></TR>  

monogram ended in is always constant but not the 1, this number changes always and can be up to a 3-digit number.

So I need a command to search for monogram ended in and get the number after thit string.

Can anyone help me here.

rename the header of multifasta files

Posted: 15 Jul 2022 11:49 AM PDT

I have multi-fast files like this

>aaaaa.1_prot_CAA66754.1_10  MEKLLDAYLSSLRLNRRQVSEQTGLNYTTLQRASDKDALMISPRILWGIAMMVDKTPGQVLDELIELEMK  >bbbbb.1_prot_CAA66753.1_11  MMSKQDRINRRRRNIMKDAHRIAKLIVSNVGDYMVAMKLALKTVYAYKAMRKEVSSRGNAVEMHTLPLLD  GYARQQFEPEFVAGIPAWAIKKDFMSSSAQDILYFTIDTKVVKETEKAVEIEFATKNPKEHGYVDHHHTW  VAKSIMAA  

I want to rename the header like this by sed or awk

>aaaaa.1_10  MEKLLDAYLSSLRLNRRQVSEQTGLNYTTLQRASDKDALMISPRILWGIAMMVDKTPGQVLDELIELEMK  >bbbbb.1_11  MMSKQDRINRRRRNIMKDAHRIAKLIVSNVGDYMVAMKLALKTVYAYKAMRKEVSSRGNAVEMHTLPLLD  GYARQQFEPEFVAGIPAWAIKKDFMSSSAQDILYFTIDTKVVKETEKAVEIEFATKNPKEHGYVDHHHTW  VAKSIMAA  

but I just know sed a little, like

sed 's/.\(.\)$/\1/'  

to remove the penultimate letter of each line. Can you give me some advice?

How does the tilde expansion work within a shell variable?

Posted: 15 Jul 2022 01:01 PM PDT

I came across something funny when testing my script.

I can ls my directory from the shell manually if I run

$ ls ~/db_backups/  test1  test2  $   

However, if I assign a shell variable a dir location as such with the tilde, it doesn't work. I tried this with both single and double quotes.

$ backupfolder='~/db_backups'  $ echo $backupfolder  ~/db_backups  $ ls $backupfolder  ls: cannot access '~/db_backups': No such file or directory  $   

What is happening with the tilde substitution inside the shell variable? Why can't I ls the directory thru the variable like I can manually with the tilde in the dir name?

How do I stop random Hibernation/sleep? (Ubuntu Desktop 18.04)

Posted: 15 Jul 2022 03:02 PM PDT

Ubuntu Desktop running 18.04 with sleep and hibernation turned off, no monitor/keyboard plugged in, been running now for several weeks with a few custom services perfectly fine.

This morning it was not responding via ssh, and the services were not talking to a cloud application.

I had to restart the machine to get access to any logs. A custom service ran just half a second before this log, so the machine was still active. Some help how to stop this random sleep/hibernation would be great.

Feb 02 06:54:00 home NetworkManager[709]: <info>  [1612248840.1230] manager: sleep: sleep requested (sleeping: no  enabled: yes)  Feb 02 06:54:00 home NetworkManager[709]: <info>  [1612248840.1236] manager: NetworkManager state is now ASLEEP  Feb 02 06:54:00 home NetworkManager[709]: <info>  [1612248840.1253] device (enp1s0): state change: activated -> deactivating (reason 'sleeping', sys-iface-state: 'managed')  Feb 02 06:54:00 home whoopsie[1025]: [06:54:00] offline  Feb 02 06:54:00 home gnome-shell[859]: Screen lock is locked down, not locking  Feb 02 06:54:00 home dbus-daemon[662]: [system] Activating via systemd: service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop.nm-dispatcher.service' requested by ':1.15' (uid=0 pid=709 comm="/usr/sbin/Network  Feb 02 06:54:00 home NetworkManager[709]: <info>  [1612248840.1615] device (enp1s0): state change: deactivating -> disconnected (reason 'sleeping', sys-iface-state: 'managed')  Feb 02 06:54:00 home avahi-daemon[684]: Withdrawing address record for xxx on enp1s0.  Feb 02 06:54:00 home avahi-daemon[684]: Leaving mDNS multicast group on interface enp1s0.IPv6 with address xxx.  Feb 02 06:54:00 home avahi-daemon[684]: Interface enp1s0.IPv6 no longer relevant for mDNS.  Feb 02 06:54:00 home systemd[1]: Starting Network Manager Script Dispatcher Service...  Feb 02 06:54:00 home NetworkManager[709]: <info>  [1612248840.1970] dhcp4 (enp1s0): canceled DHCP transaction, DHCP client pid 968  Feb 02 06:54:00 home dbus-daemon[662]: [system] Successfully activated service 'org.freedesktop.nm_dispatcher'  Feb 02 06:54:00 home NetworkManager[709]: <info>  [1612248840.1971] dhcp4 (enp1s0): state changed bound -> done  Feb 02 06:54:00 home systemd[1]: Started Network Manager Script Dispatcher Service.  Feb 02 06:54:00 home nm-dispatcher[24574]: req:1 'connectivity-change': new request (1 scripts)  Feb 02 06:54:00 home avahi-daemon[684]: Withdrawing address record for 192.168.4.44 on enp1s0.  Feb 02 06:54:00 home nm-dispatcher[24574]: req:1 'connectivity-change': start running ordered scripts...  Feb 02 06:54:00 home avahi-daemon[684]: Leaving mDNS multicast group on interface enp1s0.IPv4 with address 192.168.4.44.  Feb 02 06:54:00 home avahi-daemon[684]: Interface enp1s0.IPv4 no longer relevant for mDNS.  Feb 02 06:54:00 home NetworkManager[709]: <info>  [1612248840.2066] device (enp1s0): state change: disconnected -> unmanaged (reason 'sleeping', sys-iface-state: 'managed')  Feb 02 06:54:00 home kernel: r8169 0000:01:00.0 enp1s0: Link is Down  Feb 02 06:54:00 home nm-dispatcher[24574]: req:2 'down' [enp1s0]: new request (1 scripts)  Feb 02 06:54:00 home nm-dispatcher[24574]: req:2 'down' [enp1s0]: start running ordered scripts...  Feb 02 06:54:00 home systemd[1]: Reached target Sleep.  Feb 02 06:54:00 home systemd[1]: Starting Hybrid Suspend+Hibernate...  Feb 02 06:54:00 home kernel: PM: Image not found (code -22)  Feb 02 06:54:00 home systemd-sleep[24587]: Suspending system...  Feb 02 06:54:00 home kernel: PM: hibernation entry  

This was also the power setting during this time

:/home/me# su - gdm -s /bin/bash  :~$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type  'nothing'  :~$ gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type  'nothing'  :~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type  'nothing'  :~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout  0  :~$ dbus-launch gsettings get org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout  1200  

How can I attach to the the first unattached tmux session, or create a new session if there are no unattached sessions?

Posted: 15 Jul 2022 12:55 PM PDT

How can I attach to the the first tmux session that has no attached clients or, if there are no unattached sessions, create a new session and attach to that?

(The use case is for a command for my terminal emulator to run when opening a new terminal window. I don't want it to create a new session each time I open a window, if there are detached sessions lying around. Nor do I want it to re-attach to the same named session every time, if there's already a window attached to that session. I want it to recycle existing unattached sessions but create new sessions when there are none unattached.)

Manjaro MySQL - mariadb.service fails when trying to start

Posted: 15 Jul 2022 02:01 PM PDT

When trying to start MariaDB with systemctl status mariadb, I get:

● mariadb.service - MariaDB 10.3.15 database server     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)     Active: failed (Result: exit-code) since (date)       Docs: man:mysqld(8)             https://mariadb.com/kb/en/library/systemd/    Process: 2512 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)    Process: 2513 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)    Process: 2521 ExecStart=/usr/bin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)   Main PID: 2521 (code=exited, status=1/FAILURE)     Status: "Starting final batch to recover 13 pages from redo log"    [ERROR] Could not open mysql.plugin table. Some plugins may be not loaded  [Note] Recovering after a crash using tc.log  [Note] Starting crash recovery...  [Note] Crash recovery finished.  [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist  [Note] Server socket created on IP: '::'.  [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist  mariadb.service: Main process exited, code=exited, status=1/FAILURE  mariadb.service: Failed with result 'exit-code'.  Failed to start MariaDB 10.3.15 database server.  

Through following so many various tutorials, I think I've also made it worse. I can't run mysql anymore (in the context of mysql < file.sql), since it says mysql: command not found.

I've tried removing, reinstalling mariadb and rebooting my computer in between; but I'm out of luck. Any ideas?

EDIT: A lot of other people seem to be having this problem, and while it's been >1 year and I don't recall what I did next, I do know that following the Arch Wiki page LINE BY LINE will guarantee a proper install. The formatting of the page made me read over things (important things were small, optional things were bold), but make sure you do that right and your installation should work.

Download error with youtube-dl and axel

Posted: 15 Jul 2022 12:04 PM PDT

I am trying to download following video:

https://www.youtube.com/watch?v=pQWj2Fgxdrc  

by combining 'youtube-dl' and 'axel'. I am trying to download this video in such a way that I want these two softwares (youtube-dl and axel) to not only save this video as "interview.mp4" but also limit download speed to 200KB. For this purpose, I used following command:

youtube-dl -f 22 -c -i --external-downloader /usr/bin/axel -o 'interview.mp4' -s 200000 https://www.youtube.com/watch?v=pQWj2Fgxdrc  

Here I am using following options:

-f 22 for video format

-c for resume download

-i for ignore errors

-o for output file name

-s 200000 for limit download speed to 200KB

However, instead of downloading the video at 200KB and saving it as "interview.mp4", it is giving following error:

ERROR: fixed output name but more than one file to download  

I have also tried following variation of command:

youtube-dl -f 22 -c -i --external-downloader /usr/bin/axel -s 200000 -o 'interview.mp4'  https://www.youtube.com/watch?v=pQWj2Fgxdrc  

and

youtube-dl -f 22 -c -i --external-downloader /usr/bin/axel -o 'interview.mp4' https://www.youtube.com/watch?v=pQWj2Fgxdrc -s 200000  

and

youtube-dl -f 22 -c -i -o 'interview.mp4' --external-downloader /usr/bin/axel -s 200000 https://www.youtube.com/watch?v=pQWj2Fgxdrc  

But still same error is appearing. However, if I remove the option (-s 200000), the error disappear and the video starts to download. But I want to use (-s 200000) option so that it should not eat all the bandwidth. What mistake I am doing here?

Can't connect to remote server using RDP remmina after upgrade

Posted: 15 Jul 2022 03:07 PM PDT

I recently upgraded my Ubuntu to 18.04, and now my Remmina cannot connect to a windows server we use at work. Now I am getting a popup about certificates. It asks if I want to accept the certificate, I click OK and then get a message saying unable to connect. I am getting this error on the command line:

[14:49:19:412] [7223:7537] [INFO][com.freerdp.client.common.cmdline] - loading channelEx cliprdr  [14:49:19:412] [7223:7537] [INFO][com.freerdp.client.common.cmdline] - loading channelEx drdynvc  [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - @           WARNING: CERTIFICATE NAME MISMATCH!           @  [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@  [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - The hostname used for this connection (xxxxx:3389)   [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - does not match the name given in the certificate:  [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - Common Name (CN):  [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] -    EC2AMAZ-FM25IO2  [14:49:19:909] [7223:7537] [ERROR][com.freerdp.crypto] - A valid certificate for the wrong name should NOT be trusted!  [14:50:38:624] [7223:7537] [ERROR][com.freerdp.crypto] - certificate not trusted, aborting.  [14:50:38:624] [7223:7537] [ERROR][com.freerdp.core] - freerdp_set_last_error ERRCONNECT_CONNECT_CANCELLED [0x0002000B]  [14:50:38:624] [7223:7537] [ERROR][com.freerdp.core.connection] - Error: protocol security negotiation or connection failure  0002000B 00000003  

Now this is an internal vpn server so I don't care at all about certificates. Is there a way to add this certificate to a list that it's ok? How do I get around this? And as an aside, this was working before the upgrade just fine. I don't know why it cares now?

Warning: mongodb.service changed on disk. Run systemctl daemon-reload to reload

Posted: 15 Jul 2022 02:13 PM PDT

I'm installing Modern Honey Network but every time I get to the command sudo ./install.sh I end up with this error

Warning: mongodb.service changed on disk. Run systemctl daemon-reload to reload
and I don't know how to get past that, any help would be appreciated.

I'm supposed to get a configuration page after the installation but I can't get there because of this error.

How do I disable my CD/DVD drive?

Posted: 15 Jul 2022 04:01 PM PDT

I'd like to disable my CD/DVD drive so that it doesn't spin up every time I select Save in my Kate editor, or select a file-accessing action in other applications. The spinning up just delays what I'm doing, and I'm not even using the DVD drive.

I want to leave the CD in the drive, and not have it spin up.

I found a website that said a udev rule will definitely disable the drive.

So far, I've tried the following 2 rules (separately), but neither of them disable the DVD drive (it still spins up - even when not mounted):

ENV{ID_SERIAL}=="PIONEER_DVD-RW_DVRTD11RS_SAC1009942", ENV{UDISKS_IGNORE}="1"  
KERNEL=="sr0",ENV{UDISKS_IGNORE}="1", RUN+="/bin/touch /home/peter/udev-rule-ran"  

The RUN+ in the second instance, creates my test file "udev-rule-ran", so this tells me that my rule file is being executed, and that the rule line is being run.

My Question:

Could you tell me what I should be doing to definitely disable the darned DVD drive? I also want to be able to enable the drive again on the occasions that I need it.

Supplementary Details:

I'm trying very hard to write a udev rule to disable my CD/DVD drive. I've tried various non-udev methods to disable it but none of them work.

There is no loaded module¹⁾ for the drive that I can unload, so I can't use that method to disable the drive.

¹⁾ So I think the driver must be compiled into the kernel.

Understanding network problem (syslog)

Posted: 15 Jul 2022 01:01 PM PDT

I am running a lubuntu 14.04 server and its always worked well, except for the last couple of days it keeps dropping off the LAN. I am using a couple of powerlink adapters to connect it up as WiFi was never very solid on it.

Anyway, I plugged a screen and mouse/keyboard into it to try to work out whats up with it, and I tailed the syslog. Here is an excerpt: http://pastebin.com/4ftXsai4

Can someone please give me any clues to what might the problem be? Or any tips on how to track down the issue.

I have unplugged the Ethernet cable from my router and rebooted it all, to no avail.

EDIT #1

I'm not sure what happened. But the server has been up, connected all day today. I am tailing a log file via a remote SSH connection and its not disconnected once.

Could have been that the WiFi card was playing up, or the router was struggling to assign DHCP, although, if it was a DHCP problem, why would it keep disconnecting?

How to find which process is regularly writing to disk?

Posted: 15 Jul 2022 03:05 PM PDT

How can I find which process is constantly writing to disk?

I like my workstation to be close to silent and I just build a new system (P8B75-M + Core i5 3450s -- the 's' because it has a lower max TDP) with quiet fans etc. and installed Debian Wheezy 64-bit on it.

And something is getting on my nerve: I can hear some kind of pattern like if the hard disk was writing or seeking someting (tick...tick...tick...trrrrrr rinse and repeat every second or so).

In the past I had a similar issue in the past (many, many years ago) and it turned out it was some CUPS log or something and I simply redirected that one (not important) logging to a (real) RAM disk.

But here I'm not sure.

I tried the following:

ls -lR /var/log > /tmp/a.tmp && sleep 5 && ls -lR /var/log > /tmp/b.tmp && diff /tmp/?.tmp  

but nothing is changing there.

Now the strange thing is that I also hear the pattern when the prompt asking me to enter my LVM decryption passphrase is showing.

Could it be something in the kernel/system I just installed or do I have a faulty harddisk?

hdparm -tT /dev/sda report a correct HD speed (130 GB/s non-cached, sata 6GB) and I've already installed and compiled from big sources (Emacs) without issue so I don't think the system is bad.

(HD is a Seagate Barracude 500GB)

Get file created/creation time? [duplicate]

Posted: 15 Jul 2022 04:38 PM PDT

Possible Duplicate:
How do I do a ls and then sort the results by date created?

Is there a command in Linux which displays when the file was created ? I see that ls -l gives the last modified time, but can I get the created time/date?

No comments:

Post a Comment