I have a very crude script getinfo.sh that gets me information from all files with name FILENAME1 and FILENAME2 in all subfolders and the path of the subfolder. The awk result should only pick the nth line from FILENAME2 if the script is called with “getinfo.sh n”. I want all the info printed in o…
Tag: linux
What is C-state Cx in cpupower monitor
I am profiling an application for execution time on an x86-64 processor running linux. Before starting to benchmark the application, I want to make sure that the Dynamic Frequency scaling and idle states are disabled. Check on Frequency scaling This tells me that the Frequency scaling(Intel’s Turbo Boos…
Complete removal of php and all of it’s dependencies o RHEL7
I am trying to uninstall php and all of its modules from a RHEL7 server completely and do a clean install later. Things I have tried till now using yum – sudo yum remove ‘php*’. After the above command i can still see that php is not uninstalled. Please help. Answer You could also add this o…
Why io_submit(…, nr, …) might submit less requests than nr?
I’m using io_submit(…, nr, …) with nr up to 128 but I usually get fewer requests submitted. According to the manual IO_SUBMIT(2), this is legit but I wonder: why? Also, is there a way to know which request was submitted right away – without checking io_getevents()? From the manual: On …
Replace variable in text file with another variable
I am trying to write a variable to a specific spot in a text file. So far I have the variable generation part done, but when I open the text file to see the result, the ${at} placeholder has been replaced with ${assetTag} and not the value of the variable. So the idea is that I compare the $serialNum to
bash script to kill a python script after starting another same python script
I start a python script and then after some time i want to kill it. but before killing it I want to start another copy of this same script and then kill the previous one after starting new one. I want to do this in loop. here is my code , i just need a clean way to kill scripts.I
Bash output all links in following format [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed 4 years ago. Improve this question i wan…
Get source file path of a running python script from process id
I have a process running in the background, a python one, with ps -ef I can see filename from running command : UID PID PPID … python ./filename.py How can I know where the file is located Answer pwdx < PID > gives full directory the process is running from. So, the full script would be Though, yo…
/proc//map shows more shared library than ldd for busybox
Why /proc/<pid>/maps shows more shared library than ldd program? Here’s an example: cksum is used to check if the files are the same. From PC side ldd cross-tool, it shows busybox depends on libc and ld only. However, in the real run-time environment, /proc/132/maps shows one more shared library, …
Decode base64 strings into hex strings in a file and overwrite
I have a list of base64 strings in a file (file.txt) that I need to convert into hex. E.g., Command: This command works individually (albeit the spaces in between), but I need to convert through each string in the file, which has more than 500 lines. Basically, I want the above base64 string format to be deco…