How does ptrace work in Linux?

When the attached child process invokes a system call, the ptracing parent process can be notified. But how exactly does that happen? Parent process calls ptrace with PTRACE_ATTACH, and his child calls ptrace with PTRACE_TRACEME option. This pair will connect two processes by filling some fields inside their task_struct (kernel/ptrace.c: sys_ptrace, child will have PT_PTRACED … Read more

Get all modules/packages used by a python project

You can give a try to the library https://github.com/bndr/pipreqs found following the guide https://www.fullstackpython.com/application-dependencies.html The library pipreqs is pip installable and automatically generates the file requirements.txt. It contains all the imports libraries with versions you are using in the virtualenv or in the python correctly installed. Just type: pip install pipreqs pipreqs /home/project/location It will … Read more