Check These Out
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted.
Inspired by EVACopy http://evacopy.sourceforge.net
Working with lists of IP addresses it is sometimes useful to summarize a count of how many times an IP address appears in the file.
This example, summarizeIP, uses another function "verifyIP" previously defined in commandlinefu.com to ensure only valid IP addresses get counted. The summary list is presented in count order starting with highest count.
This command starts screen with 'htop', 'nethogs' and 'iotop' in split-screen. You have to have these three commands (of course) and specify the interface for nethogs - mine is wlan0, I could have acquired the interface from the default route extending the command but this way is simpler.
htop is a wonderful top replacement with many interactive commands and configuration options. nethogs is a program which tells which processes are using the most bandwidth. iotop tells which processes are using the most I/O.
The command creates a temporary "screenrc" file which it uses for doing the triple-monitoring. You can see several examples of screenrc files here: http://www.softpanorama.org/Utilities/Screen/screenrc_examples.shtml
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.
At the start of a vi session and *before* saving any changes use ":!cp % %-" to make a backup of the current file being edited.
example: vi /data/some/long/path/file
:!cp% %-
creates /data/some/long/path/file-
set directly the wallpaper on windowmaker , use this command with display of imagemagick :)
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"
}