Re: sgml or latex?

2002-02-12 Thread darrell dupas
also worth noting is the LaTeX word processor called LyX, which also 
supports DocBook export and several generic tex styles


it can produce pdf and if you export to docbook sgml you can still use 
those tools too


lyx is still a little unstable in woody, if you open the user manual as 
anyone other than root it crashes, but seems fairly stable otherwise, 
also, though i havent submitted the report yet, you have to set up 
symlinks to get the spell checker to work, and modify some permissions 
on symlink / folder to get the pdf export to work - i have a feeling the 
developers test as root, hopefully these minor problems dont affect you




dd



Re: Help with Expect & Xterm

2002-02-16 Thread darrell dupas

#!/usr/bin/expect --
# page 294 oriley expect

set send_slow { 1 .001 }
set prompt "(%|#|\\\$)"
set shell $env(SHELL)

#proc open_xterm_shell {} {
#global shell


# in order to talk to an xterm expect must obtain a pty and pass it to 
the xterm

spawn -pty
# the variable $spawn_out(slave,name) is the descriptor needed by expect
# the first spawn command has an open file descriptor assosiated with it
# where chars are sent to, we need to pass this to xterm, 
spawn_out(slave,fd)


# the pty must be initialized to raw mode and have echo off
stty raw -echo < $spawn_out(slave,name)

#hack to twart some vendors descision to pad xterm dev name
#sorta like split in other lang
regexp ".*(.)(.)" $spawn_out(slave,name) dummy c1 c2
# if first char is a slash change it to a zero
if {[string compare $c1 "/"] == 0} {
   set c1 "0"
}


# because there is a spawn above waiting to attach use exec
# pass the xterm the fd to read from
exec xterm -S$c1$c2$spawn_out(slave,fd) &

# there are 2 programs with the slave fd open expect and xterm, expect 
doesnt

# need its open anymore

close -slave

#discard xterm window id

set xterm $spawn_id
set xterm_pty $spawn_out(slave,name)
expect "\n"
spawn "$shell"
#}


#open_xterm_shell
#run a shell
spawn "telnet"
expect "telnet>"
send -s "open localhost\r"
sleep 5
set tries 0
while {$tries < 5} {
   send_user "hello $tries dip shit"
   expect {
   "login:" { send -s "mp3\r" }  
   "assword:" { send -s "mp3\r" } 
   "Last login" { break }

   }
   incr tries
}
send_user "login success"   
interact -u xterm



--
comments: uh, this doesnt open 3 terminals, i got sick of some strange 
behavior, it opens one teminal, and is kinda flakey, but it is expect 
controling and xterm , btw, buy the orielly book, it is fairly good


darrell



[EMAIL PROTECTED] wrote:


On Wednesday 13 February 2002  9:46 pm, Cameron Kerr wrote:


On Wed, 13 Feb 2002, Jay Mallar wrote:


spawn telnet 
sleep 5
send "login "
sleep 5
send ""


Look at the docs (man expect) for log_user, and interact


Starting up three xterms isn't a problem, but automating the logins is..


Is there any reason you can't do it the right way and use ssh, with
ssh-agent?

Cameron Kerr



Thanks Cameron - after another day with the man page, I figured it out - and 
pointing me to log_user and interact again did some good.


Thanks!







Re: Help with Expect & Xterm

2002-02-17 Thread darrell dupas
so the last attempt was a learning process, if you tried it you may have 
had *very* hit and miss success, plus general weirdness, the script i 
have attached is a little better, i woke up this morning thinking, hmm, 
i should not learn at other peoples expence and perhaps i should give a 
second effort, it was late after all, so, here is an expect script that 
opens 3 xterms, runs telnets, and exits, while leaving the telnets open 
-  xterm -e would have been easier :)



darrrell dupas
[EMAIL PROTECTED]


#!/usr/bin/expect --
# try this

proc open_xterm {} {
   global xterm_spawnid
   global shell
   spawn -pty
   stty raw -echo < $spawn_out(slave,name)
   regexp ".*(.)(.)" $spawn_out(slave,name) dummy c1 c2
   if {[string compare $c1 "/"] == 0} {
   set c1 "0"
   }
   exec xterm -S$c1$c2$spawn_out(slave,fd) &
   close -slave
   set xterm_spawnid $spawn_id
   set xterm_pty $spawn_out(slave,name)
   expect "\n"
   spawn "$shell"
}

