Check These Out
Same thing using bash built-in features instead of a sub-shell.
Using this command you can track a moment when usb device was attached.
The initial version of this command also outputted extra empty lines, so it went like this:
192.168.166.48
127.0.0.1
This happened on Ubuntu, i haven't tested on anything else.
somewhat faster version to see the size of our directories. Size will be in Kilo Bytes. to view smallest first change '-k1nr' to '-k1n'.
Really useful when out of space in your current machine.
You can ran this also with cat for example:
$ tar zcvf - /folder/ | ssh root@192.168.0.1 "cat > /dest/folder/file.tar.gz"
Or even run other command's:
$ tcpdump | ssh root@10.0.0.1 "cat > /tmp/tcpdump.log"
This shell function displays a list of binaries contained in an installed package; works on Debian based Linux distributions.
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
Stuck behind a restrictive firewall at work, but really jonesing to putty home to your linux box for some colossal cave? Goodness knows I was...but the firewall at work blocked all outbound connections except for ports 80 and 443. (Those were wide open for outbound connections.) So now I putty over port 443 and have my linux box redirect it to port 22 (the SSH port) before it routes it internally. So, my specific command would be:
$iptables -t nat -A PREROUTING -p tcp --dport 443 -j REDIRECT --to-ports 22
Note that I use -A to append this command to the end of the chain. You could replace that with -I to insert it at the beginning (or at a specific rulenum).
My linux box is running slackware, with a kernel from circa 2001. Hopefully the mechanics of iptables haven't changed since then. The command is untested under any other distros or less outdated kernels.
Of course, the command should be easy enough to adapt to whatever service on your linux box you're trying to reach by changing the numbers (and possibly changing tcp to udp, or whatever). Between putty and psftp, however, I'm good to go for hours of time-killing.
Usage: lower [STRING]...