Re: [CentOS] Server unresponsive until reboot, memory exhausted

2010-12-30 Thread David Sommerseth
On 29/12/10 17:06, cpol...@surewest.net wrote:
> On 12/28/2010 01:41 PM, james wrote:
>> You may be right about the restart, but I would like to know WHAT is
>> crashing my web server regardless. We are not running any shiftily
>> coded sites or apps on this server that I'm aware of (obviously
>> something is shifty!). Is anyone aware of any other methods for
>> drilling into the problem?
>
> You may be dealing with a request that crashes before any data
> makes it into the logs.
>
> Here's a trick I have used (posted Feb 10, 2008 by "Phantom"
> in alt.apache.configuration):
>
> ls -l `ps -C httpd h | sed -r "s/^\s*([0-9]+) .+$/\/proc\/\\1\/cwd/"`
>
> which prints out the directory that each Apache worker thread is
> accessing. If you can narrow it down to the pid, you can use lsof to
> identify the particular file being being processed. Please keep us
> posted!

If you can track down the pid, you can easily check which file descriptors 
being in used and which files or sockets they relate to by checking the 
/prod/$PID/fd directory.


kind regards,

David Sommerseth

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] appliance to embed Centos

2010-12-30 Thread Steve Clark

On 12/29/2010 01:23 AM, Nataraj wrote:

On 12/28/2010 09:04 PM, Eero Volotinen wrote:
   

2010/12/29 John R Pierce:
 

On 12/28/10 1:55 PM, Nataraj wrote:
   

- fast enough to do openvpn encryption on WAN links ranging from 50mb
to 100mb
 

THAT is a tough requirement.


I was going to recommend the Alix boards.  they run pfSense really
nicely, and should be able to run a stripped down centos install OK.
with pfSense, you can boot from a CF card, so no HD at all.

The Alix cards use a 433-500Mhz AMD Geode ultra-low power processor, on
a 6x6 card.  they use 5 watts fully configured.

but, 100Mbit/sec SSL encryption, ouch.don't know.   you'd probably
have to benchmark that.
   

you need hardware encryption hardware or core2duo like processor ..

--
Eero
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Then the Mac mini might be what I need performancewise.  I am also
considering Dell R210's as I would really like an enterprise solution.
Anyone have any experience with Habey?
http://www.habeyusa.com/products.php?id=125#Menu=ChildMenu124 They have
a wide selection of barebones Intel Atoms, including the 1.8Ghz  Intel
D525's as well as Pentium 4's with broadcom ethernets and systems with
up to 6 ethernets.  My sense is that I will still use some of these
systems for firewall and management functions (i.e. firewalling Dell
IDRAC6 cards) even if the encryption for the vpn has to run on a faster
box.  50MB would probably be adequate.

Thank you all for your responses.

Nataraj
   

Hi,

We use the following. It has hardware encryption in the EDEN Via processor.
We were able to get 22 mbits across an ipsec tunnel using AES encryption.
This more than enough unless you have a DS3 circuit.

http://www.acrosser.com/products/detail_id_427.html



--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.cl...@netwolves.com
http://www.netwolves.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] appliance to embed Centos

2010-12-30 Thread Eero Volotinen
2010/12/30 Steve Clark :
> On 12/29/2010 01:23 AM, Nataraj wrote:
>
> On 12/28/2010 09:04 PM, Eero Volotinen wrote:
>
>
> 2010/12/29 John R Pierce :
>
>
> On 12/28/10 1:55 PM, Nataraj wrote:
>
>
> - fast enough to do openvpn encryption on WAN links ranging from 50mb
> to 100mb
>
>
> THAT is a tough requirement.
>
>
> I was going to recommend the Alix boards.  they run pfSense really
> nicely, and should be able to run a stripped down centos install OK.
> with pfSense, you can boot from a CF card, so no HD at all.
>
> The Alix cards use a 433-500Mhz AMD Geode ultra-low power processor, on
> a 6x6 card.  they use 5 watts fully configured.
>
> but, 100Mbit/sec SSL encryption, ouch.don't know.   you'd probably
> have to benchmark that.
>
>
> you need hardware encryption hardware or core2duo like processor ..
>
> --
> Eero
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>
> Then the Mac mini might be what I need performancewise.  I am also
> considering Dell R210's as I would really like an enterprise solution.
> Anyone have any experience with Habey?
> http://www.habeyusa.com/products.php?id=125#Menu=ChildMenu124 They have
> a wide selection of barebones Intel Atoms, including the 1.8Ghz  Intel
> D525's as well as Pentium 4's with broadcom ethernets and systems with
> up to 6 ethernets.  My sense is that I will still use some of these
> systems for firewall and management functions (i.e. firewalling Dell
> IDRAC6 cards) even if the encryption for the vpn has to run on a faster
> box.  50MB would probably be adequate.
>
> Thank you all for your responses.
>
> Nataraj
>
>
> Hi,
>
> We use the following. It has hardware encryption in the EDEN Via processor.
> We were able to get 22 mbits across an ipsec tunnel using AES encryption.
> This more than enough unless you have a DS3 circuit.
>
> http://www.acrosser.com/products/detail_id_427.html

IE only website :(

So, you are using padlock hw encryption on device?

--
Eero
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] appliance to embed Centos

2010-12-30 Thread Steve Clark

On 12/30/2010 07:34 AM, Eero Volotinen wrote:

2010/12/30 Steve Clark:
   

On 12/29/2010 01:23 AM, Nataraj wrote:

On 12/28/2010 09:04 PM, Eero Volotinen wrote:


2010/12/29 John R Pierce:


On 12/28/10 1:55 PM, Nataraj wrote:


- fast enough to do openvpn encryption on WAN links ranging from 50mb
to 100mb


THAT is a tough requirement.


I was going to recommend the Alix boards.  they run pfSense really
nicely, and should be able to run a stripped down centos install OK.
with pfSense, you can boot from a CF card, so no HD at all.

The Alix cards use a 433-500Mhz AMD Geode ultra-low power processor, on
a 6x6 card.  they use 5 watts fully configured.

but, 100Mbit/sec SSL encryption, ouch.don't know.   you'd probably
have to benchmark that.


you need hardware encryption hardware or core2duo like processor ..

--
Eero
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Then the Mac mini might be what I need performancewise.  I am also
considering Dell R210's as I would really like an enterprise solution.
Anyone have any experience with Habey?
http://www.habeyusa.com/products.php?id=125#Menu=ChildMenu124 They have
a wide selection of barebones Intel Atoms, including the 1.8Ghz  Intel
D525's as well as Pentium 4's with broadcom ethernets and systems with
up to 6 ethernets.  My sense is that I will still use some of these
systems for firewall and management functions (i.e. firewalling Dell
IDRAC6 cards) even if the encryption for the vpn has to run on a faster
box.  50MB would probably be adequate.

Thank you all for your responses.

Nataraj


Hi,

