Check These Out
If you have a client that connects to a server via plain text protocol such as HTTP or FTP, with this command you can monitor the messages that the client sends to the server. Application level text stream will be dumped on the command line as well as saved in a file called proxy.txt.
You have to change 8080 to the local port where you want your client to connect to. Change also 192.168.0.1 to the IP address of the destination server and 80 to the port of the destination server.
Then simply point your client to localhost 8080 (or whatever you changed it to).
The traffic will be redirected to host 192.168.0.1 on port 80 (or whatever you changed them to).
Any requests from the client to the server will be dumped on the console as well as in the file "proxy.txt".
Unfortunately the responses from the server will not be dumped.
zip -r /tmp/filename-`date +%Y%m%d_%H%M%S`.zip /directory/
Add the functions to the .bashrc to make it work
Example: First go to the iso file directory and type:
----------------------------------------------------------------------------------------------------
user@box:~$ miso file.iso
----------------------------------------------------------------------------------------------------
It will put you into a temporary mounting point directory (ISO_CD) and will show the files
You can umount the iso file whatever the directory you are
----------------------------------------------------------------------------------------------------
user@box:~/ISO_CD$ uiso
----------------------------------------------------------------------------------------------------
It wil umount the iso file and remove the temporary directory in your home
Check out the usage of 'trap', you may not have seen this one much. This command provides a way to schedule commands at certain times by running them after sleep finishes sleeping. In the example 'sleep 2h' sleeps for 2 hours. What is cool about this command is that it uses the 'trap' builtin bash command to remove the SIGHUP trap that normally exits all processes started by the shell upon logout. The 'trap 1' command then restores the normal SIGHUP behaviour.
It also uses the 'nice -n 19' command which causes the sleep process to be run with minimal CPU.
Further, it runs all the commands within the 2nd parentheses in the background. This is sweet cuz you can fire off as many of these as you want. Very helpful for shell scripts.
alt + number + dot will insert last command argument at $number place, alt + 0 + . will print last command name. For example
$ ls /tmp /var
$ ls /usr /home
alt + 1 + . will result in '/usr' , if you press alt + . again, it will result in '/tmp'
alt + 0 + . -> 'ls'
-p Tell me the name of the program and it's PID
-l that is listening
-u on a UDP port.
-n Give me numeric IP addresses (don't resolve them)
-t oh, also TCP ports
i.e.: Useful if you add ~/bin to your $PATH and you want to override locations of previously ran commands and you don't want to log out and log back in to be able to use them.