tcpdump command line step issue, argument is not permitted - tcpdump

i am trying to capture packets to resolve a proxychains access denied issue. I am stuck on this command...any help?
sudo setcap cap_net_raw,cap_net_admin=eip /usr/sbin/tcpdump
Failed to set capabilities on file `/usr/sbin/tcpdump' (Invalid argument)
The value of the capability argument is not permitted for a file. Or the file is not a regular (non-symlink) file

Related

Run pprof on data collected from remote machine?

I have a program that runs on a remote headless machine (ie no X server) that has a memory leak. I was able to install gperftools and ran the heap checker which found the leak.
My problem is I can't install pprof on the remote machine because of all the graphics libraries required so I copied the generated .heap file onto a different machine that does have pprof installed. This machine also has all the same libraries as the rmote machine.
I tried running the pprof command suggested by the heap checker, but with --text instead of --gv
$ pprof <my_bin> <heap_file> --inuse_objects --lines --heapcheck --text
but it complains about a failed curl command
Using local file <my_bin>.
Use of uninitialized value $host in substitution (s///) at
/usr/bin/pprof line 3195. Use of uninitialized value $hostport in
concatenation (.) or string at /usr/bin/pprof line 3197. Use of
uninitialized value $prefix in concatenation (.) or string at
/usr/bin/pprof line 3197. Use of uninitialized value $host in
substitution (s///) at /usr/bin/pprof line 3195. Use of uninitialized
value $hostport in concatenation (.) or string at /usr/bin/pprof line
3197. Use of uninitialized value $prefix in concatenation (.) or string at /usr/bin/pprof line 3197. Use of uninitialized value $host
in sprintf at /usr/bin/pprof line 3364. Gathering CPU profile from
http:///pprof/profile?seconds=30 for 30 seconds to
/home/developer/pprof/<my_bin>.1640195244. Be patient...
curl: (6) Couldn't resolve host 'http' Failed to get profile: curl
'http:///pprof/profile?seconds=30' >
/home/developer/pprof/.tmp.<my_bin>.1640195244.: No such
file or directory
So my questions are:
is what I am attempting even possible?
is there a different pprof command I should be using?
what is the curl command about?
Thanks,
Simply use go version of pprof. In this case I suspect what happens is that arg parsing doesn't really support flags at the end (I suspect go's has this bug as well). This use case of pprofing with binary and pprof file is definitely supported.

Problems running podman in Ubuntu 20.04

Different problems, mainly related to the amount of user namespaces.
Trying to run a pre-built image yields:
podman run --rm -it -p8080:8080 --env LOGSTASH_CONF_STRING=$LOGSTASH_CONF_STRING --name logstash bitnami/logstash:latest
Completed short name "bitnami/logstash" with unqualified-search registries (origin: /etc/containers/registries.conf)
Trying to pull docker.io/bitnami/logstash:latest...
Getting image source signatures
# layers
Writing manifest to image destination
Storing signatures
Error processing tar file(exit status 1): potentially insufficient UIDs or GIDs available in user namespace (requested 0:4 for /var/log/apt/term.log): Check /etc/subuid and /etc/subgid: lchown /var/log/apt/term.log: invalid argument
Trying to pull quay.io/bitnami/logstash:latest...
Getting image source signatures
# layers...
Storing signatures
Error processing tar file(exit status 1): potentially insufficient UIDs or GIDs available in user namespace (requested 0:4 for /var/log/apt/term.log): Check /etc/subuid and /etc/subgid: lchown /var/log/apt/term.log: invalid argument
Error: 2 errors occurred while pulling:
* Error committing the finished image: error adding layer with blob "sha256:8a5e287f7d41a454c717077151d24db164054831d7cd1399ee81ab2dfba4bcb2": Error processing tar file(exit status 1): potentially insufficient UIDs or GIDs available in user namespace (requested 0:4 for /var/log/apt/term.log): Check /etc/subuid and /etc/subgid: lchown /var/log/apt/term.log: invalid argument
* Error committing the finished image: error adding layer with blob "sha256:8a5e287f7d41a454c717077151d24db164054831d7cd1399ee81ab2dfba4bcb2": Error processing tar file(exit status 1): potentially insufficient UIDs or GIDs available in user namespace (requested 0:4 for /var/log/apt/term.log): Check /etc/subuid and /etc/subgid: lchown /var/log/apt/term.log: invalid argument
So I can't really run this thing. Then trying to run a locally built container which creates a user I get:
Error: OCI runtime error: container_linux.go:370: starting container process caused: setup user: invalid argument
Configuration has been set up with subuid
jmerelo:100000:65536
Although
podman unshare cat /proc/self/uid_map
0 1000 1
So there must be something that I'm missing or that I should restart here. Even if I log in again, it's still the same result. So there must be something that I'm doing wrong here.
Same problem solved by following this:
rm -rf ~/.config/containers ~/.local/share/containers
podman system migrate

Handle nonexistent PWD gracefully

Whenever I execute a crystal program in a directory that does not exists, it fails with Unhandled exception: getcwd: No such file or directory (Errno). I can't find the way to handle such case gracefully, is it possible?

Attempting to "importDump.php" in mediawiki on bitnami instance on Google Cloud, getting error "failed to open stream..."

Followed the 2x options for commands at: https://www.mediawiki.org/wiki/Manual:Importing_XML_dumps#Using_importDump.php,_if_you_have_shell_access
In both instances, getting a 'failed to open stream' error.
I have chmod 777 for folder and file. (Thinking it may be permission error)
I have moved the file to import right into the maintenance folder (some postings suggesting PHP needs to be able to find the file, so think putting it there will help)...
on command:
"root#bitnami-mediawiki-___:/opt/bitnami/apps/mediawiki/htdocs/maintenance# php importDump.php --co
nf ../LocalSettings.php /FILENAME.xml"
I see error:
"PHP Warning: fopen(/FILENAME.xml): failed to open stream: No such file or directory in /opt/bitnam
i/apps/mediawiki/htdocs/maintenance/importDump.php on line 267
PHP Warning: feof() expects parameter 1 to be resource, boolean given in /opt/bitnami/apps/mediawiki/
htdocs/includes/import/ImportStreamSource.php on line 41
PHP Warning: fread() expects parameter 1 to be resource, boolean given in /opt/bitnami/apps/mediawiki
/htdocs/includes/import/ImportStreamSource.php on line 48
PHP Warning: feof() expects parameter 1 to be resource, boolean given in /opt/bitnami/apps/mediawiki/
htdocs/includes/import/ImportStreamSource.php on line 41
PHP Warning: XMLReader::read(): uploadsource://9115d0bbe5ae974e1fe2d411e035aeaa:1: parser error : Ext
ra content at the end of the document in /opt/bitnami/apps/mediawiki/htdocs/includes/import/WikiImport
er.php on line 551
PHP Warning: XMLReader::read(): in /opt/bitnami/apps/mediawiki/htdocs/includes/import/WikiImporter.p
hp on line 551
PHP Warning: XMLReader::read(): ^ in /opt/bitnami/apps/mediawiki/htdocs/includes/import/WikiImporter.
php on line 551
Set $wgShowExceptionDetails = true; in LocalSettings.php to show detailed debugging information."
I'm not clear what the error means and how to grant access to the file... Newb to BASH and servers. Any help would be greatly appreciated!
It looks to me that the path of the FILENAME.xml file is wrong. Note that you have a / at the beginning of FILENAME.xml, so it will look at the root of the filesystem. If the file is in the same folder, then use ./FILENAME.xml

Error log for Octave "panic: Illegal instruction -- stopping myself"

Is there an error log where I can figure out the error message and line of code in my file which makes the Octave interpreter post the following messages in Emacs?
panic: Illegal instruction -- stopping myself...
panic: attempted clean up apparently failed -- aborting...
Process Inferior Octave aborted (core dumped)
You must use the Octave debugger (take a look at the Debugging section of the Octave manual).
If this was an error message, you could activate debug_on_error. Since it is not, it's a proper crash, you must start on debug mode (enter the keyboard command) and step line by line (enter the command dbstep) until you find which one causes the issue.