Team, I have a file with data as mention below. Expected Output: I am using sed its not working . Please Let me know how to achieve the above mention output. Answer This might work for you (GNU sed): This method matches the numbers at the front of the string with strings appended to the end of the line and
Search for a mention of each filename contained in a directory, in every file in the directory
I’m trying to perform a search in my directory, to count the total number of times each individual file is referenced within the contents of all the files in the directory. Essentially, I’m trying to more efficiently recreate the copy and paste of each ‘filename’ into the ‘search…
Implement Nagios Topography to avoid over-alerting
How to Implement Nagios Topography to avoid over-alerting. Also how can we improve nagios performance to get avoided from fake alerts. Answer You can use host and service dependency definition in your configs. For example: dependent_service_description CPU Load These are the service that are dependent on the …
C NET-SNMP Get and Set specifically via MIB Name, Not OID
I have written and am testing software for a generic SNMP client module in C as well as an implementation using this generic module. I am having trouble getting a get request to work by passing in a MIB name(e.g. sysDescr) instead of an OID(e.g. 1.3.6.1.2.1.1.1). I am successful when I pass in a character arr…
Static-storage-duration object uniquness guaranties when dynamically loaded from multiple libraries
Imagine that there is a shared library S, there are shared libraries A and B, and an executable C. A and B are linked against S. C is not linked against A and B, instead C dynamically loads A and B via dlopen. S has a static-storage-duration object O with external linkage that is used inside A and B. I
Linux Hadoop Services monitoring tool and restart if down
I have configured Hadoop 2.7.5 with Hbase. It is a 5 system cluster in fully distributed mode. I have to monitor Hadoop/Hbase daemons and want to start some action (e.g. mail ) if some daemon goes down. Is there any built-in solution. Also I want to start Hadoop at boot time. How can I do this ? Answer I am
how to choose chunk size when reading a large file?
I know that reading a file with chunk size that is multiple of filesystem block size is better. 1) Why is that the case? I mean lets say block size is 8kb and I read 9kb. This means that it has to go and get 12kb and then get rid of the other extra 3kb. Yes it did go and
redirect and print script output using for loop and awk in linux
I have a script which give out put like this : my_script <variables> output like this : now I want to redirect the output and print like this print “some_text col_3@col_4 some_more_text col_4” ans will be like this: some_text textext3@texxt6 some_more_text texxt6 some_text textext1@text4 som…
How to dynamically check for library information in posix compliant systems in C++?
I am playing around with Linux to learn some things about operating systems. Currently I want to query the OS for the version of certain libraries (GLFW and GLEW on particular). I want to print the current version or a message if the library is not installed. Is there a general way to query the OS for the ver…
How to limit a search of a directory with “find” command?
I am trying to make a Bash script that would create symlinks to directories that have a “target” subdirectory. I use “find” command to search for the “target” directories and put the filepaths to array. The array is looped through and symbolic links are made to directories.…