Most Popular
1500 questions
173
votes
10 answers
How bad is IPv4 address exhaustion really?
For years the press has been writing about the problem that there are now very few IPv4 addresses available. But on the other hand, I'm using a server hosting company which gladly gives out public IPv4 addresses for a small amount of money. And my…
oz1cz
- 1,635
173
votes
4 answers
Getting "Cannot ioctl TUNSETIFF tun: Operation not permitted" when trying to connect to OpenVPN
I'm trying to setup an OpenVPN Access Server in AWS using the market place AMI, but I;m struggling to connect to it.
The access server is up and running. I've also added a user with Auto-Login and generated the relevant client config and…
Stephen Melrose
- 6,065
173
votes
11 answers
bash: print stderr in red color
Is there a way to make bash display stderr messages in red color?
kolypto
- 11,588
170
votes
12 answers
Best practices for setting a cron job for Let's Encrypt (Certbot) renewal?
Is this correct way to set cron for renewal of Let's Encrypt cert in Apache2 ?
I use Ubuntu 16.04.
@monthly letsencrypt renew && service apache2 reload
user3448600
- 1,699
169
votes
3 answers
What causes the 'Connection Refused' message?
This is a Canonical Question about Connection Refused
We see a lot of questions to the effect
When I try to connect to a system I get a message
Connection refused
Why is this ?
user9517
- 117,122
166
votes
19 answers
What's the best way to check if a volume is mounted in a Bash script?
What's the best way to check if a volume is mounted in a Bash script?
What I'd really like is a method that I can use like this:
if
then
else
fi
Mark Biek
- 1,987
166
votes
5 answers
How to check if an RSA public / private key pair match
I have two files, id_rsa and id_rsa.pub. What command can be used to validate if they are a valid pair?
Ryan
- 6,271
165
votes
13 answers
Is there a global, persistent CMD history?
Sometimes I forget how the exact syntax of a CMD command looks and then I would like to search my own CMD history. Clearly, within the same session, you can browse it with the up and down arrow keys but what about the history of former CMD sessions?…
raoulsson
- 4,923
165
votes
6 answers
How to output variable in nginx log for debugging
I am testing nginx and want to output variables to the log files. How can I do that and which log file will it go (access or error).
lulalala
- 1,797
165
votes
8 answers
What does 'set -e' do, and why might it be considered dangerous?
This question has appeared on a pre-interview quiz and it's making me crazy. Can anyone answer this and put me at ease? The quiz has no reference to a particular shell but the job description is for a unix sa.
again the question is simply...
What…
egorgry
- 2,911
164
votes
2 answers
What's the difference between include_tasks and import_tasks?
In Ansible 2.4, the include module is deprecated. In its place, it ships with two replacement modules, import_tasks and include_tasks. But they have very similar descriptions:
include_tasks: Includes a file with a list of tasks to be executed in…
Ben S
- 1,751
164
votes
6 answers
How can I debug a docker container initialization?
I had an issue with a container, even though it builds perfectly it does not properly start. The cause is a workaround I've added to the Dockerfile (for having a self-configured /etc/hosts routing)
RUN mkdir -p -- /lib-override /etc-override && cp…
estani
- 2,306
163
votes
11 answers
In a PowerShell script, how can I check if I'm running with administrator privileges?
In a PowerShell script, how can I check if I'm running with administrator privileges?
Michael Kelley
- 1,745
163
votes
3 answers
Delete Amazon EC2 terminated instance
I created an Amazon Free tier Usage Account. I launched two amazon ec2 instances using the online tool. After that one instance was created and running while other was pending which quickly shifted to terminated state.
In description it shows State…
Anubhav Agarwal
- 1,763
163
votes
22 answers
How to add a timestamp to bash script log?
I have a constantly running script that I output to a log file:
script.sh >> /var/log/logfile
I'd like to add a timestamp before each line that is appended to the log. Like:
Sat Sep 10 21:33:06 UTC 2011 The server has booted up. Hmmph.
Is there…
Antonius Bloch
- 4,960