Friday, July 30, 2021

Recent Questions - Unix & Linux Stack Exchange

Recent Questions - Unix & Linux Stack Exchange


torrc doesn't contain the "location-hidden services" section

Posted: 30 Jul 2021 08:52 AM PDT

I'm trying to create a .onion website, but my torrc file doesn't contain the

############### This section is just for location-hidden services ###  

part, instead, it contains only this:

# This file was generated by Tor; if you edit it, comments will not be preserved  .# The old torrc file was renamed to torrc.orig.1, and Tor will ignore it  ClientOnionAuthDir /home/fox/tor/tor-browser_en-US/Browser/TorBrowser/Data/Tor/onion-auth  DataDirectory /home/fox/tor/tor-browser_en-US/Browser/TorBrowser/Data/Tor  GeoIPFile /home/fox/tor/tor-browser_en-US/Browser/TorBrowser/Data/Tor/geoip  GeoIPv6File /home/fox/tor/tor-browser_en-US/Browser/TorBrowser/Data/Tor/geoip6  

Does anyone know how to fix this?

Handling -? as function option argument in bash [duplicate]

Posted: 30 Jul 2021 08:40 AM PDT

I am handling the passing bash option arguments using getopt as outlines below.

Would like to include the option -?

myfunc -?   

so it behaves equivalently to -h and --help. What changes could be made so that I do not get bash: invalid option -- '?'.

  shrtopts="Vhv:C:d:"    longopts="Version,help,verbose:,FS:,incl:,excl:"    longopts="${longopts},dyn,dynamic,RP:,RQ:,context:,directory:"        opts=$(getopt -o "$shrtopts" -l "$longopts" -n "${0##*/}" -- "$@")      if (( $? > 0 )); then        echo "Error return value from getopt $?"      return    fi        eval "set -- ${opts}"    while (( $# > 0 )); do      case "$1" in        ("-h"|"-\?"|"--help")          printf "Print lines in named files."          indus-optsumry-region          shift          return          ;;  

How to i Auto run Script in linux when i boot my system

Posted: 30 Jul 2021 08:05 AM PDT

I am using manjaro linux and i am using

systemd

to auto-start script when i boot my system and it works ,

but the problem is when my system goes to sleep or get locked after being idle for some time then i have to run the script again manually .

why is it like that and how can i over come it

how to kind of vlookup in awk?

Posted: 30 Jul 2021 09:44 AM PDT

I have an infile with fields corresponding to the header line:

$ cat infile  ID  Designation ParentID    ParentDesignation  A1  M.D-Sales   0   UmbrellaCorp  a1  Sr.Sales    A1  b1  Sr.R&D  B1  b2  Jr.SR&D B1  a2  Jr.Sales    A1  B1  M.D-R&D 0   UmbrellaCorp  

Now want to get ParentDesignation of those that are missing in 4th column.

So condition should be: Read eachline, get ParentID that is column 3, match it in column1, then insert it into column4 in front of that child.

so the DESIRED outfile is like this:

ID  Designation ParentID    ParentDesignation  A1  M.D-Sales   0   UmbrellaCorp  a1  Sr.Sales    A1  M.D-Sales  b1  Sr.R&D  B1  M.D-R&D  b2  Jr.SR&D B1  M.D-R&D  a2  Jr.Sales    A1  M.D-Sales  B1  M.D-R&D 0   UmbrellaCorp  

I know when could do same task in excel with vlookup, but I kind of like to do in a scripted way.

Condition: if $3 in any record matches $1 in any record, get $2 of matched line and insert into $4 of the record in question.

Subexpression in ed for multiple substitutions

Posted: 30 Jul 2021 09:44 AM PDT

Let's say I have a piece of text that says:

John went with Sally to the market where they bought fresh bread. There they met with Jim and dined together.  

Let's say that I wanted to write a regex to surround the names John, Sally and Jim with plus signs, as in,

+John+ went with +Sally+ to the market where they bought fresh bread. There they met with +Jim+ and dined together.  

I created the following regex which successfully changes the 1st name to +John+:

g/\(.*\)\(\<John\>\)\(.*\)/s//\1+\2+\3/gp  

I would like to create one that replaces all three names at once, without the need to re-run the command.

I tried a simple multiple substitution, such as:

g/John/s//+&+/
s/Sally/+&+/
s/Jim/+&+/p

But this only changed the first instance of each name.

remove spaces in filenames in find output [duplicate]

Posted: 30 Jul 2021 07:40 AM PDT

I want to list the size of directories under a given root (using du -hs) . The issue is that where the directory names have spaces the du command is getting each word of the name as a whole directory name.

I tried to fix this by quoting the output through xargs but the output is the same.

#!/bin/bash    root="$1"  echo "Searching in $root"  for d in $(find $root -maxdepth 1 -type d | xargs -i echo "'{}'")    do       #      # the root directory can take a long time so let's skip it      #      if [ "$d" != "$root" ]         then           echo "Looking at directory $d"           echo $(du -hs "$d")        fi    done  

Is $? a numeric value?

Posted: 30 Jul 2021 08:04 AM PDT

Have seen a number of posts using

if [ $? -ne 0 ]; then      return  fi    if [ $? -eq 0 ]; then    eval "set -- ${opts}"    while [ $# -gt 0 ]; do      case $1 in  

Is $? a numeric value so I can use

if (( $? != 0 )); then   ...  

or

if (( $? == 0 )); then    ...  

Few commands won't work without "exec bash"

Posted: 30 Jul 2021 07:46 AM PDT

I try these commands

epto  mto  tunnels  

but I get an error

bash: mto: command not found

but after I type this

exec bash  

I get all the commands like mto, epto etc are working.

I don't have the alias within ~/.bashrc but in a folder example2 - /users/name/folder/new

even though I add all the alias from example2 to bashrc it is still not working.

How do I globalized. It was to connect ansible playbook installed in mac and try to connect mongodb and elastic database.

Python "ImportError: No module named mysql.connector" error

Posted: 30 Jul 2021 08:43 AM PDT

This issue has been covered elsewhere but the solutions provided are not working for me.

I have python 3.7 installed on my Debian 10 system. Used below to install mysql-connector:

pip3 install mysql-connector  

On executing python script with below:

import mysql.connector  

Seeing the below error:

"ImportError: No module named mysql.connector"  

I have tried the pip3 search function to find the correct package name but this appears to no longer be supported.

Looking at what has worked for others I have attempted the below:

pip3 install mysql-connector-python  pip3 install mysql-connector-python-rf  sudo python3 -m pip install mysql-connector-python  

After which the error still persists.

Also tried below which returns no installation candidate:

sudo apt-get install python3-mysql.connector  

Can anybody see the problem here?


Edit: Tried below as per suggestion in comments:

  1. Fetched module mysql_connector_python-8.0.26-cp37-cp37m-manylinux1_x86_64.whl

  2. Executed:

    python3 -m pip install mysql_connector_python-8.0.26-cp37-cp37m-manylinux1_x86_64.whl

Response:

Requirement already satisfied: mysql-connector-python==8.0.26 from file:///home/XXXX/Desktop/mysql_connector_python-8.0.26-cp37-cp37m-manylinux1_x86_64.whl in /home/XXXX/.local/lib/python3.7/site-packages (8.0.26)  Requirement already satisfied: protobuf>=3.0.0 in /home/XXXX/.local/lib/python3.7/site-packages (from mysql-connector-python==8.0.26) (3.17.3)  Requirement already satisfied: six>=1.9 in /usr/lib/python3/dist-packages (from protobuf>=3.0.0->mysql-connector-python==8.0.26) (1.12.0)  

Same error on executing python script.

Modify yaml file in bash without any external dependency

Posted: 30 Jul 2021 09:12 AM PDT

I've multiple configurations in YAML file and I need to change some paramaters using a Bash script. Is it possible? I want to avoid using any external program.

My YAML Looks like

%YAML 1.2  ---  name: mic  components:  - name: Mic    parameters:      period_count: 4      alsa_device_name: "pulse"    ---  name: speaker  components:  - name: Speaker    parameters:      period_duration_ms: 20      period_count: 4      alsa_device_name: "pulse"  

I want it to behave like if I provide --mic logitec --speaker hk34 then it should modify alsa_device_name for both mic and speaker in my config to

%YAML 1.2  ---  name: mic  components:  - name: Mic    parameters:      period_count: 4      alsa_device_name: "logitec"    ---  name: speaker  components:  - name: Speaker    parameters:      period_duration_ms: 20      period_count: 4      alsa_device_name: "hk34"  

Is it possible to do it using only Bash, and if so, how? For now I am using a Python script but this adds an extra dependency of having python3, which is something I want to avoid.

Clients can't mount NFS after power failure, NFS doesn't start

Posted: 30 Jul 2021 08:37 AM PDT

I have a beowulf cluster (1 master, 2 workers) which needs an NFS in order to run the program I use. I recently refactored my cluster to be Debian 8.11 and struggled to set up the NFS as it's been a long time since I had to and had no documentation, but I got it working.

All was fine and running well until the power went out in a storm last night and upon attempting to restart the NFS and connect the workers to it, the workers would stall after attempting to

mount 192.168.1.99:/mnt/nfs_dir /mnt/nfs_dir  

I tried all of

sudo /etc/init.d/nfs-kernel-server reload  sudo systemctl restart nfs-kernel-server.service  sudo systemctl restart nfs-kernel-server  

on the master but none of that allowed the workers to mount the NFS.

Note: While I have used Linux on and off for 5 years, I've not gone super in-depth with all of the bells and whistles despite taking a SysAdmin class 3 years ago and don't really know how to 'explore' my system and try to fix problems like this.

replace ./. with '-', 0/0 with value under REF, 1/1 with value under ALT and 0/1 with value under REF/ALT [closed]

Posted: 30 Jul 2021 08:21 AM PDT

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  H84021  BYU11001        BYU11002        BYU11003        BYU11004        BYU11005        BYU11006        BYU11007        BYU11008        BYU11009        BYU11010  15      2132    .       C       T       329.79  PASS    INFO    GT      ./.     ./.     ./.     0/0     0/0     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.  15      2403    .       C       A       574.93  PASS    INFO    GT      ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.  15      2413    .       A       C       47.84   PASS    INFO    GT      ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     0/0     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.     ./.  15      2736    .       G       C       179505  PASS    INFO    GT      0/0     0/0     0/0     0/0     0/0     0/0     ./.     0/0     1/1     1/1     1/1     ./.     0/0     1/1     0/0     1/1     1/1     0/0     0/0     1/1     ./.  15      2762    .       G       C       3812.55 PASS    INFO    GT      0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0  15      2928    .       G       C       98375.8 PASS    INFO    GT      0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0  15      2936    .       G       C       32196.3 PASS    INFO    GT      0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0     0/0  

Desired output:

#CHROM  POS     ID      REF     ALT     QUAL    FILTER  INFO    FORMAT  H84021  BYU11001        BYU11002        BYU11003        BYU11004        BYU11005  15      2132    .       C       T       329.79  PASS    INFO    GT      -       -       -       C       C       -  15      2403    .       C       A       574.93  PASS    INFO    GT      -       -       -       -       -       -  15      2413    .       A       C       47.84   PASS    INFO    GT      -       -       -       -       -       -  15      2736    .       G       C       179505  PASS    INFO    GT      G       G       G       G       G       G  15      2762    .       G       C       3812.55 PASS    INFO    GT      G       G       G       G       G       G       

0/0 to be replaced by REF call in that row, 1/1 to be replaced by ALT call in that row, 0/1 to be replaced by REF/ALT call in that row. Example, if REF is A and ALT is T then 0/1 to be replaced by A/T. ./. to be replaced by -

Reading empty string from CSV column last row in BASH

Posted: 30 Jul 2021 08:39 AM PDT

I'm using the following gawk script to read values from the first column of the csv file file.csv.
I use gawk since I don't want any embedded commas to be ignored.

col=`gawk '   BEGIN {  FPAT="([^,]*)|(\"[^\"]*\")+"  }  {print $1 }' file.csv`  

However, I noticed that if the empty string/space is in the last row, this method ignores it.

For example, if the file.csv is the following:

col1,col2  "a,a","a,a1"   "b","b1"   ,"c1"    

The result would be

col1  a,a  b   

instad of

col1  a,a  b     

What can I do to fix this issue?

Thank you!

Related post: Reading empty string from CSV file in BASH

How to create a sed script to replace quotes in a file?

Posted: 30 Jul 2021 08:41 AM PDT

So I manually use the following two commands in succession on my data file, i.e. I trigger the second command after the first has finished updating the file:

sed -i 's/""""/" " /g' EXPERIMENT-20210729010003.FILE  sed -i 's/"""/" " /g' EXPERIMENT-20210729010003.FILE  

How can i write this in a .sh script and pass file name as argument to the sh call?

EXPERIMENT-*.FILE comes everyday on my unix server. At any given point of time there can be only one Experiment file with a unique datetime value appended to its name.

Thanks!

audit2allow behavior has changed

Posted: 30 Jul 2021 08:16 AM PDT

I have a Red Hat server in which I was using the following command to scan the audit log and generate selinux policies:

audit2allow -a -l -M modulename

All of a sudden now, the program outputs an error stating that it is expecting the -p flag:

# audit2allow -a -l -M temp  You must specify the -p option with the path to the policy file.  

Obviously, I don't have a policy file, I am trying to generate one. Is there any reason why this command worked for the last 20 policies I created and loaded, and then suddenly now demands the -p flag?

Unable to get local issuer certificate (but my trusted CA-certificate store seems OK)

Posted: 30 Jul 2021 08:21 AM PDT

This has kept me busy for a good number of hours. I have read a good deal other articles and Stackexchange-questions, and tried other things, but no positive result so far.

Running Ubuntu20/Nginx/Openssl v1.1.1.

Using wget, openssl s_client or curl on normal web resources, I get the message: "Verify return code: 20 (unable to get local issuer certificate)", or equivalent.

$ openssl s_client -connect google.com:443  CONNECTED(00000003)  depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1  verify error:num=20:unable to get local issuer certificate  verify return:1  depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3  verify return:1  depth=0 CN = *.google.com  verify return:1  ---  Certificate chain   0 s:CN = *.google.com     i:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3   1 s:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3     i:C = US, O = Google Trust Services LLC, CN = GTS Root R1   2 s:C = US, O = Google Trust Services LLC, CN = GTS Root R1     i:C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA  ---  Server certificate  -----BEGIN CERTIFICATE-----  MIIN...  

A bit of background. The SSL-handshake used to work for these common web resources. But I had an application that required a self-signed certificate to be added to the trusted CA-certificate store. Worked on that for a good twenty hours, tried many things. In the end decided to 'start anew' and delete my whole trusted certificate store, by deleting everything in /etc/ssl/certs/ and /usr/(local/)share/ca-certificates/) and restoring backups of common CA-certs in these folders, and a restore backup of /etc/ca-certificates.conf. Then ran update-ca-certificates. Also: I downgraded OpenSSL from v1.1.1 to 1.0.2, and then upgraded it again from 1.0.2 to 1.1.1.

Output below to demonstrate that it looks alright.

$ update-ca-certificates -f  Clearing symlinks in /etc/ssl/certs...  done.  Updating certificates in /etc/ssl/certs...  129 added, 0 removed; done.  Running hooks in /etc/ca-certificates/update.d...  done.  

As far as I see, my trusted cert-store seems fine: it contains the requested root-certificates in the chain. Notice in the above example there are two root-certificates: (1) C = US, O = Google Trust Services LLC, CN = GTS Root R1, and (2) C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA.

I am sure these two root-certificates are in my trusted CA-store. Here's a snippet of the output from a trick suggested by Marlon in NginX client cert authentication fails with "unable to get issuer certificate"

$ awk -v cmd='openssl x509 -noout -subject' ' /BEGIN/{close(cmd)};{print | cmd}' < /etc/ssl/certs/ca-certificates.crt  ...  subject=OU = GlobalSign ECC Root CA - R4, O = GlobalSign, CN = GlobalSign  subject=OU = GlobalSign ECC Root CA - R5, O = GlobalSign, CN = GlobalSign  subject=C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA  subject=OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign  subject=OU = GlobalSign Root CA - R3, O = GlobalSign, CN = GlobalSign  subject=OU = GlobalSign Root CA - R6, O = GlobalSign, CN = GlobalSign  ...  subject=C = US, O = Google Trust Services LLC, CN = GTS Root R1  subject=C = US, O = Google Trust Services LLC, CN = GTS Root R2  subject=C = US, O = Google Trust Services LLC, CN = GTS Root R3  subject=C = US, O = Google Trust Services LLC, CN = GTS Root R4  

So the root-certificates that the host in my example (google.com) uses are there in my trusted CA-store. Why am I still getting "Verification error: unable to get local issuer certificate"?

Additionally, I'll add the output when I explicitly define the path to the trusted CA-cert store. The SSL-handshake succeeds! What am I overlooking?

$ openssl s_client -CApath /etc/ssl/certs -connect google.com:443  CONNECTED(00000003)  depth=2 C = US, O = Google Trust Services LLC, CN = GTS Root R1  verify return:1  depth=1 C = US, O = Google Trust Services LLC, CN = GTS CA 1C3  verify return:1  depth=0 CN = *.google.com  verify return:1  ---  Certificate chain   0 s:CN = *.google.com     i:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3   1 s:C = US, O = Google Trust Services LLC, CN = GTS CA 1C3     i:C = US, O = Google Trust Services LLC, CN = GTS Root R1   2 s:C = US, O = Google Trust Services LLC, CN = GTS Root R1     i:C = BE, O = GlobalSign nv-sa, OU = Root CA, CN = GlobalSign Root CA  ---  Server certificate  -----BEGIN CERTIFICATE-----  MIIN...  ...  -----END CERTIFICATE-----  subject=CN = *.google.com    issuer=C = US, O = Google Trust Services LLC, CN = GTS CA 1C3    ---  No client certificate CA names sent  Peer signing digest: SHA256  Peer signature type: ECDSA  Server Temp Key: X25519, 253 bits  ---  SSL handshake has read 6523 bytes and written 392 bytes  Verification: OK  ---  New, TLSv1.3, Cipher is TLS_AES_256_GCM_SHA384  Server public key is 256 bit  Secure Renegotiation IS NOT supported  Compression: NONE  Expansion: NONE  No ALPN negotiated  Early data was not sent  Verify return code: 0 (ok)  ---  

To conclude: I am likely overlooking something, some setting or parameter that may have gotten reset, or set wrongly during my hours of tinkering with the system. However, I just cannot see it, and the sources I've read and tried so far mostly mention making sure my trusted CA-cert store is complete, which I think it is. What am I overlooking? Where should I look, or what should I do to get a grip on this problem?

How to expand code snippets in GNU nano?

Posted: 30 Jul 2021 07:24 AM PDT

In most text editors, it is possible have "code snippets" you can expand by typing a keyword and pressing the tabulation key.

As an example, a snippet for LaTeX might look like

\begin{$1}      $2  \end{$1}  

However I found nothing in the nano man page nor on the web. Is there some hacky way to achieve that? One idea might be to have some bash function nano-latex-begin or something taking two arguments and then to ask GNU nano to execute it but the process would be rather slow.

Replace TAGS in FileB with VALUE from FileA

Posted: 30 Jul 2021 08:10 AM PDT

I am looking for some assistance in perl, please. I have most of the code built, but I am finding one part particularly challenging.

If FileA:

tag1=value1  tag2=value2  

and FileB:

value1=<tag1>  value2=<tag2>  

pseudo code:

open file 1  open file 2   read line of data from file 1 while data exists     change the equal sign to a space ( tag1=value1 becomes tag1 value1)     separate the line into two variables  

[magic happens here where I change the value in FileB to the actual value from FileA (see example below)]

close file 2  close file 1  

So, I have tried several things, researched the heck out of this using Uncle Google (and here). I know there is a simple way of doing this using a single command line (

prompt> gawk '{sub(/=/," ")}1' [path]/[FileA] |       gawk '{system ("perl -pi -e \x27s/"$1"/"$2"/g\x27 [path]/[FileB]")}'   

), but I don't want to do it that way, but instead I am trying to make it happen inside my perl program because I like making things harder on myself it seems :-p.

So, for example, if FileA contains

<tag1>=192.192.2.3  <tag2>=5400  

and FileB contains

connect IP=<tag1>  connect port=<tag2>  

at the end of this program, I want FileB to contain

connect IP=192.192.2.3  connect port=5400  

I understand how to perform substitutions in the program, BUT, I am having difficulty getting it to update the file.

Any hints would be welcomed; I don't even need a full solution, just something to point me in the right direction.

This is not homework.

dwm doesn't load fontawesome

Posted: 30 Jul 2021 08:12 AM PDT

I want to set up icons for my tags in dwm. I have downloaded the ttf-font-awesome package with sudo pacman -S ttf-font-awesome and I changed this line in my config.h of dwm:

static const char *fonts[] = { "FontAwesome:size=16", "consolas:size=16" };  

But it still doesn't work. Some icons show up correctly, while others show up slightly or even completely different. I copied the unicode glyph from fontawesome.com and added it to my *tags array in config.h. Did I miss something? Any help is greatly appreciated!

OpenVPN3: Error calling StartServiceByName... Permission Denied... as root?

Posted: 30 Jul 2021 07:35 AM PDT

I cannot figure out how it's possible that I'm getting "permission denied" as root. Something might be missing execute permission, but I cannot figure out from this error message what that might be. In any event, I followed the installation instructions exactly as written so I'm at a loss. Any suggestions on where to begin troubleshooting this?

root@bigboi:/home/andrew# apt install openvpn3  Reading package lists... Done  Building dependency tree         Reading state information... Done  The following NEW packages will be installed:    openvpn3  0 upgraded, 1 newly installed, 0 to remove and 114 not upgraded.  Need to get 1,447 kB of archives.  After this operation, 6,779 kB of additional disk space will be used.  Get:1 https://swupdate.openvpn.net/community/openvpn3/repos focal/main amd64 openvpn3 amd64 13~beta-1+focal [1,447 kB]  Fetched 1,447 kB in 19s (77.6 kB/s)                                                                                                                                                                        Selecting previously unselected package openvpn3.  (Reading database ... 170788 files and directories currently installed.)  Preparing to unpack .../openvpn3_13~beta-1+focal_amd64.deb ...  Unpacking openvpn3 (13~beta-1+focal) ...  Setting up openvpn3 (13~beta-1+focal) ...  openvpn3-autoload.service is a disabled or a static unit, not starting it.  Processing triggers for dbus (1.12.16-2ubuntu2.1) ...  Processing triggers for man-db (2.9.1-1) ...  root@bigboi:/home/andrew# openvpn3 session-start --config /home/andrew/.vpn/client.ovpn  ** ERROR ** Failed preparing proxy: Error calling StartServiceByName for net.openvpn.v3.sessions: Failed to execute program net.openvpn.v3.sessions: Permission denied  

Version information:

$ sudo openvpn3 version  OpenVPN 3/Linux v13_beta (openvpn3)  OpenVPN core 3.git:HEAD:ce0c9963 linux x86_64 64-bit  Copyright (C) 2012-2020 OpenVPN Inc. All rights reserved.  

“minimal BASH like line editing is supported”

Posted: 30 Jul 2021 08:15 AM PDT

I'm getting this error "minimal BASH like line editing is supported" instead of grub menu when I try to install GNU-Linux(Kali OS) as a dual boot. Can anyone help me in a easy understandable way?

*I had earlier elementary OS(GNU-Linux) as a dual boot. My main OS is Windows 10.

Thanks

How to decrypt file that was symmetrically encrypted using GPG?

Posted: 30 Jul 2021 09:45 AM PDT

I've created and symmetrically encrypted a file using GPG:

touch test.txt && echo 'test' >> test.txt  gpg --output test.txt --symmetric test.txt  

But now I cannot figure out how to unencrypt it, and surprisingly, I cannot find an example online. Here's what I've tried:

$ gpg --decrypt test.txt  gpg: AES encrypted data  gpg: encrypted with 1 passphrase  
$ gpg --symmetric --decrypt test.txt  gpg: conflicting commands  
$ gpg --passphrase --decrypt test.txt  gpg: no valid OpenPGP data found.  gpg: decrypt_message failed: Unknown system error  
$ gpg --decrypt --output test_decrypted.txt test.txt  gpg: no valid OpenPGP data found.  gpg: decrypt_message failed: Unknown system error  

What am I doing wrong?

What commands are run by ALT+F2 and "r"?

Posted: 30 Jul 2021 07:52 AM PDT

In the Cinnamon Desktop:

  • What command or code is run in response to Alt+F2?
  • In what file is this association stored?
  • What command or code is run in response to the r command in the command prompt window opened by Alt+F2?

kdump in CentOS 7

Posted: 30 Jul 2021 08:54 AM PDT

I wanted to migrate to CentOS 7.5 from CentOS 6.9. during installation I saw an option kdump that i could enable or disable. I wonder what is kdump and disabling it has any bad effect on server? I want to install database on my server later I just want to make sure that kdump cause no problem.

mutt: thread sorted by last activity, but mails sorted chronologically

Posted: 30 Jul 2021 09:10 AM PDT

My ideal configuration would be:

  • threaded conversations
  • sort threads in order of most recent mail in thread (thread: "last activity" order)
  • sort mails within thread in order they were sent (mail: chronological order)

I seem to only ever be able to get 2 out of these 3… The best I managed to get is with these settings:

set sort = threads  set sort_aux = last-date-sent  

This gives me threaded conversations, with threads sorted by last activity, but this sort_aux makes mails within each thread appear in a weird order (AFAICT: order of the last leaf in each branch).

Is there any way to keep mails in chronological order, or does mutt not support?

How do I get an /HP Officejet Pro 6830 printer to work with Ubuntu?

Posted: 30 Jul 2021 09:04 AM PDT

I just hooked-up an HP Officejet Pro 6830 All-in-One Series printer. The install went w/o flaws. However, when printing from my computer, after printing several lines, the printing is squished together for a few lines then it prints several more lines just fine and squishes it again. Doing a test print, from the printer, seems works fine.

Any ideas of what is wrong?

I'm running Ubuntu 12.04 LTS

Checking how long a user has been logged in

Posted: 30 Jul 2021 07:30 AM PDT

Is it possible to check for how long a user has been logged in? Or when the user logged in on an Unix/Linux system?

I logged in as another user on my system a while ago and I would like to now how long that user has been logged in.

Terminal emulator for Android that supports viewing images?

Posted: 30 Jul 2021 08:02 AM PDT

I am planning on logging into my unix desktop via an Anroid tablet. Is there a terminal emulator that will allow me to view images, such as making plots in ipython, via X11 protocol?

UUID Of A drive that won't show up in /dev/disk/by-uuid or blkid

Posted: 30 Jul 2021 09:45 AM PDT

I have a USB drive that is not receiving a UUID. When I look at the contents of the /dev/disk/by-uuid it doesn't exist there. The dev point that the partition lives in is on /dev/sdb. I am able to see sdb under /dev/disk/by-path. Also, when using blkid, I get zero output. I'm assuming that I got an error code that returned back.

Is there a way to get a UUID for this partition?

Result of fdisk -l /dev/sdb:

Disk /dev/sdb: 320.1 GB, 320072932352 bytes  255 heads, 63 sectors/track, 38913 cylinders, total 625142446 sectors  Units = sectors of 1 * 512 = 512 bytes  Sector size (logical/physical): 512 bytes / 512 bytes  I/O size (minimum/optimal): 512 bytes / 512 bytes  Disk identifier: 0x00082145       Device Boot      Start         End      Blocks   Id  System  /dev/sdb1            2048   625141759   312569856   83  Linux  

The partition table and partition was created with gparted, so it was partitioned and ran the command mkfs.ext3.

Output of fsck -n /dev/sdb1

fsck from util-linux 2.20.1  e2fsck 1.42 (29-Nov-2011)  fsck.ext2: Superblock invalid, trying backup blocks...  zwei was not cleanly unmounted, check forced.  Pass 1: Checking inodes, blocks, and sizes  Pass 2: Checking directory structure  Pass 3: Checking directory connectivity  Pass 4: Checking reference counts  Pass 5: Checking group summary information  zwei: 11/19537920 files (0.0% non-contiguous), 1275097/78142464 blocks  

It was formatted as an ext3 drive. Why is that showing up as ext2?

No comments:

Post a Comment