I like the Torrent client Transmission, but right now it does not have the same level of detail as some other clients do (BitTorrent or Azureus) such as showing the IPs of the peers you are connected to. So I wrote a script, and I have GeekTool run it every five seconds and then I put the results in a window on my desktop. The result of the script is a list of open sockets, and a title at the top that tells me how many Transmission is using.
Here's the code:
#!/bin/sh
ThePID=`ps -U yourusernamehere | grep TRANSMISSION | grep -v grep | awk '{ print $1 }'`;
TheFiles=`fstat -p $ThePID | grep stream | wc -l`;
echo $TheFiles " Transmission files open";
echo;
netstat -d -n -f inet | grep "ESTABLISHED" | grep -v 127 | awk '{print $5}'Mac OS X Hints
http://hints.macworld.com/article.php?story=20060209133539705