We use the following. It has hardware encryption in the EDEN Via processor.
We were able to get 22 mbits across an ipsec tunnel using AES encryption.
This more than enough unless you have a DS3 circuit.

http://www.acrosser.com/products/detail_id_427.html
 

IE only website :(

So, you are using padlock hw encryption on device?

   
Yes it is supported by the padlock.ko module in Centos. It can also be 
used by openssl.

/lib/modules/2.6.18-194.17.4.el5/kernel/drivers/crypto/padlock.ko

--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.cl...@netwolves.com
http://www.netwolves.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] appliance to embed Centos

2010-12-30 Thread Steve Clark

On 12/30/2010 07:34 AM, Eero Volotinen wrote:

2010/12/30 Steve Clark:
   

On 12/29/2010 01:23 AM, Nataraj wrote:

On 12/28/2010 09:04 PM, Eero Volotinen wrote:


2010/12/29 John R Pierce:


On 12/28/10 1:55 PM, Nataraj wrote:


- fast enough to do openvpn encryption on WAN links ranging from 50mb
to 100mb


THAT is a tough requirement.


I was going to recommend the Alix boards.  they run pfSense really
nicely, and should be able to run a stripped down centos install OK.
with pfSense, you can boot from a CF card, so no HD at all.

The Alix cards use a 433-500Mhz AMD Geode ultra-low power processor, on
a 6x6 card.  they use 5 watts fully configured.

but, 100Mbit/sec SSL encryption, ouch.don't know.   you'd probably
have to benchmark that.


you need hardware encryption hardware or core2duo like processor ..

--
Eero
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Then the Mac mini might be what I need performancewise.  I am also
considering Dell R210's as I would really like an enterprise solution.
Anyone have any experience with Habey?
http://www.habeyusa.com/products.php?id=125#Menu=ChildMenu124 They have
a wide selection of barebones Intel Atoms, including the 1.8Ghz  Intel
D525's as well as Pentium 4's with broadcom ethernets and systems with
up to 6 ethernets.  My sense is that I will still use some of these
systems for firewall and management functions (i.e. firewalling Dell
IDRAC6 cards) even if the encryption for the vpn has to run on a faster
box.  50MB would probably be adequate.

Thank you all for your responses.

Nataraj


Hi,

We use the following. It has hardware encryption in the EDEN Via processor.
We were able to get 22 mbits across an ipsec tunnel using AES encryption.
This more than enough unless you have a DS3 circuit.

http://www.acrosser.com/products/detail_id_427.html
 

IE only website :(

   

Hmm... works fine for me using chrome and Fedora 12.

--
Stephen Clark
*NetWolves*
Sr. Software Engineer III
Phone: 813-579-3200
Fax: 813-882-0209
Email: steve.cl...@netwolves.com
http://www.netwolves.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] perl code to remove newlines

2010-12-30 Thread ken

Given an HTML file which looks like this:

- begin snippet -
We've Lied to You…

We've Lied to You…







)
{
s/<(\w*\W)/<\L$1/g; # Downcase XXX in "/)# if this line starts with '>'
{   # then
$curr = tell $in;   # Note current file position,
seek $in, $prev, 0; # go back to previous line,
chomp;  # remove its trailing newline char,
seek $in, $curr, 0; # and reset position to current line.
}
else
{
$curr = tell $in;   # Note current file position,
seek $in, $prev, 0; # go back to previous line
s/\n/ /;# Append a space,
chop;   # and then chomp.
seek $in, $curr, 0; # and reset position to current line.
}
print;
print $out;
$prev = tell $in;   # Location of previous line.
}
- end snippet -

When I cat the output file, it looks like this:

- begin snippet -
GLOB(0x9fd587c)We've
Lied to
You…http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] appliance to embed Centos

2010-12-30 Thread Eero Volotinen
2010/12/30 Steve Clark :
> On 12/30/2010 07:34 AM, Eero Volotinen wrote:
>
> 2010/12/30 Steve Clark :
>
>
> On 12/29/2010 01:23 AM, Nataraj wrote:
>
> On 12/28/2010 09:04 PM, Eero Volotinen wrote:
>
>
> 2010/12/29 John R Pierce :
>
>
> On 12/28/10 1:55 PM, Nataraj wrote:
>
>
> - fast enough to do openvpn encryption on WAN links ranging from 50mb
> to 100mb
>
>
> THAT is a tough requirement.
>
>
> I was going to recommend the Alix boards.  they run pfSense really
> nicely, and should be able to run a stripped down centos install OK.
> with pfSense, you can boot from a CF card, so no HD at all.
>
> The Alix cards use a 433-500Mhz AMD Geode ultra-low power processor, on
> a 6x6 card.  they use 5 watts fully configured.
>
> but, 100Mbit/sec SSL encryption, ouch.don't know.   you'd probably
> have to benchmark that.
>
>
> you need hardware encryption hardware or core2duo like processor ..
>
> --
> Eero
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
>
>
> Then the Mac mini might be what I need performancewise.  I am also
> considering Dell R210's as I would really like an enterprise solution.
> Anyone have any experience with Habey?
> http://www.habeyusa.com/products.php?id=125#Menu=ChildMenu124 They have
> a wide selection of barebones Intel Atoms, including the 1.8Ghz  Intel
> D525's as well as Pentium 4's with broadcom ethernets and systems with
> up to 6 ethernets.  My sense is that I will still use some of these
> systems for firewall and management functions (i.e. firewalling Dell
> IDRAC6 cards) even if the encryption for the vpn has to run on a faster
> box.  50MB would probably be adequate.
>
> Thank you all for your responses.
>
> Nataraj
>
>
> Hi,
>
> We use the following. It has hardware encryption in the EDEN Via processor.
> We were able to get 22 mbits across an ipsec tunnel using AES encryption.
> This more than enough unless you have a DS3 circuit.
>
> http://www.acrosser.com/products/detail_id_427.html
>
>
> IE only website :(
>
>

http://linitx.com/viewcategory.php?catid=79&pp=79 also supplies
rackmounted firewalls and so on.

--
Eero
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] noob question about mock

2010-12-30 Thread nux
Hi,

Been recently more and more tempted to use mock for building rpms, but 
looking at it I have one problem. As far as I could read about it, mock 
essentially rebuilds srpms so to use it I would need a separate "classical" 
build environment to create those srpms in the first place.
Am I right or did I get something terribly wrong?


Cheers!

--
Nux!
www.nux.ro

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] noob question about mock

2010-12-30 Thread Ryan Wagoner
On Thu, Dec 30, 2010 at 8:51 AM,   wrote:
> Hi,
>
> Been recently more and more tempted to use mock for building rpms, but
> looking at it I have one problem. As far as I could read about it, mock
> essentially rebuilds srpms so to use it I would need a separate "classical"
> build environment to create those srpms in the first place.
> Am I right or did I get something terribly wrong?

You can use rpmbuild -bs --nodeps to build the SRPM without the
dependency checking. The SRPM is just a compilation of the spec,
source code, and patches.

