Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
tips:threelinestip [2008/09/03 18:55] a |
tips:threelinestip [2008/12/09 17:23] a + Local/remote webserver |
||
---|---|---|---|
Line 57: | Line 57: | ||
# lsof | grep ' root ' | # lsof | grep ' root ' | ||
+ | |||
+ | ===== How to check is service is tcpwrapper enable ===== | ||
+ | # ldd `which sshd` | grep -i libwrap | ||
+ | |||
+ | or | ||
+ | |||
+ | # strings `which sshd` | grep -i libwrap | ||
+ | |||
+ | |||
+ | ===== Comparing files & taking some action based on outcome ===== | ||
+ | **Method 1** | ||
+ | < | ||
+ | cmp -s file1 file2 || { | ||
+ | # do something | ||
+ | } | ||
+ | </ | ||
+ | **Method 2** | ||
+ | < | ||
+ | cmp -s file1 file2 | ||
+ | if [ $? = 1 ] | ||
+ | then | ||
+ | # do something | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | ===== IPv4 parsing / sorting ===== | ||
+ | |||
+ | egrep ' | ||
+ | |||
+ | and | ||
+ | |||
+ | sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 | ||
+ | |||
+ | |||
+ | |||
+ | ===== finding a string in a " | ||
+ | |||
+ | tail -f filename |grep --line-buffered | ||
+ | |||
+ | ===== Local/ | ||
+ | |||
+ | Serve files on port 8080 for anybody from the directory from where you start this command: | ||
+ | |||
+ | <code bash|> | ||
+ | :;while [ $? -eq 0 ];do nc -vlp 8080 -c' | ||
+ | "; | ||
+ | </ | ||