Re: identifying my network address

2003-03-09 Thread Tim Aslat
In the immortal words of David Banning [EMAIL PROTECTED]...
 I wasn't clear enough. I need to get the IP address in -unix-. 

Try looking at your environment variables

SSH_CLIENT='xxx.xxx.xxx.xxx 1220 22'
SSH_TTY=/dev/ttyp1


-- 
| The most exciting phrase to   | Tim Aslat [EMAIL PROTECTED] |
| hear in science, the one that | http://www.spyderweb.com.au  |
| heralds new discoveries, is   | Spyderweb Consulting |
| not Eureka! (I found it!)   | P: 82270800M: 0401088479 |
| but That's funny ...| Webmaster for|
|  -- Isaac Asimov  | http://www.goodiesruleok.com |
| No, Eureka is Greek for | The Ultimate Goody Fansite   |
| This bath is too hot!| [EMAIL PROTECTED]  |
|   -- Dr Who   |  |

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Tim Aslat
In the immortal words of Tim Aslat [EMAIL PROTECTED]...
 Try looking at your environment variables
 
 SSH_CLIENT='xxx.xxx.xxx.xxx 1220 22'
 SSH_TTY=/dev/ttyp1

Sorry, I should have been more specific, this is the ENV variables from
my server that I'm logged into via SSH showing the source (workstation)
address and port where
xxx.xxx.xxx.xxx client IP (x-server)  
1220 client port number 
22 host port number

Cheers

Tim

-- 
| The most exciting phrase to   | Tim Aslat [EMAIL PROTECTED] |
| hear in science, the one that | http://www.spyderweb.com.au  |
| heralds new discoveries, is   | Spyderweb Consulting |
| not Eureka! (I found it!)   | P: 82270800M: 0401088479 |
| but That's funny ...| Webmaster for|
|  -- Isaac Asimov  | http://www.goodiesruleok.com |
| No, Eureka is Greek for | The Ultimate Goody Fansite   |
| This bath is too hot!| [EMAIL PROTECTED]  |
|   -- Dr Who   |  |

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Michael Collette
David Banning wrote:

 I am running an Xwindow on a windows box. I need a script to
 tell me what my network address is so that I can set my DISPLAY
 varible correctly eg: 192.168.1.2:0.0
 
 Any idea what command would be useful for this purpose?

It's ugly.  It won't work if you multiple NICs.  It may just work for what you 
need just the same.

echo `ifconfig | grep broadcast | cut -d  -f2`:0.0

This takes the output of ifconfig and parses it just a wee bit with grep and 
cut.  I use something very similar to this in a script that changes my 
network settings for my laptop on the fly.

Let me know if this works for ya.

Later on,
-- 
Outside of a dog, a book is man's best friend. Inside of a dog, it's too dark 
to read.
 - Groucho Marx

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread David Banning
On Sun, Mar 09, 2003 at 09:30:22PM -0800, Michael Collette wrote:
 David Banning wrote:
 
  I am running an Xwindow on a windows box. I need a script to
  tell me what my network address is so that I can set my DISPLAY
  varible correctly eg: 192.168.1.2:0.0
  
  Any idea what command would be useful for this purpose?
 
 It's ugly.  It won't work if you multiple NICs.  It may just work for what you 
 need just the same.
 
 echo `ifconfig | grep broadcast | cut -d  -f2`:0.0
 
 This takes the output of ifconfig and parses it just a wee bit with grep and 
 cut.  I use something very similar to this in a script that changes my 
 network settings for my laptop on the fly.
 
 Let me know if this works for ya.

Nope. ifconfig by itself does not contain the address at all, anywhere;

dc0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
inet 192.168.1.1 netmask 0xff00 broadcast 192.168.1.255
inet6 fe80::220:78ff:fe0e:13d6%dc0 prefixlen 64 scopeid 0x1 
ether 00:20:78:0e:13:d6
media: Ethernet autoselect (10baseT/UTP)
status: active
rl0: flags=8843UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST mtu 1500
inet 209.188.66.29 netmask 0xff00 broadcast 209.188.66.255
inet6 fe80::248:54ff:fe8c:13e5%rl0 prefixlen 64 scopeid 0x2 
ether 00:48:54:8c:13:e5
media: Ethernet autoselect (10baseT/UTP)
status: active
lp0: flags=8810POINTOPOINT,SIMPLEX,MULTICAST mtu 1500
sl0: flags=c010POINTOPOINT,LINK2,MULTICAST mtu 552
faith0: flags=8002BROADCAST,MULTICAST mtu 1500
lo0: flags=8049UP,LOOPBACK,RUNNING,MULTICAST mtu 16384
inet6 ::1 prefixlen 128 
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x6 
inet 127.0.0.1 netmask 0xff00 
ppp0: flags=8010POINTOPOINT,MULTICAST mtu 1500
tun0: flags=8051UP,POINTOPOINT,RUNNING,MULTICAST mtu 1492
inet 209.188.66.29 -- 206.221.248.4 netmask 0x 
Opened by PID 6716