Ryan
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bowie Bailey
On 12/30/2010 8:19 AM, ken wrote:
> Given an HTML file which looks like this:
>
> - begin snippet -
> > > > We've Lied to You…>  NAME="GENERATOR"
> CONTENT="Modular DocBook HTML Stylesheet Version 1.79"> REL="HOME"
> TITLE="Maximum RPM"
> HREF="index.html"> REL="UP"
> TITLE="Using RPM to Verify Installed Packages"
> HREF="ch-rpm-verify.html"> ...
> - end snippet -
>
> I'm coding some perl to make it look something like this:
>
> - begin snippet -
> 
> 
> We've Lied to You…
>
> 
>
> 
>
>  href="ch-rpm-verify.html">
>
>  - end snippet -
>
> I've hit a wall trying to remove all the newlines.  I've tried it
> several ways... here's just one:
>
> - begin snippet -
> while (<$in>)
> {
> s/<(\w*\W)/<\L$1/g;   # Downcase XXX in " s/<\/(\w*\W)/<\/\L$1/g;   # Downcase XXX in " if(/^>/)  # if this line starts with '>'
> { # then
>   $curr = tell $in;   # Note current file position,
>   seek $in, $prev, 0; # go back to previous line,
>   chomp;  # remove its trailing newline char,
>   seek $in, $curr, 0; # and reset position to current line.
> }
> else
> {
>   $curr = tell $in;   # Note current file position,
>   seek $in, $prev, 0; # go back to previous line
>   s/\n/ /;# Append a space,
>   chop;   # and then chomp.
>   seek $in, $curr, 0; # and reset position to current line.
> }
> print;
> print $out;
> $prev = tell $in; # Location of previous line.
> }
> - end snippet -
>
> When I cat the output file, it looks like this:
>
> - begin snippet -
> GLOB(0x9fd587c)We've
> Lied to
> You… DocBook HTML Stylesheet Version
> 1.79"> RPM"GLOB(0x9fd587c)HREF="index.html"> RPM to Verify Installed
> Packages"GLOB(0x9fd587c)HREF="ch-rpm-verify.html"> - end snippet -
>
> The output I should say *is* all on one line, not line-wrapped the way
> you see it above.  I have a hunch as to why there are the
> "GLOB(0x9fd587c)" thingies everywhere the newlines or spaces (' ')
> should be.  If some expert here could explain them, that would be really
> good.  More importantly though would be some instruction as to how to
> remove the newlines without creating all the GLOB(...) garbage.  Might I
> have to rewrite the script so to open the file in binary mode... or what?

So you are trying to remove all of the newlines inside the tags?

I would approach it from the other direction.  Remove ALL of the
newlines and then add back the ones you want.

Something like this (untested):

$irs = $/;
$/ = undef;
$html = <$in>;
$/ = $irs;

$html =~ s/\n/ /g; # Replace all newlines with spaces
$html =~ s/(<\w+)/\n$1/g;  # Add a newline before all begin tags
print $html . "\n";

This pulls in the whole file before it starts processing, but as long as
it is not ridiculously huge, this should not be a problem.

-- 
Bowie
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] noob question about mock

2010-12-30 Thread Leonard den Ottolander
Hi,

On Thu, 2010-12-30 at 13:51 +, n...@li.nux.ro wrote:
> As far as I could read about it, mock 
> essentially rebuilds srpms so to use it I would need a separate "classical" 
> build environment to create those srpms in the first place.
> Am I right or did I get something terribly wrong?

Since CentOS is an rpm based system you will almost always be rebuilding
from srpms and *not* from plain tar balls. Repos catering for
RHEL/CentOS/Fedora provide srpms by default.

However, if you want to make your own (s)rpms or patch existing ones you
will indeed need a "classical" build environment to do so. And since
there are a couple of packages that mock will not build you will need a
fallback build environment for such cases.

Regards,
Leonard.

-- 
mount -t life -o ro /dev/dna /genetic/research


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread ken

On 12/30/2010 09:18 AM Bowie Bailey wrote:
> On 12/30/2010 8:19 AM, ken wrote:
>> Given an HTML file which looks like this:
>>
>> - begin snippet -
>> >> >> >> We've Lied to You…>> > NAME="GENERATOR"
>> CONTENT="Modular DocBook HTML Stylesheet Version 1.79">> REL="HOME"
>> TITLE="Maximum RPM"
>> HREF="index.html">> REL="UP"
>> TITLE="Using RPM to Verify Installed Packages"
>> HREF="ch-rpm-verify.html">> ...
>> - end snippet -
>>
>> I'm coding some perl to make it look something like this:
>>
>> - begin snippet -
>> 
>> 
>> We've Lied to You…
>>
>> 
>>
>> 
>>
>> > href="ch-rpm-verify.html">
>>
>> > - end snippet -
>>
>> I've hit a wall trying to remove all the newlines.  I've tried it
>> several ways... here's just one:
>>
>> - begin snippet -
>> while (<$in>)
>> {
>> s/<(\w*\W)/<\L$1/g;  # Downcase XXX in "> s/<\/(\w*\W)/<\/\L$1/g;  # Downcase XXX in "> if(/^>/) # if this line starts with '>'
>> {# then
>>  $curr = tell $in;   # Note current file position,
>>  seek $in, $prev, 0; # go back to previous line,
>>  chomp;  # remove its trailing newline char,
>>  seek $in, $curr, 0; # and reset position to current line.
>> }
>> else
>> {
>>  $curr = tell $in;   # Note current file position,
>>  seek $in, $prev, 0; # go back to previous line
>>  s/\n/ /;# Append a space,
>>  chop;   # and then chomp.
>>  seek $in, $curr, 0; # and reset position to current line.
>> }
>> print;
>> print $out;
>> $prev = tell $in;# Location of previous line.
>> }
>> - end snippet -
>>
>> When I cat the output file, it looks like this:
>>
>> - begin snippet -
>> GLOB(0x9fd587c)We've
>> Lied to
>> You…> DocBook HTML Stylesheet Version
>> 1.79">> RPM"GLOB(0x9fd587c)HREF="index.html">> RPM to Verify Installed
>> Packages"GLOB(0x9fd587c)HREF="ch-rpm-verify.html">> - end snippet -
>>
>> The output I should say *is* all on one line, not line-wrapped the way
>> you see it above.  I have a hunch as to why there are the
>> "GLOB(0x9fd587c)" thingies everywhere the newlines or spaces (' ')
>> should be.  If some expert here could explain them, that would be really
>> good.  More importantly though would be some instruction as to how to
>> remove the newlines without creating all the GLOB(...) garbage.  Might I
>> have to rewrite the script so to open the file in binary mode... or what?
> 
> So you are trying to remove all of the newlines inside the tags?
> 
> I would approach it from the other direction.  Remove ALL of the
> newlines and then add back the ones you want.
> 
> Something like this (untested):
> 
> $irs = $/;
> $/ = undef;
> $html = <$in>;
> $/ = $irs;
> 
> $html =~ s/\n/ /g; # Replace all newlines with spaces
> $html =~ s/(<\w+)/\n$1/g;  # Add a newline before all begin tags
> print $html . "\n";
> 
> This pulls in the whole file before it starts processing, but as long as
> it is not ridiculously huge, this should not be a problem.

