Skip to content

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&#8217…

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…

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…