Hi all,
Is there a way to find out from where a data stream is coming from? - Like if I'm listening to a music station online, can I find out which url is sending that data?
Many thanks
Nick Wilson wrote:
Hi all,
Is there a way to find out from where a data stream is coming from? - Like if I'm listening to a music station online, can I find out which url is sending that data?
Find the PID of the program you're running, and use 'lsof -p <pid>' to see what files (and sockets) it has open.
* and then Gordon Messmer declared....
Is there a way to find out from where a data stream is coming from? - Like if I'm listening to a music station online, can I find out which url is sending that data?
Find the PID of the program you're running, and use 'lsof -p <pid>' to see what files (and sockets) it has open.
Thanks, I'll try it. I did try 'netstat' but it just gives me unusable data...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Monday 01 December 2003 11:42, Nick Wilson wrote:
Thanks, I'll try it. I did try 'netstat' but it just gives me unusable data...
Don't condemn netstat as giving 'unusable' data, poor thing. Try
netstat -p | grep xmms (or whatever the streaming app is)
You'll need to be root if someone else owns the app instance in question.
Another cool thing for netstat
netstat -plut
Tells you who is listening on udp and tcp, and what app it is, need to run that one as root since there are bound to be things a user didn't spawn.
- -Andy
Andy Green fedora@warmcat.com writes:
On Monday 01 December 2003 11:42, Nick Wilson wrote:
Thanks, I'll try it. I did try 'netstat' but it just gives me unusable data...
Don't condemn netstat as giving 'unusable' data, poor thing. Try
netstat -p | grep xmms (or whatever the streaming app is)
You'll need to be root if someone else owns the app instance in question.
Another cool thing for netstat
netstat -plut
Tells you who is listening on udp and tcp, and what app it is, need to run that one as root since there are bound to be things a user didn't spawn.
Pardon me butting in but the -p switch still doesn't show the source address the OP requested. Can netstat do that?
To OP: Try iptraf. One of its screens will show the actual url. But its still something of a guessing game if you have other active connections.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Monday 01 December 2003 12:27, Harry Putnam wrote:
Pardon me butting in but the -p switch still doesn't show the source address the OP requested. Can netstat do that?
Here's what I see while listening to suprnova radio
[agreen@fastcat agreen]# netstat -p | grep xmms tcp 0 0 fastcat1.cb.ath.c:33576 ns1.magicaldns.net:8356 ESTABLISHED 23672/xmms
Here's the playlist file
[playlist]
NumberOfEntries=1
File1=http://207.142.135.31:8356/
[agreen@fastcat agreen]# ping 207.142.135.31 PING 207.142.135.31 (207.142.135.31) 56(84) bytes of data. [agreen@fastcat agreen]# ping ns1.magicaldns.net PING ns1.magicaldns.net (207.142.135.31) 56(84) bytes of data.
There seems to be enough information there to regenerate the URL. I don't know if the streaming protocol allows directories but I doubt it.
- -Andy
* and then Harry Putnam declared....
Don't condemn netstat as giving 'unusable' data, poor thing. Try
netstat -p | grep xmms (or whatever the streaming app is)
Pardon me butting in but the -p switch still doesn't show the source address the OP requested. Can netstat do that?
Yes, I don't get a useable url...
To OP: Try iptraf. One of its screens will show the actual url. But its still something of a guessing game if you have other active connections.
Ok, that's a little more helpful but I only get an IP adress not a url?
Thanks guys..
Nick Wilson nick@stylesheet.org writes:
To OP: Try iptraf. One of its screens will show the actual url. But its still something of a guessing game if you have other active connections.
Ok, that's a little more helpful but I only get an IP adress not a url?
Just happened to think.... you can get a detailed http type address with tcpdump. Just don't use the -n switch.
In your case, assuming you know which interface (like eth0 eht1 etc) this would occur on you could run:
tcpdump -v -i <device> |grep http
Will give you literally piles of info about the http connections. You could refine the grep after seeing some of it.
tcpdump is an advanced networking tool used to examine info passing across a network. Its widely available online. But you can get it like `up2date tcpdump'
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Monday 01 December 2003 15:19, Nick Wilson wrote:
Yes, I don't get a useable url...
Ok, that's a little more helpful but I only get an IP adress not a url?
What information is there in 'a url' that is not present in the IP address and port number? For example, is there ever any more information in 'a url' used for streaming than
http://<ip address>:<port>
? (Asking as much for my education as anything) Does it ever appear in the form
http://<ip address>:<port>/directories/file
or something? Are you trying to use the recovered url in an automated way? If not, you can readily synthsize the url you want from the data in netstat - -pn, either by hand or with a small bash script.
- -Andy
I've had limited exposure to unix/linux over the years. I've installed FC1 about a million times lately (don't ask) and finally think I've settled on a configuration with KDE that works quite nicely for me.
I have a VFAT partition that I use with Win2k that I have made available under linux by adding:
/dev/hda5 /mnt/win2k VFAT default 0 0
to my /etc/fstab file (I'm typing from memory, but you get the picture if there is a typo above). I can read and write to the drive, no problem.
However, I downloaded some files .java from the 'net, saved them to my home directory (/home/trevor) and then tried to drag and drop them from my linux partition to the aforementioned /mnt/win2k partition. KDE and/or linux didn't like that.
I logged out and back in as root and tried again and got some more refusal from KDE. I tried setting all the permissions for the files I wanted to move and dragged again and more or less got what I wanted, but also got a warning. It was all sort of confusing so, my question:
Is there any particular "trick" to moving files between my win2k and linux partitions? Should I need to be root to do so? Do permissions need to be set on a per-file basis? Is the line in my /etc/fstab file correct?
Thanks.
Trevor,
I do something similar with a USB disk. I found the following incantation for /etc/fstab line works for me:
/dev/sda1 /flip2disk vfat uid=500,codepage=850,umask=0,gid=500,shortname=winnt,iocharset=iso8859-15,conv=auto,check=relaxed,posix 0 0
You will of course, need to change the UID/GID values to match your own account details. For more details look at the man page for the mount command.
Hope this helps.
Alan D
On Monday 01 Dec 2003 4:49 pm, Trevor Smith wrote:
I've had limited exposure to unix/linux over the years. I've installed FC1 about a million times lately (don't ask) and finally think I've settled on a configuration with KDE that works quite nicely for me.
I have a VFAT partition that I use with Win2k that I have made available under linux by adding:
/dev/hda5 /mnt/win2k VFAT default 0 0
to my /etc/fstab file (I'm typing from memory, but you get the picture if there is a typo above). I can read and write to the drive, no problem.
However, I downloaded some files .java from the 'net, saved them to my home directory (/home/trevor) and then tried to drag and drop them from my linux partition to the aforementioned /mnt/win2k partition. KDE and/or linux didn't like that.
I logged out and back in as root and tried again and got some more refusal from KDE. I tried setting all the permissions for the files I wanted to move and dragged again and more or less got what I wanted, but also got a warning. It was all sort of confusing so, my question:
Is there any particular "trick" to moving files between my win2k and linux partitions? Should I need to be root to do so? Do permissions need to be set on a per-file basis? Is the line in my /etc/fstab file correct?
Thanks.
Am Mon, den 01.12.2003 schrieb Trevor Smith um 17:49:
I have a VFAT partition that I use with Win2k that I have made available under linux by adding:
/dev/hda5 /mnt/win2k VFAT default 0 0 However, I downloaded some files .java from the 'net, saved them to my home directory (/home/trevor) and then tried to drag and drop them from my linux partition to the aforementioned /mnt/win2k partition. KDE and/or linux didn't like that.
my settings:
/dev/hda5 /mnt/daten vfat defaults,user 0 0 ^^^^ allow all user write thats work fine.
gerry
Nick Wilson wrote:
Thanks, I'll try it. I did try 'netstat' but it just gives me unusable data...
The data isn't completely unusable. It should (or can, based on its options) give you the inode of each socket. You can look under /proc/<pid>/fd for a processes sockets and their inodes, then correlate the two data sets.
That's basically what lsof does for you automatically, but it's probably worth understanding the relationship of the two sets of data.
Trevor Smith wrote:
I have a VFAT partition that I use with Win2k that I have made available under linux by adding:
/dev/hda5 /mnt/win2k VFAT default 0 0
'ls -l' should show you that only the root user can write to that disk given those mount options. Others have suggested alternatives that may help you. If you're not really using "default" (and maybe you're not since you say you can read and write to the drive...), then you might have another issue.
However, I downloaded some files .java from the 'net, saved them to my home directory (/home/trevor) and then tried to drag and drop them from my linux partition to the aforementioned /mnt/win2k partition. KDE and/or linux didn't like that.
You should always get some error message which is more descriptive than "linux didn't like that".
One problem you may run in to, which I did, is that Windows may somehow mark the local user "home directories" as unwritable. I don't understand how, but I had a VFAT fs with Win2k where I could write to any part of the disk except "/Documents and Settings". No file or folder under there could be modified by any user under Linux, including root.
You might just need to save your files to some other folder.
On Mon, 01 Dec 2003 21:23:56 -0800, Gordon Messmer wrote:
Trevor Smith wrote:
I have a VFAT partition that I use with Win2k that I have made available under linux by adding:
/dev/hda5 /mnt/win2k VFAT default 0 0
'ls -l' should show you that only the root user can write to that disk given those mount options. Others have suggested alternatives that may help you. If you're not really using "default" (and maybe you're not since you say you can read and write to the drive...), then you might have another issue.
Damn. :-(
I just went and played with it again and sure enough, user "trevor" can not mv a file from his home directory to /mnt/win2k.
I logged out, logged in as root, changed the fstab line to say:
/dev/hda5 /mnt/win2k vfat defaults,users 0 0
I logged out and back in as 'trevor' and this what I got when I tried to move a file from the command line:
[trevor@localhost trevor]$ ls -la EnumerExample.java -rw-rw-r-- 1 trevor trevor 647 Dec 2 08:43 EnumerExample.java [trevor@localhost trevor]$ mv EnumerExample.java /mnt/win2k/ mv: cannot create regular file `/mnt/win2k/EnumerExample.java': Permission denied [trevor@localhost trevor]$
So, linux won't give me permission to write to /mnt/win2k.
What do I set in fstab so that it *will*?
Bizarrely, dragging and dropping the file while logged in as root causes a pop-up error message to be displayed (it says I don't have permission) but the file IS moved (but only when logged in as root).
One problem you may run in to, which I did, is that Windows may somehow mark the local user "home directories" as unwritable. I don't understand how, but I had a VFAT fs with Win2k where I could write to any part of the disk except "/Documents and Settings". No file or folder under there could be modified by any user under Linux, including root.
You might just need to save your files to some other folder.
No, I'm trying to copy/mv/write to the root directory on the vfat partition.
Of course, it's a FAT32 partition. Is that the same as "VFAT"? Or might I be running into some problem because VFAT != FAT32 ?
When I had Gnome installed, I had the option to reboot/shutdown/logout with one click only, right from the Gnome panel.
I am now using KDE and prefer to continue using it. However, KDE's "logout" button seems to only allow me one choice: log out. After I have logged out, I can select reboot or shut down from the general login screen.
How can I shut down the machine or reboot with only one step, right from KDE?
On Tue, 2003-12-02 at 08:56, Trevor Smith wrote:
How can I shut down the machine or reboot with only one step, right from KDE?
I have two buttons on the panel. One executes the command "reboot"; the other "poweroff." I'm sure that there are many ways to do this. --------- Quality Management - A Commitment to Excellence
Am Di, den 02.12.2003 schrieb Trevor Smith um 14:56:
How can I shut down the machine or reboot with only one step, right from KDE?
You can do so If you use KDE instead of GDM.
Add this line to /etc/sysconfig/desktop:
DISPLAYMANAGER="KDE"
restart X.
Christoph
Am Di, den 02.12.2003 schrieb Trevor Smith um 14:53:
Damn. :-(
[SNIP]
So, linux won't give me permission to write to /mnt/win2k.
What do I set in fstab so that it *will*?
/dev/hda5 /mnt/win2k vfat defaults,utf8,gid=1000,uid=1000 0 0 ^^^^^^^^^^^^^^^^^
(if trevor is uid 1000)
Christoph
/dev/hda1 /mnt/windows ntfs umask=0222,uid=sesso,gid=sesso
thats what i wrote ... i havent found out if it worked yet
On Tue, 2003-12-02 at 06:53, Trevor Smith wrote:
On Mon, 01 Dec 2003 21:23:56 -0800, Gordon Messmer wrote:
Trevor Smith wrote:
I have a VFAT partition that I use with Win2k that I have made available under linux by adding:
/dev/hda5 /mnt/win2k VFAT default 0 0
'ls -l' should show you that only the root user can write to that disk given those mount options. Others have suggested alternatives that may help you. If you're not really using "default" (and maybe you're not since you say you can read and write to the drive...), then you might have another issue.
Damn. :-(
I just went and played with it again and sure enough, user "trevor" can not mv a file from his home directory to /mnt/win2k.
I logged out, logged in as root, changed the fstab line to say:
/dev/hda5 /mnt/win2k vfat defaults,users 0 0
I logged out and back in as 'trevor' and this what I got when I tried to move a file from the command line:
[trevor@localhost trevor]$ ls -la EnumerExample.java -rw-rw-r-- 1 trevor trevor 647 Dec 2 08:43 EnumerExample.java [trevor@localhost trevor]$ mv EnumerExample.java /mnt/win2k/ mv: cannot create regular file `/mnt/win2k/EnumerExample.java': Permission denied [trevor@localhost trevor]$
So, linux won't give me permission to write to /mnt/win2k.
What do I set in fstab so that it *will*?
Bizarrely, dragging and dropping the file while logged in as root causes a pop-up error message to be displayed (it says I don't have permission) but the file IS moved (but only when logged in as root).
One problem you may run in to, which I did, is that Windows may somehow mark the local user "home directories" as unwritable. I don't understand how, but I had a VFAT fs with Win2k where I could write to any part of the disk except "/Documents and Settings". No file or folder under there could be modified by any user under Linux, including root.
You might just need to save your files to some other folder.
No, I'm trying to copy/mv/write to the root directory on the vfat partition.
Of course, it's a FAT32 partition. Is that the same as "VFAT"? Or might I be running into some problem because VFAT != FAT32 ?
Trevor Smith wrote:
I logged out, logged in as root, changed the fstab line to say:
/dev/hda5 /mnt/win2k vfat defaults,users 0 0
The option should be "user" not "users".
I logged out and back in as 'trevor' and this what I got when I tried to move a file from the command line:
...
mv: cannot create regular file `/mnt/win2k/EnumerExample.java': Permission denied
The "user" only has permission to write to the disk if he mounted it. Fix your fstab option, unmount the drive, log in as "trevor" and mount the drive as that user. You will then be able to write to it.
Bizarrely, dragging and dropping the file while logged in as root causes a pop-up error message to be displayed (it says I don't have permission) but the file IS moved (but only when logged in as root).
The access failure occurs because your file manager is trying to preserve permissions. It copies the file (which is fine), then tries to set the user/group and permissions on the new file which can't be done. vfat doesn't store file owner/group or permissions.
Of course, it's a FAT32 partition. Is that the same as "VFAT"? Or might I be running into some problem because VFAT != FAT32 ?
Nope. vfat == fat32
On Tue, 02 Dec 2003 21:49:38 -0800, Gordon Messmer wrote:
The "user" only has permission to write to the disk if he mounted it. Fix your fstab option, unmount the drive, log in as "trevor" and mount the drive as that user. You will then be able to write to it.
Thanks, that is the trick. I wanted to have it automounted but instead I just created a new disc object on my desktop and that does all the auto-mounting for me. Just as good.
The access failure occurs because your file manager is trying to preserve permissions. It copies the file (which is fine), then tries to set the user/group and permissions on the new file which can't be done. vfat doesn't store file owner/group or permissions.
Right! Thanks for the explanation. That alleviates my worry about what was going wrong.
On Wednesday December 3, 2003 "Trevor Smith" trevor@haligonian.com wrote:
On Tue, 02 Dec 2003 21:49:38 -0800, Gordon Messmer wrote:
The "user" only has permission to write to the disk if he mounted it. Fix your fstab option, unmount the drive, log in as "trevor" and mount the drive as that user. You will then be able to write to it.
Thanks, that is the trick. I wanted to have it automounted but instead I just created a new disc object on my desktop and that does all the auto-mounting for me. Just as good.
The access failure occurs because your file manager is trying to preserve permissions. It copies the file (which is fine), then tries to set the user/group and permissions on the new file which can't be done. vfat doesn't store file owner/group or permissions.
Right! Thanks for the explanation. That alleviates my worry about what was going wrong.
Trevor,
There is also a "users" option for /etc/fstab that should allow you to use automount. Like "loop", "users" is [badly] documented in 'man mount', and the stock colorization file for vim will make you think it's not legal. It is.
--Doc Savage Fairview Heights, IL