Some file this script would need to process could very well be
ridiculously huge, which is why I chose to process line-by-line.

Secondly, yes, I was already using the general strategy of taking out
the newlines (where they're misplaced) and then putting them back in
(where they should be).  It was probably difficult to discern that just
from the code.

Thanks for your reply, but it doesn't really address the problem.


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread John Doe
From: ken 

> Some file this script would need to process could very well  be
> ridiculously huge, which is why I chose to process  line-by-line.
> 
> Secondly, yes, I was already using the general strategy of  taking out
> the newlines (where they're misplaced) and then putting them back  in
> (where they should be).  It was probably difficult to discern that  just
> from the code.
> 
> Thanks for your reply, but it doesn't really  address the  problem.

Not really an answer but why not use an html beautifier...?
http://www.w3.org/People/Raggett/tidy/

$ cat $FILE | tr "\n" " " | sed 's/ *>\n

We've Lied to You…



http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bowie Bailey
On 12/30/2010 10:24 AM, ken wrote:
> On 12/30/2010 09:18 AM Bowie Bailey wrote:
>> On 12/30/2010 8:19 AM, ken wrote:
>>> Given an HTML file which looks like this:
>>>
>>> - begin snippet -
>>> >>> >>> >>> We've Lied to You…>>> >> NAME="GENERATOR"
>>> CONTENT="Modular DocBook HTML Stylesheet Version 1.79">>> REL="HOME"
>>> TITLE="Maximum RPM"
>>> HREF="index.html">>> REL="UP"
>>> TITLE="Using RPM to Verify Installed Packages"
>>> HREF="ch-rpm-verify.html">>> ...
>>> - end snippet -
>>>
>>> I'm coding some perl to make it look something like this:
>>>
>>> - begin snippet -
>>> 
>>> 
>>> We've Lied to You…
>>>
>>> 
>>>
>>> 
>>>
>>> >> href="ch-rpm-verify.html">
>>>
>>> >> - end snippet -
>>>
>>> I've hit a wall trying to remove all the newlines.  I've tried it
>>> several ways... here's just one:
>>>
>>> - begin snippet -
>>> while (<$in>)
>>> {
>>> s/<(\w*\W)/<\L$1/g; # Downcase XXX in ">> s/<\/(\w*\W)/<\/\L$1/g; # Downcase XXX in ">> if(/^>/)# if this line starts with '>'
>>> {   # then
>>> $curr = tell $in;   # Note current file position,
>>> seek $in, $prev, 0; # go back to previous line,
>>> chomp;  # remove its trailing newline char,
>>> seek $in, $curr, 0; # and reset position to current line.
>>> }
>>> else
>>> {
>>> $curr = tell $in;   # Note current file position,
>>> seek $in, $prev, 0; # go back to previous line
>>> s/\n/ /;# Append a space,
>>> chop;   # and then chomp.
>>> seek $in, $curr, 0; # and reset position to current line.
>>> }
>>> print;
>>> print $out;
>>> $prev = tell $in;   # Location of previous line.
>>> }
>>> - end snippet -
>>>
>>> When I cat the output file, it looks like this:
>>>
>>> - begin snippet -
>>> GLOB(0x9fd587c)We've
>>> Lied to
>>> You…>> DocBook HTML Stylesheet Version
>>> 1.79">>> RPM"GLOB(0x9fd587c)HREF="index.html">>> RPM to Verify Installed
>>> Packages"GLOB(0x9fd587c)HREF="ch-rpm-verify.html">>> - end snippet -
>>>
>>> The output I should say *is* all on one line, not line-wrapped the way
>>> you see it above.  I have a hunch as to why there are the
>>> "GLOB(0x9fd587c)" thingies everywhere the newlines or spaces (' ')
>>> should be.  If some expert here could explain them, that would be really
>>> good.  More importantly though would be some instruction as to how to
>>> remove the newlines without creating all the GLOB(...) garbage.  Might I
>>> have to rewrite the script so to open the file in binary mode... or what?
>> So you are trying to remove all of the newlines inside the tags?
>>
>> I would approach it from the other direction.  Remove ALL of the
>> newlines and then add back the ones you want.
>>
>> Something like this (untested):
>>
>> $irs = $/;
>> $/ = undef;
>> $html = <$in>;
>> $/ = $irs;
>>
>> $html =~ s/\n/ /g; # Replace all newlines with spaces
>> $html =~ s/(<\w+)/\n$1/g;  # Add a newline before all begin tags
>> print $html . "\n";
>>
>> This pulls in the whole file before it starts processing, but as long as
>> it is not ridiculously huge, this should not be a problem.
> Some file this script would need to process could very well be
> ridiculously huge, which is why I chose to process line-by-line.
>
> Secondly, yes, I was already using the general strategy of taking out
> the newlines (where they're misplaced) and then putting them back in
> (where they should be).  It was probably difficult to discern that just
> from the code.
>
> Thanks for your reply, but it doesn't really address the problem.

In that case, how about this?

$html = undef;
while (<$in>)
{
chomp;
$html .= " " . $_;   # Add the new line to what we
already have
$html =~ s/^\s+//;   # Get rid of any leading spaces
$html =~ s/(<\/?\w*\W)/\L$1/g;   # Lowercase tags
$html =~ s/(?<=.)(<\w+)/\n$1/g;  # Add in needed newlines
while ($html =~ /\n/)
{
$html =~ s/^(.*?\n)//;
print $1;# Print completed lines
}
}
print "$html\n"; # Print whatever is left over at
the end

-- 
Bowie
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] noob question about mock

2010-12-30 Thread nux
Ryan Wagoner writes:

> On Thu, Dec 30, 2010 at 8:51 AM,   wrote:
>> Hi,
>>
>> Been recently more and more tempted to use mock for building rpms, but
>> looking at it I have one problem. As far as I could read about it, mock
>> essentially rebuilds srpms so to use it I would need a separate "classical"
>> build environment to create those srpms in the first place.
>> Am I right or did I get something terribly wrong?
> 
> You can use rpmbuild -bs --nodeps to build the SRPM without the
> dependency checking. The SRPM is just a compilation of the spec,
> source code, and patches.
> 
> Ryan


Great tip, Ryan! Thank you.

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] recursively count the words occurrence in the text files

2010-12-30 Thread S Mathias
I just can't google for it:

I'm searching for a "bash" "one liner" (awk, perl, or anything) for this: 

there are text files, in several directories: 

mkdir one
mkdir two
mkdir three

echo "word1 word2 word3" > one/asf.txt
echo "word2 word4, word5" > one/asfcxv saf.txt
echo "word1. word2" > one/dsgsdg.txt

echo "word6, word3!" > two/sdgsd dsf.txt
echo "word6" > two/ergd.txt

echo "asdf, word2" > three/werdf.txt
echo "word7, word8 word9 word10" > three/qwerb erfsdgdsg.txt
echo "word4 word3" > three/web erg as.txt

so it does the magic* "recursively":

$ SOMEMAGIC > output.txt
cat output.txt
asdf 1
word1 2
word2 4
word3 3
word4 2
word5 1
word6 2
word7 1
word8 1
word9 1
word10 1
$



*recursively count the words occurrence in the text files like: "word1 2"
can anyone point to a howto/link? [re: i just can't google for it :\]


  
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] recursively count the words occurrence in the text files

2010-12-30 Thread Stephen Harris
On Thu, Dec 30, 2010 at 10:34:58AM -0800, S Mathias wrote:
> I just can't google for it:

I'm a little concerned about the number of "schoolbook" questions showing
on this list, recently.  However...

> echo "word1 word2 word3" > one/asf.txt
> echo "word2 word4, word5" > one/asfcxv saf.txt

Yeah, that line won't work like you think.

> $ SOMEMAGIC > output.txt

I'd do something like
  cat */* | tr -c '[:alpha:]' '\012' | grep -v '^$' | sort | uniq -c

If more than just one layer of subdirs, replace the "cat */*" with
  find . -type f -exec cat {} \;

-- 

rgds
Stephen
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] recursively count the words occurrence in the text files

