I am trying to get the output of a list of hosts, using the unix command nslookup + the list of hosts, but I am getting an error although it does work when I only have one host. Is there an easier way to do what I am doing or can you help me fix this simple script? My script
what does a if mean during variable assignment
I am going through a couple of BASH scripts. And I came across something like this Apparently the Variable VAR_S should not be empty and I am trying to wrap my head around this statement. What does if=${MY_FILE} mean here. I am trying to figure out why VAR_S is returning empty when I echo it.It seems to me li…
Golang Mac OSX build for Docker machine
I need to run Golang application on Docker machine. I’m working on Mac OSX and Docker is working on top of Linux virtual machine, so binaries builded on Mac are not runnable on Docker. I see two ways here: cross-compile binaries on Mac for linux OS copy project sources to docker, run ‘go get’…
Comparing two files and updating second file using bash and awk and sorting the second file
I have two files with two colums in each file that I want to compare the 1st column of both files. If the value of the 1st column in the first file does not exist in the second file, I then want to append to the second file the value in the 1st column of the first file, eg firstFile.log
Having Apache httpd listen on port 80, but not started as root?
I would like to have my Apache httpd launch as non-route user (httpd) and still listen on port 80/443. This server will be running on a Linux host. Given that the first 1024 ports are reserved, how would I go about having a reserved port handled by a non-root daemon? Alternatively, can I run my apache on a no…
Optimizing C for loops [closed]
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 6 years ago. Improve this question I have been trying to optimize my program so far I got down to 8 se…
Why can’t python sockets resolve url’s with http in it
My Script basically looks like this i am getting an error, like this This means that python can’t resolve that particular host, if i remove the http:// and leave it as goal.com or make that request through my browser, it’s just fine and the script and the browser don’t throw any errors, one …
sigaction’s signal handler not called in child process
I’ve a program, which installs a signal handler for SIGSEGV. In signal handler ( I try to catch crash ) I restart my application. But when my application is resurrected it doesn’t handle SIGSEGV anymore. Here’s an example: what I get in output is: So I can see sighandler was set in right way…
Recursively grep unique pattern in different files
Sorry title is not very clear. So let’s say I’m grepping recursively for urls like this: grep -ERo ‘(http|https)://[^/”]+’ /folder and in folder there are several files containing the same url. My goal is to output only once this url. I tried to pipe the grep to | uniq or sort -u…
Ansible wait_for rebooting
I’m trying to use ansible to configure the environment I have to use. In particular, I need to write a task that reboots the servers, so I wrote this task: but the task fails reaching the time-out even though servers are correctly restarted. I was wondering if it fails because of my ssh configuration. T…