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…
Tag: linux
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…
How to include path inside bashrc in linux for envirnment
Im testing my code for automation of the installation of a software In bashrc file below: Here im trying to add $SCALA_HOME/bin to PATH. this is the required output: the above code worked to append SCALA_HOME above path but for appending in the same line im not able to do please help me get the correct sed co…
Virtual address to physical address and reverse in android linux kernel
I’m trying to transform virtual address to physical address and map this physical address to virtual address with android linux kernel environment. I can modify kernel code. So I tried next flow. malloc() in android user space native binary not app Transform va from malloc() to pa using the guide Is the…