>\root\sandeep\log111.txt
>This files has a lot of text and one particulr line is .....
>##Date 24-07-2001
>
>Now
>1. I need to locate the line "##Date" in the above file
>2. I then need to store the date value "24-07.2001" in a variable.
Which language you are using? I assume Perl, because this is much simpler in
Perl.
1. Open the file for reading.
2. Search for the above string by reading every line. $_ variable
contains the current line. You can do this by using pattern searching
operations in Perl.
3. Once you find the above line then split that line at spaces and collect
the required date in a variable.
Here is the code which I would prefer to write.
open(RH,"</root/sandeep/log111.txt");
while(<RH>)
{
if($_ =~ /##Date/)
{
$flag = 1;
}
else
{
$flag = 0;
}
if($flag eq 1)
{
($str1, $str2) = split(/ /, $_);
$date = $str2;
}
}
Hope this is very much clear.
Regards,
Mayur
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Here's the situation:
Net DSL Windowsbox LAN(dhcp) Linuxbox
The LAN, naturally, has a 192.168.0.0 range of IPs (I think it's a
class C). The DSL modem is connected to the Winbox on USB and the LAN
is a 5-port hub supporting a windows network, with my Linux box (say
hello to gort, folks) creeping in using dhcpd.
The Linux box, and any box on the LAN, can access everything. I think
the Net cannot access anything but the Windows box on the DSL modem
(see <http://gort.cjb.net/>. That's the Winbox.).
Now I need POP3 (and HTTP et al, if possible) access to the Linux box
from the outside world. IP forwarding is enabled on the Winbox.
What do I do now?
PS: Can I get a static IP on the internal network with minimal changes
to the other boxen?
--
Satya. <URL:http://satya.virtualave.net/>
US-bound grad students! For pre-apps, see <URL:http://quickapps.cjb.net/>
Hi there,
is packetstorm.securify.com down ?
i am unable to access it from many days ...
does any1 know of a similar site like packetstorm....?
cheers~
</shahazad>
--
Get your firstname@lastname email for FREE at http://Nameplanet.com/?su
>which mail servers do you guys suggest one should use? I have heard good
>things about qmail, but it requires a static ip. Exim isnt very popular and
>sendmail is a tad bit scary for me... anyone else got any suggestions?
I have used qmail and found out to be good. Others I haven't tried. Lot of
info is available on qmail all over. Any mail server if it has to be live
will need a static ip. I heard Exim is the one which can be configured as a
smarthost, if you do not have static ip.
Regards,
Mayur
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
Hi all,
been trying to mount linux on a windows fat32.
lilo didnt get installed so using loadlin.
loadlin c:\vmlinuz root=/dev/loop0
doesnt seem to work and linux isnt booting.
issues a kernel panic error.
even when i try to use this
loadlin c:\vmlinuz root=/dev/hdax
where x is 1 to 8 all combinations...
same error message
any suggestions.
thanks,
Prem.
hi
i am using sendmail with fetchmail with procmail and pine......for my mail
system on my linux box.
1.> Inspired by Philip's SMTP howto....i tried the following:
i telnetted the port 25 on localhost......and tried to mail a message
to my login....that's "abhije"
now,i understand that the sendmail daemon identifies me as
abhije@localhost(when i telnet the port 25)-- i get
"IDENT:abhije@localhost.localdomain" as part of the response to
HELO.
when i say......
MAIL FROM:someone@some.other.domain
....it responds that the sender's address should resolve.....what
does that mean???
i thought because it sends mail ......it should accept all sender
addresses!!!
At the same time.....if i say
MAIL FROM:some_other_login_on_my_linuxbox@localhost
the mail is sent....even if "some_other_login_on_my_linuxbox" knows
nothing about it!!!
my argument is that if it knows that i am abhije@localhost...and
hence does not accept someone@some.other.domain....how does it accept mail
from some_other_login???
i am new to sendmail..and smtp..could somebody help????
i know i could use something less scarier than sendmail.....but i
need to know what's happening here......
2.> Also is there some other mail client that has the address book
facility???....i just need a break from pine.....
3.>I also have a yahoo inbox.....but the yahoo server doesn't flush the
mail when polled!!!!
could somebody explain that???? (yes..i have registered for pop3
access)
bye
abhijeet
Dear All,
I plugged an External HP DAT drive into redhat linux 6.2 box on Adaptec SCSI Controller.
After restarting the server I used dmesg to see whether SCSI card and drive are detected .. but could not find it there. Kudzu was able to detect the Card and the hwconf shows the entries as below.
class: SCSI
bus: PCI
detached: 0
driver: aic7xxx
desc: "Adaptec|AHA-2940U2/W"
vendorId: 9005
deviceId: 0010
pciType: 1
After rebooting the computer again I could not find st0 in dmesg.
The SCSI Configuration utility was able to detect the DAT Drive SCSI Controller ID:7 and DAT Drv ID:8.
Can somebody pls help me to configure this thing.
Regards
lilo
Mandrake 8.1 is out, includes XFS, ReiserFS and Ext3. Gnome 1.4.1 and
KDE 2.2.1 (with antialiased fonts). Good for new users as well as
experienced ones. Good for servers as well as desktops. Someone should
give it a try.
ISO from here: http://www.linux-mandrake.com/en/ftp.php3
Philip
--
"I got everybody to pay up front...then I blew up their planet."
"Now why didn't I think of that?"
-- Post Bros. Comics
Visit my webpage at http://www.ncst.ernet.in/~philip/
Read my writings at http://www.ncst.ernet.in/~philip/writings/
MSN philiptellis Yahoo! philiptellis
AIM philiptellis ICQ 129711328
Thanx for the info mahesh,
well i have coupla things more to clear up,
[1] do i have to enable ip_forwaring in /proc
[2] what should be in the dns of the win98 client.
thanx in advance
cheers~
</shahazad>
The iptables rule for transparent proxy is
#/sbin/iptables -t nat -A POSTROUTING -s 192.168.0.0/255.255.255.0 -o eth1 -j
MASQUERADE
in the above rule 192.168.0.0 is the local network and
255.255.255.0 is subnet.
-o eth1 option specifies the external interface which connects your proxy
server/gateway to the internet.for me it is eth1.for you it might be ppp0 if
you are using dialup.
Enable routing on the Server.
Add the IP of your proxy server as gateway in the network properties of the
Windows machine.That's it.
reply back if have any relative problem.
Mahesh Gharat
mahesh_gharat(a)rediffmail.com
On Thu, 27 Sep 2001 shahazad(a)linuxplanet.nu wrote :
> hi buddies,
> i need help for setting up a transparent proxy...i want
> to use iptables. can u
> please send me the rules, and also the setting that are
> to be made on the linux
> box and on the windows client. i cant get yahoo chat to
> work on it as well.
>
> Also do send me some links/urls about the same ..
>
> thanx
> cheers~
> </shahazad>
>
--
Get your firstname@lastname email for FREE at http://Nameplanet.com/?su