Tidbits I've collected on various firewall and IDS/IPS technologies over the years. Linux, CheckPoint, Juniper Netscreen/SSG, Cisco ASA, Cisco IPS, & Sourcefire/Snort
Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts
Tuesday, September 7, 2010
Copy many routes from one Linux box to another
netstat -rn | grep ^[0-9] | awk '{printf "route add -net %-15s gw %-15s netmask %s\n", $1, $2, $3}' | sort > routing_table
Labels:
CheckPoint,
Linux
Monday, August 30, 2010
Simple Search & Replace in VI
In vi, this will replace any (uppercase or lowercase variation of the word "cat", or CAT, or cAt, with the word "dog" globally in the entire file.
%s/[Cc][Aa][Tt]/dog/g
%s/[Cc][Aa][Tt]/dog/g
Labels:
Linux,
one-liners
Find files modified in the last 90 minutes
Find files modified in last 90 minutes:
find / -mmin -90
find / -mmin -90
Labels:
Linux,
one-liners
How to force a Linux file system check (fsck)
To reboot with fsck -- shutdown -rF now
-or-
touch /forcefsck
echo -p >> /fsckoptions
init 6
Upon reboot if the fsck is successful both files will be removed.
-or-
touch /forcefsck
echo -p >> /fsckoptions
init 6
Upon reboot if the fsck is successful both files will be removed.
Labels:
Linux
Quick one-liner to find large files on Linux
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Labels:
Linux,
one-liners
Subscribe to:
Posts (Atom)