I have this nested bash for loop where the first loop represents the range of servers, and the second loop reads each lines of the .txt file. Then will do a zgrep -i and find for a string on the matching line. keys.txt is as follow: Bash Loops: This runs but its logging every instance where ‘InitialRequ…
Tag: linux
Is it possible to add a customized name for the (non file-backed) mmap region?
Just curious whether it is possible to specify a name for the non file-backed mmap region? Some thing like the [New VMA area] in the following example: Answer The content of maps comes from the show_map_vma function in fs/proc/task_mmu.c. Looking at it, if you want a custom name for a non-file-backed mapping,…
How to use regex to match both filename and file content in Linux? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I want to find files that contain the word ‘virus’ but not ‘antivirus’…
Regex match with capturing group excluding specific characters and looking for the last occurrence based on later characters
I apologize beforehand for the jumbled mess that is the title but that’s the shortest way I could think to describe what I’m trying to do. I’m reading a file that has multiple lines of text that I’m looping through and I’m trying to use regex to get a substring from each line. Th…
How to check password on macOS?
The following C program can check the password of a user on Linux. But it does not work on macOS because some functions are Linux specific. Could anybody show me how to revise the program so that it works on macOS? Answer Both Linux and macOS use PAM for authentication; Linux uses Linux-PAM, and MacOS and BSD…
MongoDB ops manager “java.lang.OutOfMemoryError: unable to create native thread”
Im currently setting up a new MongoDB ops manager machine. Installation works fine but I can’t start the mongodb-mms service. The starting of Instance 0 fails with an java.lang.OutOfMemoryError exception. I use the same configuration as on my test server (2 CPU cores, 8gb ram), there the service starts …
waitpid() function returns ERROR (-1), why?
I’m writing a Linux shell-like program in C. Among others, I’m implementing two built-in commands: jobs, history. In jobs, I print the list of currently working commands (in the background). In history I print the list of all commands history until now, specifying for each command if it’s RU…
Parse From Text File into String output
So I have a text file called employees.txt that looks like this… I’m trying to write a sed script that will read in the text file then output it in the format “< name > is a < gender >, and is < age > years old now.” I know I need to set the IFS=, but I’m stuck …
Failed to start ngnix.service: Unit ngnix.service not found
I have installed ngnix on ubuntu 20.04 . But when i am giving command sudo systemctl start ngnix . I am facing an error Failed to start ngnix.service: Unit ngnix.service not found. Please help me out through this problem. Answer It’s called nginx, not ngnix. So you need to start it as sudo systemctl sta…
How to store data permanently under /tmp in linux?
Before anyone gets bent out of shape saying you’re not supposed to do that and the like: I am currently working with a router with very limited disk space running OpenWRT. I need to install a few programs. Looks like there is plenty of space under /tmp, but nowhere else due to how the file system is par…