2010-12-30 Thread Mark
On Thu, Dec 30, 2010 at 10:56 AM, Stephen Harris  wrote:
>
> I'm a little concerned about the number of "schoolbook" questions showing
> on this list, recently.  However...
>
I have to wonder why we are doing this fellow's homework for him at
all.  These are fairly basic exercises in learning to use shell
commands for pattern processing, most of which can be gleaned from the
man pages and a (very) little brain exercise combined with
experimentation.  There are also numerous books on these subjects
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Sean
Not sure exactly what you are trying to do, but Tie::File might be worth 
a look at if you haven't done so already?
Sean

ken wrote:
> Given an HTML file which looks like this:
>
> - begin snippet -
>
>> > > We've Lied to You…> > 
> NAME="GENERATOR"
> CONTENT="Modular DocBook HTML Stylesheet Version 1.79"> REL="HOME"
> TITLE="Maximum RPM"
> HREF="index.html"> REL="UP"
> TITLE="Using RPM to Verify Installed Packages"
> HREF="ch-rpm-verify.html"> ...
> - end snippet -
>
> I'm coding some perl to make it look something like this:
>
> - begin snippet -
> 
> 
> We've Lied to You…
>
> 
>
> 
>
>  href="ch-rpm-verify.html">
>
>  - end snippet -
>
> I've hit a wall trying to remove all the newlines.  I've tried it
> several ways... here's just one:
>
> - begin snippet -
> while (<$in>)
> {
> s/<(\w*\W)/<\L$1/g;   # Downcase XXX in " s/<\/(\w*\W)/<\/\L$1/g;   # Downcase XXX in " if(/^>/)  # if this line starts with '>'
> { # then
>   $curr = tell $in;   # Note current file position,
>   seek $in, $prev, 0; # go back to previous line,
>   chomp;  # remove its trailing newline char,
>   seek $in, $curr, 0; # and reset position to current line.
> }
> else
> {
>   $curr = tell $in;   # Note current file position,
>   seek $in, $prev, 0; # go back to previous line
>   s/\n/ /;# Append a space,
>   chop;   # and then chomp.
>   seek $in, $curr, 0; # and reset position to current line.
> }
> print;
> print $out;
> $prev = tell $in; # Location of previous line.
> }
> - end snippet -
>
> When I cat the output file, it looks like this:
>
> - begin snippet -
> GLOB(0x9fd587c)We've
> Lied to
> You… DocBook HTML Stylesheet Version
> 1.79"> RPM"GLOB(0x9fd587c)HREF="index.html"> RPM to Verify Installed
> Packages"GLOB(0x9fd587c)HREF="ch-rpm-verify.html"> - end snippet -
>
> The output I should say *is* all on one line, not line-wrapped the way
> you see it above.  I have a hunch as to why there are the
> "GLOB(0x9fd587c)" thingies everywhere the newlines or spaces (' ')
> should be.  If some expert here could explain them, that would be really
> good.  More importantly though would be some instruction as to how to
> remove the newlines without creating all the GLOB(...) garbage.  Might I
> have to rewrite the script so to open the file in binary mode... or what?
>
>
> Maximum thanks for your assistance.
>
>
>
>
>   
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread cpolish
John Doe wrote:
 
> $ cat $FILE | tr "\n" " " | sed 's/ *>\n\nhttp://www.partmaps.org/era/unix/award.html#uucaletter
-- 
"Pedantic, I?" -- Alexei Sayle

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] noob question about mock

2010-12-30 Thread Gordon Messmer
On 12/30/2010 05:51 AM, n...@li.nux.ro wrote:
> Been recently more and more tempted to use mock for building rpms, but
> looking at it I have one problem. As far as I could read about it, mock
> essentially rebuilds srpms so to use it I would need a separate "classical"
> build environment to create those srpms in the first place.
> Am I right or did I get something terribly wrong?

You can always use "mock --shell" to use the mock environment as your 
interactive build environment.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Dual or quad fast ethernet NICs (that work with CentOS)

2010-12-30 Thread James Bensley
We have an Intel Pro 1000 MT, quad port Gig NIC in a CentOS 5.5 box,
works great.

-- 
Regards,
James.

http://www.jamesbensley.co.cc/

There are 10 kinds of people in the world; Those who understand
Vigesimal, and J others...?
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] remove newlines / perl /concise example

2010-12-30 Thread ken
Thanks for the previous tips and suggestions.  Here's a more concise
example:

Input file:






I want everything on one line, i.e., remove all newlines.  Like so:



Simple perl code:

#!/usr/bin/env perl
# Remove newlines from a file in two ways:
# (1) Just "chomp" them;
# (2) Replace them with a space.


# Open input file for reading only.
my $infilename = "/tmp/newline-test-in";
open(my $in, "<", "$infilename") or die "Can't open file
\"$infilename\": $!";

# Open output file for writing only.
my $outfilename = "/tmp/newline-test-out";
open (my $out, ">", "$outfilename") or die "Can\'t open $outfilename for
writing. $!";

# Comment out either, both, or neither of the below "binmode" == no joy
#binmode $in;   
binmode $out;

while (<$in>)
{
# Neither of the two commands below works as expected.
chomp;  # remove trailing newline.
#   s/\n/ /;# replace newline with space
print $out $in;
}

# Close input file.
close $in or die "Error closing $in: $!";

# Close output file.
close $out or die "Error closing output file $out: $!";

### end of perl script

