I have a bash script for which i want to know the time it took to run for individual commands and save them in a log file. Also I need some of these commands to run as a different process. The problem I am facing is I am not able to tell which output belongs to which command for example
Tag: linux
What are “Positive entries” and “Negative entries” in NSCD (Named Service Cache Deamon) for FreeIPA
The “Positive entries” and “Negative entries” stats are in the nscd -g command under “hosts cache” section. From the nscd.conf manual, I see that “positive entries are successful queries in the specified cache” and “negative entries (unsuccessful queries) …
Add cut/crop marks to pdf with imagemagick
I have a pdf file which is getting generated with Inkscape from SVG and processed with ImageMagick. Now the PDF is a perfect DINA4 @300 DPI How can I add some marks around it? My marks should look like this: http://cl.ly/033g3t2h0U0f/A4_crop.png And I need to place this over the pdf with 3mm to overlap so it&…
Can’t Write to /sys/kernel/ to disable Transparent Huge Pages (THP) for MongoDB on OVH CentOS 7
My Issue I am having trouble removing MongoDB warnings about Transparent Huge Pages (THP) on an OVH CentOS 7 installation, and the issue appears to be the inability to write to /sys/kernel/mm as root. First, I realize the OVH kernel is customized, and I know many of you will say to go with a fresh non-customi…
How to limit the address space of 32bit application on 64bit Linux to 3GB?
Is it possible to make 64bit Linux loader to limit the address space of the loaded 32bit program to some upper limit? Or to set some holes in the address space that to not be allocated by the kernel? I mean for specific executable, not globally for all processes, neither through kernel configuration. Some cod…
Apache Commons Exec – sometimes a Thread can’t open a local file in Linux
WARNING — THE CAUSE IS NOT A MISSING FILE — ALL THREADS ARE CALLING THE SAME SCRIPT FILE I am starting 5-6 threads that call a local script in a Red Hat box. I’ve noticed that sometimes, I get the following error message Obviously, all processes are executing the script, so it seems to be so…
Convert number from text file
I have a file: id name date 1 paul 23.07 2 john 43.54 3 marie 23.4 4 alan 32.54 5 patrick 32.1 I want to print names that start with “p” and have an odd numbered id My command: grep “^p” filename | cut -d ‘ ‘ -f 2 | …. result: paul patrick Answer Awk can do it all:
Get specific column from CSV in Bash script
I have a csv with nearly a hundred of column. I am writing a bash script to get only few of those column. CSV: I did some research and found this: But it requires to put ALL the column (92 in my case…) I can’t select want I want. So I try another solution: It cannot work because of the
Linux filesystem nesting and syscall hooking
Using 2.6.32 linux kernel, I need to use a specific filesystem on a block device partition and I wan’t to hook open/write/read/close (and few others) syscalls to read/write, in an other fashion that the specific filesystem, what should be written on this partition. It would be only for this partition, o…
Grouping and deleting Files
I have to come up with a solution to delete all files but the newest 2 in a directory stucture of our owncloud. The be exact – its the file versioning folder. There are files in one folder with the following structure: Filename.Ext.v[random_Number] The hard part is that there are different files in one …