Feb 052013
 

So I wrote this script because I often need to run tcpdump on a remote host and then view it in wireshark.  The old method was to run tcpdump on remote host, scp/rsync the file back to my local machine, open it in wireshark, view it.  This script saves a lot of time.  It assumes you are logging in as root and will need modified if you are running as a normal user (change root to your username and make sure you have sudo privileges for tcpdump)

#!/bin/bash
 
# By Ed Wiget
# This runs tcpdump on a remote hosts and pipes it back locally to wireshark to view in realtime
 
# 20130205 - original script
 
if [ $1 == "" ]; then
	echo "What is the remote host by fqdn, i.e. server1.domain.com"
	read RHOST
else
	RHOST=$1
fi
 
wireshark -k -i <( ssh -l root ${RHOST} /usr/sbin/tcpdump -i eth0 -w - )
 
# after you kill wireshark, the tcpdump still runs on remove host...we need to kill it
PIDOF=`ssh root@${RHOST} "ps aux | grep [t]cpdump" | awk -F" " '{print$2}'`
 
echo "killing pid ${PIDOF} on ${RHOST}...please wait...."
ssh root@${RHOST} "pkill tcpdump"
 
# now we make sure it is killed
PIDOF2=`ssh root@${RHOST} "ps aux | grep [t]cpdump" | awk -F" " '{print$2}'`
if [ ${PIDOF2} == "" ]; then
	echo "pid check returns ${PIDOF2}"
else
	echo "pid check returns ${PIDOF2}"
fi

Nov 192011
 
fluxbox basic

I don’ t really care for the bloated kde or gnome desktops, especially on a netbook with limited memory.  I have pretty much always been a fluxbox user since about 2003 or so.  Over the years my configuration changes, partially because the way I do things changes.  This means my fluxbox environment changes….but not too often.  What bothers me is that sometimes I will lose the latest file for my fluxbox environment, as I often tweak it every couple of days.  This used to be the case, but now pretty much everything goes to external backup in real time.  But many people ask me about my fluxbox because it does look pretty damn nice, its very functional, and my entire computer runs in about 200MB of memory.  So without further wait, here it is, complete with config files.

The first image below shows my fluxbox desktop.  The middle image shows fluxbox with the slit showing that I have set to auto hide so its not viewable in the first image.  The third image shows tmux running inside of an Eterm with two splits shown.  I just started using tmux and it allows you to have multiple windows inside of a console or term window (sort of how you can split horizontally or vertically inside of terminator).  I use the default bind keys in tmux, so not really anything I can tell you about it outside of providing you this link to the tmux cheat sheet.

# Updated 20111210 – several people asked about what I used on my desktop or laptops, since I sort of stupilated I didnt like bloated wm’s on my netbook, and fact is, I still use fluxbox with the exact same config.  Below are two screenshots from my Quad core desktop with 16GB memory and 1TB raid 0 drives (Images 4 and 5 in the gallery below)

Continue reading »

Nov 192010
 

I bought my netbook, a samsung N150 Plus from Best Buy.  It was an emergency purchase because my full size laptop, an HP DV7, had stopped working.  Without going into details, the design of the “Smart” batteries of HP laptops suck!  Who ever thought you could NOT run a laptop, even on AC power when/if the battery goes bad?  Anyways, when I purchased the laptop, I also did the memory upgrade and bought a 500GB Maxtor XT (Now Seagate) hard drive (the hybrid with 4GB Solid State).  The reason I bought the hard drive right off was because I had dual 500GB hard drives in my laptop dual booting windows vista and backtrack.  I primarily use backtrack for my day to day job and only vista if I am on the road editing pictures (photography is a hobby).  And because everybody asks, the reason I bought a netbook instead of another laptop was because I ordered a replacement battery, and wanted something more portable than my 17″ HP (which weighs a lot with the 12 cell battery).  I also bought a really cheap netbook case that I replaced 3 days later with a nicer and more functional targus case….and then about a week later also bought an external thin cd-rom.

So, the first thing I did to this netbook when I got it home was to remove the 13 base screws and replace the hard drive and while at it I installed the memory upgrade.  It took about 30 minutes total time.  I then booted using a backtrack thumbdrive and installed.  Next, I restored my home directory from an external encrypted disk which had a backup that was about 4 days old.  The remaining important files I waited to sync from dropbox….which seems like took forever.

Basically within about 2-3 hours of my laptop failing, I was back up and running right where I left off…….and I might add, this thing has amazing battery time running linux, nearly 9 hours of actual work time using wireless internet (basically I had a browser opened, kate, a couple eterms, pidgin, xchat).  WOW!!!  My laptop only got about 3 hours battery time before the battery started going bad.