Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Closed 3 years ago. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-top…
How much memory a program can allocate?
How much memory can I allocate for a C++ program running under Linux? In my test case, using new or malloc can allocate more than 170Gb of memory. As a comparison, The same code can only allocate 1.8G in windows and then terminated. My test machine, one is a virtual machine using virtual box, centos7 64-bit, …
linux find command: exclude path from result
I used the find command to find all python files in a folder, and exlude some folder. find . -type d ( -path ./venv -o -path ./virtualenv -o -path ./lib ) -prune -o -iname ‘*.py’ It’s give the following output: How can I tweak the find command to exclude ./venv in the resultset? Answer If yo…
I want to extract any text between two symbol
I need to execute the file (a.out) and at the same time, I just need specific parts of the output, not everything. which is either located between these two string [[….]] or ((…..)). and I don’t have any idea where the other text is located (there is no specific pattern) and how the output l…
Can’t Install Jenkins even though I have JAVA 8
Ubuntut 14.04 LTS According to this I need JAVA 8 and so I downloaded both the JDK and JRE. Unfortunately when attempting to install jenkins again I still get the error message Checking my $PATH and it shows the following The java that should be used is 8. Even running Gives me what I expect Why do I get the
“Cache” credentials on a bash script
I have created a bash script to run a few js scripts into MongoDB. Basically, what I am doing is, running the bash script and passing a parameter in this case called version, example: That will go and execute all scripts for the version 1.0. Now, it is possible that MongoDB requires authentication user/pass, …
How to use find, ls commands to display file names based on entries in an array?
I have an array, that contain the wildcards/filenames tha may be present in a directory. How can I display the files in a directory, whose names matches with names in the array. By the way, if possible, without using for loop. Ex: Answer The correct syntax is to use curly braces when accessing arrays: For fin…
error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
I am trying to add a std::function to std::thread and i stumble upon this error Why is this not working? Answer The initial integer value is missing when thread ctor is called: thread(std::ref(tfunc), 123). Function of thread body takes integer, you need to provide it when thread starts.
Prevent read() systemcall returing with 0 when run as background process
I have a piece of software that is able to read commands from stdin for debug purposes in a separate thread. When my software runs as foreground process read behaves as expected, its blocking and waits for input by the user, i.e the thread sleeps. When the software is run as a background process, read constan…
How do I access a file for reading/writing in a different (non-current) directory?
I am working on the listener portion of a backdoor program (for an ETHICAL hacking course) and I would like to be able to read files from any part of my linux system and not just from within the directory where my listener python script is located – however, this has not proven to be as simple as specif…