Tuesday, April 26, 2011

Install capistrano on RHEL or CentOS

Capistrano is great for automating system tasks. Here is how to install it on RPM-based systems:

# yum install ruby rubygems
# gem install mocha echoe rake capistrano

Please note that mocha, echoe are optional for tests, but I included them in these instructions.

Monday, April 18, 2011

TCP dump for only port 80

Here is a way to dump all tcp traffic on port 80 to and from the bond0 interface:

tcpdump -w tcpdumpPort80.pcap -i bond0 tcp port 80

If you wanted to use only the eth0 interface (more common), use this example:

tcpdump -w tcpdumpPort80.pcap -i eth0 tcp port 80

Sending files from the Linux command line

Here is a quick way to e-mail yourself files from a server using mutt.

$ mutt -a tcpdumpApril182011.pcap my_name@example.com < /dev/null

Mutt is great for sending MIME encoded files.