Run this, commenting in/out whatever, and output file is consistently this:

GLOB(0x8ad3c28)GLOB(0x8ad3c28)GLOB(0x8ad3c28)GLOB(0x8ad3c28)


___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] appliance to embed Centos

2010-12-30 Thread Nataraj
On 12/30/2010 04:34 AM, Eero Volotinen wrote:
> 2010/12/30 Steve Clark :
>> On 12/29/2010 01:23 AM, Nataraj wrote:
>>
>> On 12/28/2010 09:04 PM, Eero Volotinen wrote:
>>
>>
>> 2010/12/29 John R Pierce :
>>
>>
>> On 12/28/10 1:55 PM, Nataraj wrote:
>>
>>
>> - fast enough to do openvpn encryption on WAN links ranging from 50mb
>> to 100mb
>>
>>
>> THAT is a tough requirement.
>>
>>
>> I was going to recommend the Alix boards.  they run pfSense really
>> nicely, and should be able to run a stripped down centos install OK.
>> with pfSense, you can boot from a CF card, so no HD at all.
>>
>> The Alix cards use a 433-500Mhz AMD Geode ultra-low power processor, on
>> a 6x6 card.  they use 5 watts fully configured.
>>
>> but, 100Mbit/sec SSL encryption, ouch.don't know.   you'd probably
>> have to benchmark that.
>>
>>
>> you need hardware encryption hardware or core2duo like processor ..
>>
>> --
>> Eero
>> ___
>> CentOS mailing list
>> CentOS@centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>
>>
>> Then the Mac mini might be what I need performancewise.  I am also
>> considering Dell R210's as I would really like an enterprise solution.
>> Anyone have any experience with Habey?
>> http://www.habeyusa.com/products.php?id=125#Menu=ChildMenu124 They have
>> a wide selection of barebones Intel Atoms, including the 1.8Ghz  Intel
>> D525's as well as Pentium 4's with broadcom ethernets and systems with
>> up to 6 ethernets.  My sense is that I will still use some of these
>> systems for firewall and management functions (i.e. firewalling Dell
>> IDRAC6 cards) even if the encryption for the vpn has to run on a faster
>> box.  50MB would probably be adequate.
>>
>> Thank you all for your responses.
>>
>> Nataraj
>>
>>
>> Hi,
>>
>> We use the following. It has hardware encryption in the EDEN Via processor.
>> We were able to get 22 mbits across an ipsec tunnel using AES encryption.
>> This more than enough unless you have a DS3 circuit.
>>
>> http://www.acrosser.com/products/detail_id_427.html
> IE only website :(
>
> So, you are using padlock hw encryption on device?
>
> --
> Eero
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
I see now that there is fairly extensive support available for padlock
encryption. 
http://www.logix.cz/michal/devel/padlock/
http://www.logix.cz/michal/doc/article.xp/padlock-en

These pages are a bit old, but it appears that support for md5, sha1 and
sha256 are in the mainline linux kernel.  Openvpn has a -engine option
for invoking padlock support in openssl.  So I expect that I will order
at least one of these boxes for testing purposes and probably another
box with a somewhat faster processor for comparison.

Thanks,
Nataraj

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread ken

On 12/30/2010 11:01 AM John Doe wrote:
> From: ken 
> 
>> Some file this script would need to process could very well  be
>> ridiculously huge, which is why I chose to process  line-by-line.
>>
>> Secondly, yes, I was already using the general strategy of  taking out
>> the newlines (where they're misplaced) and then putting them back  in
>> (where they should be).  It was probably difficult to discern that  just
>> from the code.
>>
>> Thanks for your reply, but it doesn't really  address the  problem.
> 
> Not really an answer but why not use an html beautifier...?
> http://www.w3.org/People/Raggett/tidy/

Thanks.  Cool program.  But for some reason it mangles the file in a few
ways.  So I can't use it.


> 
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] remove newlines / perl /concise example

2010-12-30 Thread Stephen Harris
On Thu, Dec 30, 2010 at 04:57:46PM -0500, ken wrote:
> open(my $in, "<", "$infilename") or die "Can't open file

> while (<$in>)
> {
> # Neither of the two commands below works as expected.
>   chomp;  # remove trailing newline.
> # s/\n/ /;# replace newline with space
>   print $out $in;

What exactly do you think you're printing here  $in is the filehandle,
not the content.  $_ is the content.

print $out $_;

-- 

rgds
Stephen
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script Output Format

2010-12-30 Thread Alejandro Rodriguez Luna
Thanks for the reply, the output it's ok, none of the variabbles or values are 
null, i just want that the format appears like this:

29-12-10/11:43:01,0,250,0,/FIM
    0,/mytest
        0,/mockofprod/financing/customercentre
    0,/mockofprod/financing/commercial/amt
    0,/account/orderstatus
    0,/activities


--- El mié 29-dic-10, m.r...@5-cent.us  escribió:

De: m.r...@5-cent.us 
Asunto: Re: [CentOS] Script Output Format
A: "CentOS mailing list" 
Fecha: miércoles, 29 de diciembre de 2010, 11:59

Alejandro Rodriguez Luna wrote:
> i'm just did a script that the output must be comma separated to be
> imported into a spreadsheet.
>
> the output that i obteined was
>
> Date/Time,We. Active Threads,W. Total Threads,W. Worker Threads,Name
> 29-12-10/11:43:01,0,250,0,/FIM
> ,0,/mytest
> ,0,/mockofprod/financing/customercentre
> ,0,/mockofprod/financing/commercial/amt
> ,0,/account/orderstatus
> ,0,/activities
>
> as you can see, the first row it's ok, but the second and third, etc etc,
> are not formated. any ideas of how can i achive this?
>
> NOTE: the first three values are simple commands that i put in order, the
> fourth and fifth are from a file.
>
> this is part of the code.
>
>
> printf "%s,%d,%d" $DATE $WSAT $WSTT >> output.${STANZA}.txt
>
> for i in `cat jlist.${STANZA}.txt`
> do
>   JUNCTION=${i}
>   WSWJ=`pdadmin -a sec_master -p ${PASSWD} server task ${STANZA} show > 
> ${JUNCTION} | grep 'threads' | awk '{ print $4 }'`
>   printf ",%d,%s\n" ${WSWJ} ${JUNCTION} >> output.${STANZA}.txt
> done

Well, it looks like $WSWJ is null. What's the output... hmmm, consider
that there may be more than one line with "threads", and that the fourth
element of the last line may not be what you want. (And you *could* just
do ...| awk {if ($0 ~ /threads/) { print $4;}}`)

         mark

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos



  ___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Jerry McAllister
On Thu, Dec 30, 2010 at 08:19:00AM -0500, ken wrote:

It isn't perl, but does 'tr' exist in CentOS (it does in FreeBSD)?
It would do it.

jerry


> 
> Given an HTML file which looks like this:
> 
> - begin snippet -
>  > > >We've Lied to You… > NAME="GENERATOR"
> CONTENT="Modular DocBook HTML Stylesheet Version 1.79"> REL="HOME"
> TITLE="Maximum RPM"
> HREF="index.html"> REL="UP"
> TITLE="Using RPM to Verify Installed Packages"
> HREF="ch-rpm-verify.html"> ...
> - end snippet -
> 
> I'm coding some perl to make it look something like this:
> 
> - begin snippet -
> 
> 
> We've Lied to You…
> 
> 
> 
> 
> 
>  href="ch-rpm-verify.html">
> 
>  - end snippet -
> 
> I've hit a wall trying to remove all the newlines.  I've tried it
> several ways... here's just one:
> 
> - begin snippet -
> while (<$in>)
> {
> s/<(\w*\W)/<\L$1/g;   # Downcase XXX in " s/<\/(\w*\W)/<\/\L$1/g;   # Downcase XXX in " if(/^>/)  # if this line starts with '>'
> { # then
>   $curr = tell $in;   # Note current file position,
>   seek $in, $prev, 0; # go back to previous line,
>   chomp;  # remove its trailing newline char,
>   seek $in, $curr, 0; # and reset position to current line.
> }
> else
> {
>   $curr = tell $in;   # Note current file position,
>   seek $in, $prev, 0; # go back to previous line
>   s/\n/ /;# Append a space,
>   chop;   # and then chomp.
>   seek $in, $curr, 0; # and reset position to current line.
> }
> print;
> print $out;
> $prev = tell $in; # Location of previous line.
> }
> - end snippet -
> 
> When I cat the output file, it looks like this:
> 
> - begin snippet -
> GLOB(0x9fd587c)We've
> Lied to
> You… DocBook HTML Stylesheet Version
> 1.79"> RPM"GLOB(0x9fd587c)HREF="index.html"> RPM to Verify Installed
> Packages"GLOB(0x9fd587c)HREF="ch-rpm-verify.html"> - end snippet -
> 
> The output I should say *is* all on one line, not line-wrapped the way
> you see it above.  I have a hunch as to why there are the
> "GLOB(0x9fd587c)" thingies everywhere the newlines or spaces (' ')
> should be.  If some expert here could explain them, that would be really
> good.  More importantly though would be some instruction as to how to
> remove the newlines without creating all the GLOB(...) garbage.  Might I
> have to rewrite the script so to open the file in binary mode... or what?
> 
> 
> Maximum thanks for your assistance.
> 
> 
> 
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] OT how to prevent oversubscription of a disk

2010-12-30 Thread Dave
I want to add up the quotas I've assigned on a particular partition
and see if the total is bigger than the disk. It's possible to do this
(awkwardly) using repquota or quota. Is there no more accurate/elegant
way? I can't be the first person to worry that more quota has been
issued than the disk can supply.
mahalo and Happy New Year,
Dave
-- 
Q: Why should this email be 5 sentences or less?
A: http://five.sentenc.es
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] Anaconda hangs using 100% CPU

2010-12-30 Thread cpolish
Dear all,

I have been struggling with my first PXEboot today, using a
kickstart with packages served over http on the local network.

The details:

- Anaconda is using 100% CPU

- CentOS 5.5 i386 downloaded yesterday

- .iso md5sums checked out good

- 0 network errors showing (ifconfig)

- console 1 displays: "Installing httpd-..." Done [508/782]"

- It appears to be trying to install samba for the last hour:
  the last 2 lines of the Apache access_log on the package
  server:

  "GET /centos/5.5/os/i386/disc2//CentOS/
   httpd-2.2.3-43.el5.centos.i386.rpm HTTP/1.1" 200 1277591
  "GET /centos/5.5/os/i386/disc2//CentOS/
   samba-3.0.33-3.28.el5.i386.rpm HTTP/1.1" 200 17016117

- The last line of /tmp/anaconda.log shows:
  DEBUG   : Adding Package opensp-1.5.2-4.i386 in mode u

- The last line of /mnt/sysimage/root/install.log.syslog shows:
  useradd[2304]: new user: name=apache, ...

- I have searched for similar issues at bugs.centos.org without success

- The system is still alive, console 2 is responsive 
  so I can (hopefully) debug this if someone will point
  me in the right direction

- kickstart file: http://pastebin.com/mQxx42wf

Help!
-- 
Charles Polisher

___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bart Schaefer
On Thu, Dec 30, 2010 at 5:19 AM, ken  wrote:
>
>
> - begin snippet -
> while (<$in>)
> {
>    s/<(\w*\W)/<\L$1/g;         # Downcase XXX in "    s/<\/(\w*\W)/<\/\L$1/g;     # Downcase XXX in "    if(/^>/)                    # if this line starts with '>'
>    {                           # then
>        $curr = tell $in;       # Note current file position,
>        seek $in, $prev, 0;     # go back to previous line,
>        chomp;                  # remove its trailing newline char,
>        seek $in, $curr, 0;     # and reset position to current line.
>    }
>    else
>    {
>        $curr = tell $in;       # Note current file position,
>        seek $in, $prev, 0;     # go back to previous line
>        s/\n/ /;                # Append a space,
>        chop;                   # and then chomp.
>        seek $in, $curr, 0;     # and reset position to current line.
>    }
>    print;
>    print $out;
>    $prev = tell $in;           # Location of previous line.
> }
> - end snippet -
>
> When I cat the output file, it looks like this:
>
> - begin snippet -
> GLOB(0x9fd587c)We've
> Lied to
> You… DocBook HTML Stylesheet Version
> 1.79"> RPM"GLOB(0x9fd587c)HREF="index.html"> RPM to Verify Installed
> Packages"GLOB(0x9fd587c)HREF="ch-rpm-verify.html"> - end snippet -
>
> The output I should say *is* all on one line, not line-wrapped the way
> you see it above.  I have a hunch as to why there are the
> "GLOB(0x9fd587c)" thingies everywhere the newlines or spaces (' ')
> should be.  If some expert here could explain them, that would be really
> good.  More importantly though would be some instruction as to how to
> remove the newlines without creating all the GLOB(...) garbage.  Might I
> have to rewrite the script so to open the file in binary mode... or what?
>
>
> Maximum thanks for your assistance.
>
>
>
> ___
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bart Schaefer
(Drat, keyboard glitch caused that to be sent before I was finished.)

On Thu, Dec 30, 2010 at 5:19 AM, ken  wrote:
>
>
> - begin snippet -
> while (<$in>)
> {
>    s/<(\w*\W)/<\L$1/g;         # Downcase XXX in "    s/<\/(\w*\W)/<\/\L$1/g;     # Downcase XXX in "
  s/^(^[>])/\n$1/;
  }
}

That's it, except for an END block to print a final newline.  If there
are blank lines in the input that you want to retain, you'll need a
little more to avoid having them swallowed.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] perl code to remove newlines

2010-12-30 Thread Bart Schaefer
Oops again, typo:

>      s/^(^[>])/\n$1/;

Should be s/^([^>])/\n$1/
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] amanda backup ssh key

2010-12-30 Thread bluethundr
hello list,

 I am attempting to ssh via a user account setup for amanda backups
from the backup server to the test backup client. AFAIK everything is
setup correctly yet when I ssh as the user to the client I have to
type the password. the public key is in the authorized_keys file of
the client and permissions all seem correct.

 Here is a verbose output of the ssh session

[amandabac...@virtcent18 .ssh]$ ssh -vvv lb1
OpenSSH_5.6p1lpk, OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to lb1 [192.168.1.23] port 22.
debug1: Connection established.
debug1: identity file /var/lib/amanda/.ssh/id_rsa type -1
debug1: identity file /var/lib/amanda/.ssh/id_rsa-cert type -1
debug1: identity file /var/lib/amanda/.ssh/id_dsa type -1
debug1: identity file /var/lib/amanda/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.6
debug1: match: OpenSSH_5.6 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit:
diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit:
ssh-rsa-cert-...@openssh.com,ssh-dss-cert-...@openssh.com,ssh-rsa-cert-...@openssh.com,ssh-dss-cert-...@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit:
aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-...@lysator.liu.se
debug2: kex_parse_kexinit:
aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-...@lysator.liu.se
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,umac...@openssh.com,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,umac...@openssh.com,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,z...@openssh.com,zlib
debug2: kex_parse_kexinit: none,z...@openssh.com,zlib
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: kex_parse_kexinit:
diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss
debug2: kex_parse_kexinit:
aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-...@lysator.liu.se
debug2: kex_parse_kexinit:
aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-...@lysator.liu.se
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,umac...@openssh.com,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit:
hmac-md5,hmac-sha1,umac...@openssh.com,hmac-ripemd160,hmac-ripemd...@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,z...@openssh.com
debug2: kex_parse_kexinit: none,z...@openssh.com
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit:
debug2: kex_parse_kexinit: first_kex_follows 0
debug2: kex_parse_kexinit: reserved 0
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 126/256
debug2: bits set: 514/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: host lb1 filename
/var/lib/amanda/.ssh/known_hosts
debug3: check_host_in_hostfile: host lb1 filename
/var/lib/amanda/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: host 192.168.1.23 filename
/var/lib/amanda/.ssh/known_hosts
debug3: check_host_in_hostfile: host 192.168.1.23 filename
/var/lib/amanda/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug1: Host 'lb1' is known and matches the RSA host key.
debug1: Found key in /var/lib/amanda/.ssh/known_hosts:1
debug2: bits set: 516/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /var/lib/amanda/.ssh/id_rsa ((nil))
debug2: key: /var/lib/amanda/.ssh/id_dsa ((nil))
debug1: Authentications that can continue:
publ

Re: [CentOS] segfault

2010-12-30 Thread Sandeil Tenebro
Hi list,

As an update I have the latest core dump and did a back trace. Please see below.

Thank you,
Sandeil

=
*** thread apply all bt

#20131 0x2ac96feba29a in ?? () from /lib64/libpcre.so.0
#20132 0x2ac96feba1d9 in ?? () from /lib64/libpcre.so.0
#20133 0x2ac96feba29a in ?? () from /lib64/libpcre.so.0
#20134 0x2ac96feb6c4b in ?? () from /lib64/libpcre.so.0
#20135 0x2ac96febb6c1 in pcre_exec () from /lib64/libpcre.so.0
#20136 0x2ac97a155806 in php_pcre_replace_impl () from 
/etc/httpd/modules/libphp5.so
#20137 0x2ac97a1569b2 in ?? () from /etc/httpd/modules/libphp5.so
#20138 0x2ac97a157075 in ?? () from /etc/httpd/modules/libphp5.so
#20139 0x2ac97f8d19a3 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20140 0x2ac97f8d4188 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20141 0x2ac97f8d506c in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20142 0x2ac97f8d3b74 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20143 0x2ac97f92f311 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20144 0x2ac97f8d434f in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20145 0x2ac97f8d506c in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20146 0x2ac97f8d3b74 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20147 0x2ac97f92f311 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20148 0x2ac97f8d434f in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20149 0x2ac97f8d506c in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
---Type  to continue, or q  to quit---
#20150 0x2ac97f8d3b74 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20151 0x2ac97f92f311 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20152 0x2ac97f8d434f in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20153 0x2ac97f8d506c in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20154 0x2ac97f8d3b74 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20155 0x2ac97f92f311 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20156 0x2ac97a29e0af in ?? () from /etc/httpd/modules/libphp5.so
#20157 0x2ac97f8d3b74 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20158 0x2ac97f92f311 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20159 0x2ac97a277cb3 in zend_execute_scripts () from 
/etc/httpd/modules/libphp5.so
#20160 0x2ac97a23798a in php_execute_script () from 
/etc/httpd/modules/libphp5.so
#20161 0x2ac97a2fc805 in ?? () from /etc/httpd/modules/libphp5.so
#20162 0x2ac96f7e0a4a in ap_run_handler ()
#20163 0x2ac96f7e3ed8 in ap_invoke_handler ()
#20164 0x2ac96f7ee78a in ap_internal_redirect ()
#20165 0x2ac978628bc0 in ap_make_dirstr_parent () from 
/etc/httpd/modules/mod_rewrite.so
#20166 0x2ac96f7e0a4a in ap_run_handler ()
#20167 0x2ac96f7e3ed8 in ap_invoke_handler ()
#20168 0x2ac96f7ee938 in ap_process_request ()
#20169 0x2ac96f7ebb70 in ?? ()
#20170 0x2ac96f7e7cd2 in ap_run_process_connection ()
#20171 0x2ac96f7f2789 in ?? ()
#20172 0x2ac96f7f2a1a in ?? ()
#20173 0x2ac96f7f327d in ap_mpm_run ()
#20174 0x2ac96f7cde48 in main ()
(gdb)
(gdb)

*** bt
#20135 0x2ac96febb6c1 in pcre_exec () from /lib64/libpcre.so.0
#20136 0x2ac97a155806 in php_pcre_replace_impl () from 
/etc/httpd/modules/libphp5.so
#20137 0x2ac97a1569b2 in ?? () from /etc/httpd/modules/libphp5.so
#20138 0x2ac97a157075 in ?? () from /etc/httpd/modules/libphp5.so
#20139 0x2ac97f8d19a3 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20140 0x2ac97f8d4188 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20141 0x2ac97f8d506c in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20142 0x2ac97f8d3b74 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20143 0x2ac97f92f311 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20144 0x2ac97f8d434f in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20145 0x2ac97f8d506c in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20146 0x2ac97f8d3b74 in ?? () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20147 0x2ac97f92f311 in zend_oe () from 
/usr/local/Zend/lib/Optimizer-3.3.3/php-5.2.x/ZendOptimizer.so
#20148 0x2ac97f8d434f in ?? () from 
/usr/local/Zend/lib/Opti