How to apply a filter to real time output of `tail -f `?
With Unix you can pipe the output of one program into another. So to filter tail, you can use grep: tail -f path | grep your-search-filter
With Unix you can pipe the output of one program into another. So to filter tail, you can use grep: tail -f path | grep your-search-filter
You can use iptables to rate-limit new incoming connections to the SSH port. I’d have to see your entire iptables configuration in order to give you a turnkey solution, but you’re basically talking about adding rules like: iptables -A INPUT -p tcp –dport 22 -m recent –update –seconds 60 –hitcount 5 –name SSH –rsource -j … Read more
You could always do this: ssh user@host ls -l /some/directory That will SSH to the host, run ls, dump the output back to you and immediately disconnect.
An asterisk in the minute (first) field tells it to run every minute, regardless of the other fields. You need to specify an exact minute to run within the hour. Be that on the hour (0), half past (30), etc.. 0 */2 * * * /path-to-script
You can use: > /var/log/mail.log That will truncate the log without you having to edit the file. It’s also a reliable way of getting the space back. In general it’s a bad thing to use rm on the log then recreating the filename, if another process has the file open then you don’t get the … Read more
Solution Here is what I finally came up with after being set in the right direction by Miles Erickson. I wanted the address bar to reflect the original subdomain/domain of the request and not the redirected server and port, but he put me on the right path to Google up a solution using VirtualHost and … Read more
Yeah, you can do that. From curl –help or man curl: -k, –insecure (SSL) This option explicitly allows curl to perform “insecure” SSL connections and transfers. All SSL connections are attempted to be made secure by using the CA certificate bundle installed by default. This makes all connections considered “insecure” fail unless -k, –insecure is … Read more
I have tested this at home (~ 3 hosts) for some time now, trying different scms (RCS, Subversion, git). The setup that works perfectly for me right now is git with the setgitperms hook. Things you need to consider: Handling of file permissions and ownership RCS: does this natively Subversion: last I tried, you needed … Read more
If you’re logged in as root, you can easily wipe directories or do something that in retrospect is really dumb on the system with the flip of a finger, while as a user you normally have to put a few extra mental cycles into what you’re typing before doing something that is dangerous. Also any … Read more
This should work on Linux and SysV5 ps -ef –sort=start_time