Most Popular

1500 questions
69
votes
10 answers

Linux: using find to locate files older than

find has good support for finding files the more modified less than X days ago, but how can I use find to locate all files modified before a certain date? I can't find anything in the find man page to do this, only to compare against another files…
DrStalker
  • 6,946
  • 24
  • 79
  • 107
69
votes
6 answers

Sending cron output to a file with a timestamp in its name

I have a crontab like this on a LAMP setup: 0 0 * * * /some/path/to/a/file.php > $HOME/cron.log 2>&1 This writes the output of the file to cron.log. However, when it runs again, it overwrites whatever was previously in the file. How can I get cron…
Philip Morton
  • 813
  • 1
  • 6
  • 7
69
votes
1 answer

NMAP: Check if port 80 and 8080 is open

In our company, I want to check if users are running web servers on port 80 and 8080. I downloaded nmap and ran this command: nmap -p 80,8080 192.168.1.0-255 I got a list of IPs and tried to access them in my browser (EG: 192.168.1.1:8080) but…
Ian
  • 901
  • 2
  • 7
  • 10
69
votes
11 answers

How do I check if Log4j is installed on my server?

I have read about security vulnerabilities related to Log4j. How do I check if Log4j is installed on my server? My specific servers use Ubuntu 18.04.6 LTS. I have installed many third-party packages and maybe some of them contain it. Is there a…
Uri
  • 881
  • 1
  • 9
  • 16
69
votes
7 answers

Should websites live in /var/ or /usr/ according to recommended usage?

According to a guide on the Linux directory structure, /usr/ is for application files, and /var/ is for files that change (I assume this means "files that belong to the applications"). Is this correct? If this is the case then I'm a little torn…
Nick Bolton
  • 5,126
  • 12
  • 54
  • 62
68
votes
2 answers

Why does AWS recommend against public S3 buckets?

"We highly recommend that you never grant any kind of public access to your S3 bucket." I have set a very granular public policy (s3:GetObject) for one bucket that I use to host a website. Route53 explicitly supports aliasing a bucket for this…
68
votes
3 answers

Is the PHP option 'cgi.fix_pathinfo' really dangerous with Nginx + PHP-FPM?

There has been a lot of talking about a security issue relative to the cgi.fix_pathinfo PHP option used with Nginx (usually PHP-FPM, fast CGI). As a result, the default nginx configuration file used to say: # NOTE: You should have…
Totor
  • 2,916
  • 3
  • 23
  • 31
68
votes
3 answers

Search ec2 instance by its name from aws command line tool

I have an instance named dev-server-03. Now how can I search all dev-server-* instances from command line? I am using aws cli tool.
Shiplu Mokaddim
  • 893
  • 2
  • 9
  • 14
68
votes
4 answers

How can I get more info on open pipes show in /proc in Linux?

In Linux if you go digging in /proc//fd often you'll see output like: lrwx------ 1 root root 64 Jul 30 15:14 0 -> /dev/null lrwx------ 1 root root 64 Jul 30 15:14 1 -> /dev/null l-wx------ 1 root root 64 Jul 30 15:14 10 ->…
Kamil Kisiel
  • 12,184
  • 7
  • 48
  • 69
68
votes
9 answers

Convert from P7B to PEM via OpenSSL

On Ubuntu, I cannot convert certificate using openssl successfully. vagrant@dev:/vagrant/keys$ openssl pkcs7 -print_certs -in a.p7b -out a.cer unable to load PKCS7 object :PEM routines:PEM_read_bio:no start line:pem_lib.c:696:Expecting:…
Kevin Meredith
  • 1,269
  • 2
  • 15
  • 21
68
votes
11 answers

Disable a service from starting at all runlevels?

I have a service foo which currently starts at runlevel 3 and above. How can I stop it from doing so, without using update-rc.d foo stop 3 ., which (if I understand it correctly) would turn off the service at each runlevel change. (ie., if I was at…
lfaraone
  • 1,611
  • 3
  • 18
  • 23
68
votes
8 answers

Is there a way to redirect output to a file without buffering on unix/linux?

I have a long running batch process that outputs some debug and process information to stdout. If I just run from a terminal I can keep track of 'where it is' but then the data gets too much and scrolls off the screen. If I redirect to output to a…
James Dean
  • 801
  • 1
  • 7
  • 5
68
votes
3 answers

How do I enable non-free packages on Debian?

How can I enable non-free packages on Debian? I want to install Sun's Java JDK but it's not available to me.
Quiffner
  • 683
  • 1
  • 5
  • 4
68
votes
2 answers

How to restart rsyslog daemon on ubuntu

how can i restart rsyslog or rsyslogd on ubuntu 10 root@terminator:/etc/init.d# service rsyslog status rsyslog stop/waiting root@terminator:/etc/init.d# service rsyslog stop stop: Unknown instance: root@terminator:/etc/init.d# service rsyslog…
John
68
votes
6 answers

How to check disk I/O utilization per process?

I'm having a problem with a Linux system and I have found sysstat and sar to report huge peaks of disk I/O, average service time as well as average wait time. How could I determine which process is causing these peaks the next time it happen? Is it…
Avada Kedavra
  • 1,294
  • 2
  • 13
  • 19