#open_telnet procedure is dependant on xterm_spawnid -- should do a check

proc open_telnet { hostname loginname password } {
global xterm_spawnid
#spawn "telnet"
spawn "telnet"
set telnet_spawnid $spawn_id
expect "telnet>"
send -s "open $hostname\r"
   expect {
   "login:" { send -s "$loginname\r" }  
   }

   expect {
   "assword:" { send -s "$password\r" }
   }
interact -u xterm_spawnid
}


set send_slow { 1 .001 }
set prompt "(%|#|\\\$)"
set shell $env(SHELL)
set xterm_spawnid 0


set fork_pid [fork]
if { $fork_pid == 0 } {
   disconnect
   open_xterm
   open_telnet localhost mp3 mp3
} else {
   set fork_pid [fork]
   if { $fork_pid == 0 } {
   disconnect
   open_xterm
   open_telnet localhost ddupas lighter
   } else {
   set fork_pid [fork]
   if { $fork_pid == 0 } {
   disconnect
   open_xterm
   open_telnet localhost bad bad
   }
   }
}


exit



Re: Script that when when you login

2002-02-25 Thread darrell dupas

[EMAIL PROTECTED] wrote:


Hi all,

I have added a command to run a xterm to my .xsession just in case I
hose my settings to the point where that xterm will be all that stands
between me and disaster.

I have anumber of less urgent requirements that I would like to happen
in the background whenever I boot.  For example, galeon -s creates a
galeon server enabling galeon to load faster.  Having evolution running
in the background would be useful.  I have Windows shares that I would
like to mount through this script.

If I create a little script that does all these things, where should I
put it?  .bashrc? .xsession?

Thanks in advance.

Patrick




.xsession is the file where i start my window manager, and run any programs,
note the last line of  ~/.xsession should be your window manager and should
use exec

exec wmaker

though, this may just be correct for me because i use xdm - man X - will 
provide

this information

i cant confirm anything right now because i am stranded on a public computer

btw, i dont think you have to worry about this impending disaster, if 
you are

having troubles with X i suggest not using a desktop manager or a window
manager so that you can bring everything up one step at a time, this way
you can see where the problem is

ie/
alt+ctrl+f1
killall gdm
killall xdm
X &
alt+ctrl+f1

xterm -display :0 &
wmaker --display :0 &


i give this tip all the time because i find xdm and gdm annoying when 
trying to configure X



darrell






Re: ip forwarding under 2.2.17

2002-02-26 Thread darrell dupas
hi there, i dont use ssh, BUT, i was getting timeout problems when i 
masqed an oracle database, oracle uses port 1521, and similar to you we 
were loosing connections when we went through the ipchains firewall, the 
solution was to set the timeout - i have included the ipchains rules 
here just for completeness, you will put your ports and ip's in of 
course - hope this helps


darrell
[EMAIL PROTECTED]

#!/bin/sh
echo DMZ

modprobe ip_masq_mfw

ipchains -I input -p tcp -y -d 161.184.137.127/32 1521 -m 1521
ipchains -I input -p tcp -y -d 192.168.1.1/32 1521 -m 1521
ipmasqadm mfw -A -m 1521 -r 192.168.222.222 1521

#Set timeouts to 2 hours, instead of default 15 minutes.
/sbin/ipfwadm -M -s 7200 10 60


[EMAIL PROTECTED] wrote:


I have a firewall with two network cards running Sid with kernel 2.2.17. I
have the following rule:

/usr/sbin/ipmasqadm portfw -a -P tcp -L $IP_REAL 22 -R $MAGNETO 22

And it works fine. IP_REAL is the dhcp granted IP from my ISP, MAGNETO is
the ssh server behind the firewall, and MYSTIQUE is the internal IP of the
firewall. When I try the following rule:

/usr/sbin/ipmasqadm portfw -a -P tcp -L $MYSTIQUE 22 -R $MAGNETO 22

I get timeout errors from ssh. With no rule, when trying to ssh to IP_REAL
from inside the firewall, I get timeout errors.

I'm trying to have an ssh request to kwiqsilver.org forward to magneto both
externally (which works) and internally, so I can access the CVS server with
my notebook inside or outside.
Is there a way to get this to work better? Would I be better off upgrading
to 2.4 to use the newer firewalling system?

Thanks,
Jason