hoodwink.d enhanced
 

juretta.com

iTunes: Who's connected | July 11, 2005-->

July 11, 2005

Ever wondering who those "n users connected" are when you look at the Sharing part of the Preferences of your iTunes? Well wonder no more - it turns out fairly easy to figure out in Terminal.app; just type this line:

lsof -r 2 -n -P -F n -c iTunes -a -i TCP@`hostname`:3689

and it will tell you the IP address of each connection, together with the music file the connection is listening to. lsof is a UNIX tool which is capable of listing the files a particular process opens - including even the files being accessed from remote connections, such as NFS, and iTunes in our case. Some short explanations of the parameters used:

  • -r 2: list the opened files repeatedly, and refresh the list every 2 seconds.
  • -n: show numeric IP address instead of domain names.
  • -P: show port info in numbers instead of names (e.g., 3689 vs. `daap').
  • -F n: display field `name' (n).
  • -c iTunes: only list files opened by process with name 'iTunes'.
  • -a: logical `and' to connect more than one conditions.
  • -i TCP@`hostname`:3689: only list files involving the specified address; in this case the protocol must be TCP, connecting to my machine, and connecting to port 3689.

Diggman

About

juretta.com is the personal workspace of Stefan Saasen. You can send him an email or read more about this site in the „About“ section.

« Previous entry

Eclipse Plugins
posted over 3 years ago

» Next entry

SSH on non-standard Port
posted over 3 years ago

Recent comment

On: “Attachr.com: OpenID support added

You need to kill this spam stuff!

posted about 1 year ago by entropie

Look!

Latest links  RSS  

More...