All Questions

Filter by
Sorted by
Tagged with
185 votes
8 answers
280k views

Filename length limits on linux?

Are there any filename or path length limits on Linux?
readonly's user avatar
  • 3,429
185 votes
16 answers
175k views

Why is DNS failover not recommended?

From reading, it seems like DNS failover is not recommended just because DNS wasn't designed for it. But if you have two webservers on different subnets hosting redundant content, what other methods ...
Lin's user avatar
  • 2,949
184 votes
61 answers
14k views

Good tools that fit on a thumb drive [closed]

I have been on the lookout lately for some good tools to fill up my flash drive and I thought I would ask the Server Fault community for recommendations on good tools that will fit onto a thumb drive. ...
184 votes
31 answers
100k views

How do I prevent accidental rm -rf /*?

I just ran rm -rf /* accidentally, but I meant rm -rf ./* (notice the star after the slash). alias rm='rm -i' and --preserve-root by default didn't save me, so are there any automatic safeguards for ...
Valentin Nemcev's user avatar
183 votes
18 answers
1.2m views

How do you restart php-fpm?

I need to reload my php.ini and there's nothing in the help dialog about restarting it.
Galen's user avatar
  • 1,983
183 votes
12 answers
245k views

What does "Warning: untrusted X11 forwarding setup failed: xauth key data not generated" mean when ssh'ing with -X?

When I use ssh -X on my Mac (running OS X 10.6.7) to connect to my Ubuntu (11.04) box, I get the following warning: Warning: untrusted X11 forwarding setup failed: xauth key data not generated ...
Daryl Spitzer's user avatar
183 votes
5 answers
102k views

What is the difference between Load Balancer and Reverse Proxy?

I'm not clear about the difference between Load Balancer and Reverse Proxy. They both seems having same behavior: distributing incoming requests to backend servers.
Morgan Cheng's user avatar
  • 2,174
182 votes
2 answers
192k views

How do you answer yes for yum install automatically

In centos how do you answer yes automatically for yum install so that it is an unassisted install?
DiverseAndRemote.com's user avatar
181 votes
8 answers
411k views

How do I sleep for a millisecond in bash or ksh

sleep is a very popular command and we can start sleep from 1 second: # wait one second please sleep 1 but what the alternative if I need to wait only 0.1 second or between 0.1 to 1 second ? ...
yael's user avatar
  • 2,473
180 votes
18 answers
287k views

Disk full, du tells different. How to further investigate?

I have a SCSI disk in a server (hardware Raid 1), 32G, ext3 filesytem. df tells me that the disk is 100% full. If I delete 1G this is correctly shown. However, if I run a du -h -x / then du tells me ...
initall's user avatar
  • 2,375
180 votes
8 answers
95k views

Sudo as different user and running screen

Found out today that running screen as a different user that I sudo into won't work! i.e. ssh bob@server # ssh into server as bob sudo su "monitor" - screen # fails: Cannot ...
sdot257's user avatar
  • 3,069
180 votes
11 answers
112k views

Run an interactive bash subshell with initial commands without returning to the ("super") shell immediately

I want to run a bash subshell, (1) run a few commands, (2) and then remain in that subshell to do as I please. I can do each of these individually: Run command using -c flag: $> bash -c "ls; pwd; ...
SABBATINI Luca's user avatar
177 votes
7 answers
357k views

What does Virtual memory size in top mean?

I am running top to monitor my server performance and 2 of my java processes show virtual memory of up to 800MB-1GB. Is that a bad thing? What does virtual memory mean? And oh btw, I have swap of ...
kapso's user avatar
  • 2,113
177 votes
5 answers
99k views

What's the difference between authorized_keys and authorized_keys2?

Just wanted a quick summary of the differences between them and why there are two?
Jon's user avatar
  • 2,131
176 votes
9 answers
222k views

Is it possible to detach a process from its terminal? (Or, "I should have used screen!") [duplicate]

Possible Duplicate: Can I nohup/screen an already-started process? On Unix (specifically, Linux), I've started a job in a regular ssh->bash session. I'd like to leave work soon, but I now realize ...
mike's user avatar
  • 4,013
176 votes
7 answers
752k views

How can I read pcap files in a friendly format?

a simple cat on the pcap file looks terrible: $cat tcp_dump.pcap ?ò????YVJ? JJ ?@@.?E<??@@ ?CA??qe?U????иh? .Ceh?YVJ?? JJ ?@@.?E<??@@ CA??qe?U????еz?...
Tony's user avatar
  • 4,253
175 votes
11 answers
353k views

Run a .bat file in a scheduled task without a window

I have a scheduled task that starts a batch script that runs robocopy every hour. Every time it runs a window pops up on the desktop with robocopy's output, which I don't really want to see. I ...
Tom Dunham's user avatar
  • 1,895
174 votes
9 answers
350k views

Is it possible to generate RSA key without pass phrase?

I'm working with Apache2 and Passenger for a Rails project. I would like to create a self-signed SSL Certificate for testing purposes. sudo openssl rsa -des3 -in server.key -out server.key.new ...
diya's user avatar
  • 1,893
174 votes
10 answers
303k views

How do I diff two text files in Windows Powershell?

I have two text files and want to find the differences between them using Windows Powershell. Is there something similar to the Unix diff tool available? Or is there another other way I haven't ...
Brian Willis's user avatar
  • 3,839
172 votes
5 answers
324k views

How to remove the path with an nginx proxy_pass

I have a running web-application at http://example.com/, and want to "mount" another application, on a separate server on http://example.com/en. Upstream servers and proxy_pass seem to work, but for ...
berkes's user avatar
  • 2,285
171 votes
9 answers
589k views

Find name of Active Directory domain controller

How can I find out the name/IP address of the AD domain controller on my network?
user18682's user avatar
  • 2,281
171 votes
10 answers
34k views

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 ...
oz1cz's user avatar
  • 1,605
170 votes
4 answers
247k views

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 ...
Stephen Melrose's user avatar
169 votes
2 answers
198k views

tar - Remove leading directory components on extraction

How can you extract only the target dir and not the complete dir tree? compress tar cf /var/www_bak/site.tar /var/www/site extract tar xf /var/www/site.tar -C /tmp This will produce: /tmp/var/www/...
clarkk's user avatar
  • 2,085
169 votes
5 answers
233k views

Force dig to resolve without using cache

I'm wondering if there is a way to query a DNS server and bypass caching (with dig). Often I change a zone on the DNS server and I want to check if it resolves correctly from my workstation. But since ...
Daniel's user avatar
  • 3,157
169 votes
5 answers
284k views

How to add dependency on a Windows Service AFTER the service is installed

I have a Windows Service that makes use of a SQL Server database. I don't have control over the installation of the service, but would like to add a dependency on the service to ensure that it starts ...
Rick's user avatar
  • 1,835
168 votes
11 answers
70k views

bash: print stderr in red color

Is there a way to make bash display stderr messages in red color?
kolypto's user avatar
  • 11.2k
168 votes
3 answers
114k views

Why can't a CNAME record be used at the apex (aka root) of a domain?

This is a Canonical Question about CNAMEs at the apices (or roots) of zones It's relatively common knowledge that CNAME records at the apex of a domain are a taboo practice. Example: example.com. IN ...
Andrew B's user avatar
  • 33.1k
167 votes
14 answers
565k views

Running a cron job manually and immediately

(I have already read How can I test a new cron script ?.) I have a specific problem (cron job doesn't appear to run, or run properly), but the issue is general: I'd like to debug scripts that are ...
Pistos's user avatar
  • 3,173
166 votes
10 answers
440k views

GRANT SELECT to all tables in postgresql

Is there a one-liner that grants the SELECT permissions to a new user postgresql? Something that would implement the following pseudo-code: GRANT SELECT ON TABLE * TO my_new_user;
Adam Matan's user avatar
  • 13.6k
166 votes
4 answers
202k views

Find the location of a systemd unit file service

There are many different places where systemd unit files may be placed. Is there a quick and easy way to ask systemd where it read a service’s declaration from, given just the service name?
Joachim Breitner's user avatar
165 votes
8 answers
132k views

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 ...
egorgry's user avatar
  • 2,911
165 votes
6 answers
228k views

List of files installed from apt package

How do I get a list of files that were or will-be installed when I apt-get a package? Conversely, can I find what package(s) caused a particular file to be installed?
David Nehme's user avatar
  • 2,166
164 votes
9 answers
552k views

How to remove empty/blank lines from a file in Unix (including spaces)?

How do I remove empty/blank (including spaces only) lines in a file in Unix/Linux using the command line? contents of file.txt Line:Text 1:<blank> 2:AAA 3:<blank> 4:BBB 5:<blank> 6:...
Michael Ellick Ang's user avatar
163 votes
12 answers
333k views

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's user avatar
  • 1,629
162 votes
18 answers
296k views

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 <something is mounted at /mnt/foo> then <Do some ...
Mark Biek's user avatar
  • 1,947
162 votes
5 answers
33k views

Are SSD drives as reliable as mechanical drives (2013)?

SSD drives have been around for several years now. But the issue of reliability still comes up. I guess this is a follow up from this question posted 4 years ago, and last updated in 2011. It's now ...
hookenz's user avatar
  • 14.6k
160 votes
3 answers
993k views

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's user avatar
  • 116k
159 votes
8 answers
164k views

Amazon Cloudfront with S3. Access Denied

We're trying to distribute out S3 buckets via Cloudfront but for some reason the only response is an AccessDenied XML document like the following: <Error> <Code>AccessDenied</Code&...
Jordan Adams's user avatar
  • 1,691
159 votes
5 answers
354k views

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's user avatar
  • 6,041
158 votes
5 answers
273k views

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's user avatar
  • 1,727
158 votes
13 answers
331k views

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 ...
raoulsson's user avatar
  • 4,823
158 votes
2 answers
58k views

Sometimes PowerShell stops sending output until I press enter. Why?

Periodically I notice PowerShell seems to take forever to finish doing whatever it is I told it to do until it occurs to me to "wake it up" by pressing enter. This is not the fault of any one process ...
Nathan Ridley's user avatar
157 votes
9 answers
1.3m views

Command line to list users in a Windows Active Directory group?

Is there a command line way to list all the users in a particular Active Directory group? I can see who is in the group by going to Manage Computer --> Local User / Groups --> Groups and double ...
user avatar
157 votes
6 answers
304k views

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) ...
estani's user avatar
  • 2,171
156 votes
13 answers
77k views

Are networks now faster than disks?

This is a software design question I used to work on the following rule for speed cache memory > memory > disk > network With each step being 5-10 times the previous step (e.g. cache ...
pm100's user avatar
  • 1,655
154 votes
19 answers
464k views

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:...
Antonius Bloch's user avatar
154 votes
3 answers
74k views

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 ...
Anubhav Agarwal's user avatar
154 votes
5 answers
135k views

How do I make ssh fail rather than prompt for a password if the public-key authentication fails?

I've got a script that SSHes several servers using public key authentication. One of the servers has stopped letting the script log in due to a configuration issue, which means that the script gets ...
rjmunro's user avatar
  • 2,331
153 votes
9 answers
365k views

What version of RHEL am I using?

From the shell and without root privileges, how can I determine what Red Hat Enterprise Linux version I'm running? Ideally, I'd like to get both the major and minor release version, for example RHEL ...
Arthur Ulfeldt's user avatar

15 30 50 per page