$locate -S command is not working in Ubuntu 20.04 (plocate is installed, all other commands work fine) - terminal

I am facing this error while running 'locate -S' command. Is this only executable in mlocate?
My error:
user#Ubuntu:~$ locate -S
locate: invalid option -- 'S'
Is there an alternate command, I can use?
Expected output:
user#ubuntu:~$ locate -S
Database /var/lib/plocate/plocate.db:
16,009 directories
144,928 files
7,826,392 bytes in file names
4,234,872 bytes used to store database
Thanks in anticipation.

Related

im getting error code 127 while creating jenkins pipeline here is the script

pg_dump -h 10.12.0.4 -U pet--rsmb--prod-l1--usr -w -c -f 2022-08-10t1228z-data.sql
/var/lib/jenkins/workspace/BACKUP-RSMB--POSTGRESQL#tmp/durable-510acc0f/script.sh: 1: /var/lib/jenkins/workspace/BACKUP-RSMB--POSTGRESQL#tmp/durable-510acc0f/script.sh: pg_dump: not found
Your error clearly indicates that the Shell executor cannot find pg_dump command. Either you have not set pg_dump properly in the Jenkins server or you have not added pg_dump to the executable $PATH.

How can extended snmp agent read text file via shell or python? Gives me permission denied for reading file error

I have a python script that reads last line of a text file (present in location /home/anas/projects) and prints it. Text file contains a single float value on each line. When i run this python script from terminal, it works fine.
The problem i am having is that i want to use this script with snmp. So i have used snmp extend and added
extend snmp-datarate /usr/bin/python2.7 /usr/local/bin/snmp-feedback.py
in /etc/snmp/snmpd.conf file. and when i run this command
snmpwalk -v2c -c public 127.0.0.1 NET-SNMP-EXTEND-MIB::nsExtendObjects
it gives me following error,
NET-SNMP-EXTEND-MIB::nsExtendOutLine."snmp-datarate".4 = STRING: OSError: [Errno 13] Permission denied: '/home/anas/projects'
Now i thought that it could eb due to use of python so i also tried shell script, named it snmp-agra-datarate.sh, which only have two lines of code
#!/bin/bash
echo $( tail -n 1 /home/anas/projects/6780-log.txt )
Running this script from terminal produces the expected output. I then extended snmp with
extend datarate /usr/local/bin/snmp-agra-datarate.sh
then when i try to run snmp walk again. i get similar error
NET-SNMP-EXTEND-MIB::nsExtendOutLine."datarate".2 = STRING: tail: cannot open '/home/anas/projects/6780-log.txt' for reading: Permission denied
Is there something i am missing in order to read external text file with python or shell for extended snmp agent?
-i am using ubuntu 16.04 LTS and net-snmp v5.8
-Both python and shell scripts have execute permissions. (i did chmod 755)
-text file also have all permissions
The error message
Permission denied: '/home/anas/projects'
is pointing to the permissions of that directory. If too restrictive,
then the snmpd cannot go in there.
To solve the problem, do a
ls -ld /home/anas/projects
and that will give you a clue.

Script shows that Tool is not in a path FATAL error

When I was running the command in terminal of linux then that command worked and necessary files are created but when I ran that command in shell script then the script is showing the message like "The tool is not in path. FATAL error". Can anyone help me why this is happening when I am running the commands through Shell script?
Command is : /remote/system/vdk/2019.06/bin/icv -i -c -f GDSII | tee drc.log
Is this the problem with tool that it is only running on terminal, but not when we running the same by mean of scripting? Can anyone help me?

Error running bash script

Trying to run the following bash script but get the below error message(s) - any ideas how to correct?
You don't have a wget program on Your mac. The fastest way to get it is via cURL.
curl -O http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz
Extract cURL:
tar -zxvf wget-1.15.tar.gz
open folder:
cd wget-1.15/
And run installer
./configure

Shc encrypted shell script not executable

I created an encrypted shell script with the tool shc.
The script works just fine on my computer but when I transfer it to
another one (solaris 10 to solaris 10) I get the following error:
invalid argument
It's not a permission problem and the encrypted script should be ok I guess it's a header/compiler problem.
The shc command used wasshc -rf <filename> so the script should work on another computer!?
According to The Geek Stuff you need to use the -r option to relax security and -f to specify your script file:
shc -r -f script.sh

Resources