Check These Out
Download colorizer by @raszi @ http://github.com/raszi/colorize
This should handle whitespaces well and will not get confused if your filenames have "?" in them
Sort netflow packet capture by unique connections excluding source port.
host B (you) redirects a modem port (62220) to his local ssh.
host A is a remote machine (the ones that issues the ssh cmd).
once connected port 5497 is in listening mode on host B.
host B just do a
ssh 127.0.0.1 -p 5497 -l user
and reaches the remote host'ssh. This can be used also for vnc and so on.
AFAIR this is the wording ;)
Converts any number of seconds into days, hours, minutes and seconds.
sec2dhms() {
declare -i SS="$1"
D=$(( SS / 86400 ))
H=$(( SS % 86400 / 3600 ))
M=$(( SS % 3600 / 60 ))
S=$(( SS % 60 ))
[ "$D" -gt 0 ] && echo -n "${D}:"
[ "$H" -gt 0 ] && printf "%02g:" "$H"
printf "%02g:%02g\n" "$M" "$S"
}
Who needs a DNS server
Normally, if you su to another user from root and try to resume that other user's screen session, you will get an error like "Cannot open your terminal '/dev/pts/0' - please check." This is because the other user doesn't have permission for root's pty. You can get around this by running a "script" session as the new user, before trying to resume the screen session. Note you will have to execute each of the three commands separately, not all on the same line as shown here.
Credit: I found this at http://www.hjackson.org/blog/archives/2008/11/29/cannot-open-your-terminal-dev-pts-please-check.
After executing a command with multiple arguments like
cp ./temp/test.sh ~/prog/ifdown.sh
you can paste any argument of the previous command to the console, like
ls -l ALT+1+.
is equivalent to
ls -l ./temp/test.sh
ALT+0+. stands for command itself ('ls' in this case)
Simple ALT+. cycles through last arguments of previous commands.
Curl is not installed by default on many common distros anymore. wget always is :)
$ wget -qO- ifconfig.me/ip