Thanks anyway -

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Viktor Lazlo


On Sun, 9 Mar 2003, Michael Collette wrote:

 It's ugly.  It won't work if you multiple NICs.  It may just work for what you
 need just the same.

 echo `ifconfig | grep broadcast | cut -d  -f2`:0.0

 This takes the output of ifconfig and parses it just a wee bit with grep and
 cut.  I use something very similar to this in a script that changes my
 network settings for my laptop on the fly.

All you need to do to deal with multiple NICs is specify which interface
you want to poll.  Awk can also combine the actions of both grep and cut
in the example into a single process:

echo `ifconfig xl0 | awk '/broadcast/ { print $2:0.0 }'`

Cheers,

Viktor



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Adam Maas
Nope, Your display variable must be set to the IP or hostname of the X
Server, which in this case is the Windows machine. X mangles the
client/server difference, since the box displaying teh window is teh Server
(And specified via DISPLAY) while the remote system running the apps is the
client.

To use XWin32 (Ditch it, it's very buggy, eXceed is far superior), you need
to set your DISPLAY variable on the Unix host running the apps to:
windowsboxip:0

Adam

- Original Message -
From: David Banning [EMAIL PROTECTED]
To: Adam Maas [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, March 09, 2003 10:23 PM
Subject: Re: identifying my network address


 On Sun, Mar 09, 2003 at 09:26:51PM -0500, Adam Maas wrote:
  run ipconfig or winipcfg (The former for NT/2k/XP, the latter for
95/98/Me)
 I wasn't clear enough. I need to get the IP address in -unix-.

 
  Adam
 
  - Original Message -
  From: David Banning [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Sunday, March 09, 2003 9:11 PM
  Subject: identifying my network address
 
 
   I am running an Xwindow on a windows box. I need a script to
   tell me what my network address is so that I can set my DISPLAY
   varible correctly eg: 192.168.1.2:0.0
  
   Any idea what command would be useful for this purpose?
  
  
  
   To Unsubscribe: send mail to [EMAIL PROTECTED]
   with unsubscribe freebsd-questions in the body of the message
  

 --

 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-questions in the body of the message



To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Daxbert
Quoting David Banning [EMAIL PROTECTED]:

 I am running an Xwindow on a windows box. I need a script to 
 tell me what my network address is so that I can set my DISPLAY
 varible correctly eg: 192.168.1.2:0.0   
 
 Any idea what command would be useful for this purpose?
 

DISPLAY=`who -m | awk '{print $6}' | sed -e 's/[(|)]//g'`:0.0

give that a shot...  

I'm sure there's a shorter, cleaner way...but it works.


--daxbert




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Viktor Lazlo


On Sun, 9 Mar 2003, David Banning wrote:

 I am running an Xwindow on a windows box. I need a script to
 tell me what my network address is so that I can set my DISPLAY
 varible correctly eg: 192.168.1.2:0.0

 Any idea what command would be useful for this purpose?

If I understand correctly and you want to identify the IP address the
Windows box is using while you are at that computer try entering either of
the commands from at a DOS
prompt:

arp -a | find Interface

or

ipfconfig | find IP

Cheers,

Viktor




To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread David Banning
On Sun, Mar 09, 2003 at 07:48:54PM -0800, Daxbert wrote:
 Quoting David Banning [EMAIL PROTECTED]:
 
  I am running an Xwindow on a windows box. I need a script to 
  tell me what my network address is so that I can set my DISPLAY
  varible correctly eg: 192.168.1.2:0.0   
  
  Any idea what command would be useful for this purpose?
  
 
 DISPLAY=`who -m | awk '{print $6}' | sed -e 's/[(|)]//g'`:0.0

Nope. That give the IP of the server to the outside world;

What who gives me is the name of the machine, but that seems to work;
CHANTELLE:0.0

I guess becuase it looks it up in /etc/hosts

thanks -

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread David Banning
On Sun, Mar 09, 2003 at 10:29:38PM -0500, Adam Maas wrote:
 Nope, Your display variable must be set to the IP or hostname of the X
 Server, which in this case is the Windows machine. X mangles the
 client/server difference, since the box displaying teh window is teh Server
 (And specified via DISPLAY) while the remote system running the apps is the
 client.
I got it. Daxbert suggested the simple 'who' command which I knew
before, but discarded becuase it gave me the win machine -name-,
but of course to unix, it knows what the IP is and looks it up;

$ who
dale ttyp0   Mar  7 17:35   (192.168.1.3:0.0)
davidttyp2   Mar  9 23:29   (CHANTELLE:0.0)
davidttyp3   Mar  9 21:07   (CHANTELLE:0.0)
davidttyp4   Mar  9 21:46   (CHANTELLE:0.0)
chantellettyp5   Mar  9 23:25   (CHANTELLE:0.0)
chantellettyp7   Mar  9 23:25   (CHANTELLE:0.0)

In my case I had five freebsd windows running on CHANTELLE under two 
different user names.

 
 To use XWin32 (Ditch it, it's very buggy, eXceed is far superior), you need

this is -very- welcome advice, becuase you are right. It is buggy, and
I didn't know there was any quality alternatives.

thanks -

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


XServer on windows (was: Re: identifying my network address)

2003-03-09 Thread Konrad Neitzel
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi everybody!

David Banning wrote:

  To use XWin32 (Ditch it, it's very buggy, eXceed is far superior),
  you need

 this is -very- welcome advice, becuase you are right. It is buggy,
 and I didn't know there was any quality alternatives.

I am using XFree with cygwin. It works fine for me, but compared with 
exeed it is missing lot of features. But: It is free. So if you want to 
get a working solution with no license fees: Try it out.

With kind regards,

Konrad

- -- 
Konrad Neitzel
Tel: 0172 / 689 31 45
Fax: 069 / 90 50 99 53
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.1 (FreeBSD)

iD8DBQE+bCMAxlHQ37B9RLMRApNPAKCDMnhzjizIjyyUaAL//+LlQMUIsgCfRACI
aOl/17YyyWYl+J7kQX1tBZc=
=XO8z
-END PGP SIGNATURE-


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Daxbert
Quoting David Banning [EMAIL PROTECTED]:

 I am running an Xwindow on a windows box. I need a script to 
 tell me what my network address is so that I can set my DISPLAY
 varible correctly eg: 192.168.1.2:0.0   
 
 Any idea what command would be useful for this purpose?

How are you connecting to the *nix box?  If you're using an SSH client, you
could just enable X11 port forwarding (on both the client and server), and let
SSH handle the DISPLAY variable assignemnt.  Not to mention, your X traffic can
then come back thru any ACLs/FW policies that might otherwise block standard
:60xx X traffic.

--daxbert

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Adam Maas
run ipconfig or winipcfg (The former for NT/2k/XP, the latter for 95/98/Me)

Adam

- Original Message - 
From: David Banning [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, March 09, 2003 9:11 PM
Subject: identifying my network address


 I am running an Xwindow on a windows box. I need a script to 
 tell me what my network address is so that I can set my DISPLAY
 varible correctly eg: 192.168.1.2:0.0   
 
 Any idea what command would be useful for this purpose?
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-questions in the body of the message
 


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread David Banning
On Sun, Mar 09, 2003 at 06:20:24PM -0800, Daxbert wrote:
 Quoting David Banning [EMAIL PROTECTED]:
 
  I am running an Xwindow on a windows box. I need a script to 
  tell me what my network address is so that I can set my DISPLAY
  variable correctly eg: 192.168.1.2:0.0   
  
  Any idea what command would be useful for this purpose?
 
 How are you connecting to the *nix box?  If you're using an SSH client, you
 could just enable X11 port forwarding (on both the client and server), and let
 SSH handle the DISPLAY variable assignment.  Not to mention, your X traffic can
 then come back thru any ACLs/FW policies that might otherwise block standard
 :60xx X traffic.

I am connecting with xwin32. I have a unix window on my winbox, but
what I want is the IP address in unix when the window comes up, so
I could simply set the variable in .profile with a 

DISPLAY=$ipaddress:0.0
export DISPLAY

I know xwin32 is capable of ssh, but I do not believe I am running it.
If it is necessary to run ssh to do it, then it might prove difficult,
because whenever I've run ssh it really slows things down and I think
that would be poor performance when I need graphics. No?

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread David Banning
On Sun, Mar 09, 2003 at 09:26:51PM -0500, Adam Maas wrote:
 run ipconfig or winipcfg (The former for NT/2k/XP, the latter for 95/98/Me)
I wasn't clear enough. I need to get the IP address in -unix-. 

 
 Adam
 
 - Original Message - 
 From: David Banning [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Sunday, March 09, 2003 9:11 PM
 Subject: identifying my network address
 
 
  I am running an Xwindow on a windows box. I need a script to 
  tell me what my network address is so that I can set my DISPLAY
  varible correctly eg: 192.168.1.2:0.0   
  
  Any idea what command would be useful for this purpose?
  
  
  
  To Unsubscribe: send mail to [EMAIL PROTECTED]
  with unsubscribe freebsd-questions in the body of the message
  

-- 

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message


Re: identifying my network address

2003-03-09 Thread Daxbert
Quoting Viktor Lazlo [EMAIL PROTECTED]:

 
 On Sun, 9 Mar 2003, Daxbert wrote:
 
  DISPLAY=`who -m | awk '{print $6}' | sed -e 's/[(|)]//g'`:0.0
 
  I'm sure there's a shorter, cleaner way...but it works.
 
 Since you're using awk anyways why not eliminate piping through sed:
 
 DISPLAY=`who -m | awk '{ print $6:0.0 }'
 

I used sed to remove the leading and trailing '(' ')' from around the hostname/ip.

They do need to be removed, right?

--dax

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-questions in the body of the message