[CentOS] Script to rebuild CentOS 8 boot ISO with plus kernel

2020-10-05 Thread Chris Adams
I want to install CentOS 8 on some older Dells that have storage
controllers dropped by RHEL 8.  The CentOS 8 kernel-plus package
supports them, so I wrote a script that rebuilds the boot ISO to boot
and install using the kernel-plus package from the centosplus repo.

https://github.com/cmadamsgit/misc-scripts/

I know you can use driver disks to load additional modules from
elsewhere, but I wanted to end up with the kernel-plus anyway, so why
not just do it during install?

Lightly tested, but seems to work.  Posting here in case it is useful to
others.
-- 
Chris Adams 
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script to monitor websites and generate RSS feed when they change

2020-02-29 Thread H
On 02/27/2020 07:18 PM, H wrote:
> On 02/25/2020 02:55 PM, Vanhorn, Mike wrote:
>> I just read an article (part of which is here 
>> http://www.linuxpromagazine.com/Issues/2020/230/The-sys-admin-s-daily-grind-urlwatch/(language)/eng-US
>>  ) about urlwatch.
>>
>> ---
>> Mike VanHorn
>> Senior Computer Systems Administrator
>> College of Engineering and Computer Science
>> Wright State University
>> 265 Russ Engineering Center
>> 937-775-5157
>> michael.vanh...@wright.edu
>>
>> On 2/24/20, 7:55 PM, "CentOS on behalf of H" > behalf of age...@meddatainc.com> wrote:
>>
>> Looking for the above. I have found sites where you can register the 
>> sites you are interested in - as well as yourself - but I would rather run 
>> something myself on my server to monitor websites etc which do not have 
>> RSS-feeds.
>> 
>> Does anyone use something like this?
>> 
>> ___
>> CentOS mailing list
>> CentOS@centos.org
>> 
>> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.centos.org_mailman_listinfo_centos=DwICAg=3buyMx9JlH1z22L_G5pM28wz_Ru6WjhVHwo-vpeS0Gk=_s0N94AIK4hLWzZ1WmAPvZjr8bPWpBPPuhyNjJkGAHs=Psh0wPchS71VwyqP7XQS5JgxmMhjbSmNtrO7A3seEq8=EbjhNzuWZGSbUccCjf6s15NZQjplXkVmIHsayUqDXF0=
>>  
>> 
>>
>> ___
>> CentOS mailing list
>> CentOS@centos.org
>> https://lists.centos.org/mailman/listinfo/centos
> Thank you, looks perfect!
>
I looked at this again, while urlwatch seems very useful, it does lack the 
ability to generate RSS-feeds which would have been very nice... There were 
requests on github for it but it has not (yet) been implemented...

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


Re: [CentOS] Script to monitor websites and generate RSS feed when they change

2020-02-27 Thread H
On 02/25/2020 02:55 PM, Vanhorn, Mike wrote:
> I just read an article (part of which is here 
> http://www.linuxpromagazine.com/Issues/2020/230/The-sys-admin-s-daily-grind-urlwatch/(language)/eng-US
>  ) about urlwatch.
>
> ---
> Mike VanHorn
> Senior Computer Systems Administrator
> College of Engineering and Computer Science
> Wright State University
> 265 Russ Engineering Center
> 937-775-5157
> michael.vanh...@wright.edu
>
> On 2/24/20, 7:55 PM, "CentOS on behalf of H"  behalf of age...@meddatainc.com> wrote:
>
> Looking for the above. I have found sites where you can register the 
> sites you are interested in - as well as yourself - but I would rather run 
> something myself on my server to monitor websites etc which do not have 
> RSS-feeds.
> 
> Does anyone use something like this?
> 
> ___
> CentOS mailing list
> CentOS@centos.org
> 
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.centos.org_mailman_listinfo_centos=DwICAg=3buyMx9JlH1z22L_G5pM28wz_Ru6WjhVHwo-vpeS0Gk=_s0N94AIK4hLWzZ1WmAPvZjr8bPWpBPPuhyNjJkGAHs=Psh0wPchS71VwyqP7XQS5JgxmMhjbSmNtrO7A3seEq8=EbjhNzuWZGSbUccCjf6s15NZQjplXkVmIHsayUqDXF0=
>  
> 
>
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos

Thank you, looks perfect!

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


Re: [CentOS] Script to monitor websites and generate RSS feed when they change

2020-02-25 Thread Vanhorn, Mike
I just read an article (part of which is here 
http://www.linuxpromagazine.com/Issues/2020/230/The-sys-admin-s-daily-grind-urlwatch/(language)/eng-US
 ) about urlwatch.

---
Mike VanHorn
Senior Computer Systems Administrator
College of Engineering and Computer Science
Wright State University
265 Russ Engineering Center
937-775-5157
michael.vanh...@wright.edu

On 2/24/20, 7:55 PM, "CentOS on behalf of H"  wrote:

Looking for the above. I have found sites where you can register the sites 
you are interested in - as well as yourself - but I would rather run something 
myself on my server to monitor websites etc which do not have RSS-feeds.

Does anyone use something like this?

___
CentOS mailing list
CentOS@centos.org

https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.centos.org_mailman_listinfo_centos=DwICAg=3buyMx9JlH1z22L_G5pM28wz_Ru6WjhVHwo-vpeS0Gk=_s0N94AIK4hLWzZ1WmAPvZjr8bPWpBPPuhyNjJkGAHs=Psh0wPchS71VwyqP7XQS5JgxmMhjbSmNtrO7A3seEq8=EbjhNzuWZGSbUccCjf6s15NZQjplXkVmIHsayUqDXF0=
 


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


[CentOS] Script to monitor websites and generate RSS feed when they change

2020-02-24 Thread H
Looking for the above. I have found sites where you can register the sites you 
are interested in - as well as yourself - but I would rather run something 
myself on my server to monitor websites etc which do not have RSS-feeds.

Does anyone use something like this?

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


Re: [CentOS] Script to Check 7.x Hardware Compatibility?

2019-07-12 Thread Tim Evans

On 7/12/19 8:43 AM, Tim Evans wrote:
I have a vague recollection--from several years back--there was once a 
script out there that could be run on a CentOS 6.x system to test its 
hardware compatibility for CentOS 7. (Not talking about a script to 
actually do any upgrade; just check a system's hardware.)


Does anyone remember this? Remember the details?  Thanks.


Replying to myself...

Poking around, I guess I'm referring to the 'preupgrade' tools, which 
apparently have been withdrawn:


https://wiki.centos.org/TipsAndTricks/CentOSUpgradeTool

Running 'preupg' on my 6.10 system (Linux kestrel.tkevans.com 
2.6.32-754.17.1.el6.x86_64) ends up with some compilation errors and no 
results.html output.


Will have to try a 7.x LiveCD to see what's what.
--
Tim Evans   |5 Chestnut Court
443-394-3864|Owings Mills, MD 21117
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


[CentOS] Script to Check 7.x Hardware Compatibility?

2019-07-12 Thread Tim Evans
I have a vague recollection--from several years back--there was once a 
script out there that could be run on a CentOS 6.x system to test its 
hardware compatibility for CentOS 7. (Not talking about a script to 
actually do any upgrade; just check a system's hardware.)


Does anyone remember this? Remember the details?  Thanks.
--
Tim Evans   |5 Chestnut Court
443-394-3864|Owings Mills, MD 21117
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script not running correctly as cronjob

2017-02-02 Thread Tony Mountifield
In article <9f43c460b0374ac3951c18dd2d477...@2sic.com>,
Daniel Reich <daniel.re...@2sic.com> wrote:
> Thank you for the hints
> 
> I modified like you described.
> I also moved the permission part out of the loop (once at the end of the 
> script is enough).
> 
> Now with the "set -x" the script is working also in cron.

The "set -x" would not be not what made it work - it is a debugging aid only.

If it now works, then that is due to one of your other changes and you can
remove the "set -x" again if you wish.

Cheers
Tony

> Best regards
> Daniel
> 
> 
> 
> -Original Message-
> From: CentOS [mailto:centos-boun...@centos.org] On Behalf Of Tony Mountifield
> Sent: Wednesday, February 1, 2017 11:04 AM
> To: centos@centos.org
> Subject: Re: [CentOS] Script not running correctly as cronjob
> 
> In article <86827d81f1944333ae213f2d3f198...@2sic.com>,
> Daniel Reich <daniel.re...@2sic.com> wrote:
> > Hi
> > 
> > I have a script to resign all DNS zones every two weeks. When i run 
> > the script from bash, it works like it should. But when it is executed in 
> > cron not. Its starting normal as cronjob:
> > Feb  1 03:00:01 xxx CROND[20116]: (root) CMD (sh 
> > /opt/dnssec/resign_dnssec_zones.sh)
> > 
> > But after i get a mail that everything is finsihed, but it isn't.
> > 03:04:28 DNSSEC-Signierung abgeschlossen
> > 
> > The script deletes the old signed zones, but don't resign it. The mail is 
> > also sent.
> > Below the script.
> > 
> > Anybody an idea why it doesn't work in cron?^ I cannot find any error 
> > in any log.
> 
> After the first line, add a line saying: set -x
> 
> Then set cron to run it and examine the output that gets mailed to you.
> 
> The -x tells it to echo each command it is about to execute. That will help 
> you to see how far it is getting.
> 
> Further comments below.
> 
> Cheers
> Tony
> 
> > Best regards
> > Daniel
> > 
> > 
> > #!/bin/bash
> > KSKDIR="/etc/named/KSK"
> > ZSKDIR="/etc/named/ZSK"
> > ZONEDIR="/var/named/chroot/var/named"
> > LOG="/var/named/chroot/var/log/dnssec_resign.log"
> > MAILREC="monitor@xx"
> > 
> > #delete old signed files
> > rm -rf $ZONEDIR/*.signed
> > 
> > #delete the old log
> > rm -rf $LOG
> > 
> > #read the zonefiles
> > ZONEFILES=$(ls -p $ZONEDIR | grep -v '/$' | grep -v 'dsset*')
> > 
> > for FILES in $ZONEFILES; do
> > #remove the .zone at the end
> > ZONE=$(echo "${FILES%.*}")
> 
> Why not just: ZONE=${FILES%.*}
> 
> > #remove the old signed zone
> > rm -rf $ZONEDIR/$ZONE.signed
> 
> You deleted them all further up.
> 
> > #Sign the zone
> > cd $ZONEDIR
> 
> Why not do this before the loop? Then you also don't need $ZONEDIR/ 
> everywhere.
> 
> > dnssec-signzone -o $ZONE -k $KSKDIR/K$ZONE.*.key -e +3024000 
> > -f $ZONE.signed $ZONEDIR/$ZONE.zone $ZSKDIR/K$ZONE.*.key >> $LOG
> > 
> > #Set the correct permissions
> > chown named.named $ZONEDIR/*.signed
> > chmod 755 $ZONEDIR/*.signed
> > sleep 5
> > done
> > rm -rf $ZONEDIR/named.zone
> > 
> > echo $(date +"%T")"DNSSEC-Signierung abgeschlossen - Neustart des 
> > Servers" >> $LOG echo "$(cat $LOG)" | mail -s "DNSSEC-Signierung 
> > abgeschlossen auf xxx" $MAILREC
> > 
> > 
> > ___
> > CentOS mailing list
> > CentOS@centos.org
> > https://lists.centos.org/mailman/listinfo/centos
> > 
> 
> 
> --
> Tony Mountifield
> Work: t...@softins.co.uk - http://www.softins.co.uk
> Play: t...@mountifield.org - http://tony.mountifield.org 
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
> 


-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script not running correctly as cronjob

2017-02-01 Thread Gordon Messmer

On 02/01/2017 01:02 AM, Daniel Reich wrote:

I have a script to resign all DNS zones every two weeks.



I don't think I can answer the question about why your script is failing 
per se, but I can say that there are some flaws in the approach that 
your script is taking.  Primarily, if you delete your old key when you 
create a new one, any external host that has any record from your zone 
in its cache will consider your zone to be invalid and will be unable to 
resolve new records (or any records?  I'm unclear on that, actually) for 
the duration of your TTL.  Key rotation is not instantaneous.


I'm actually working on a key rotation management job, myself:

https://bitbucket.org/gordonmessmer/update-dns-keys/src

I've been running it for a while, and I'm comfortable with the ZSK 
rotation segment.  I have not yet tested the KSK rotation.  If you'd 
like to help, please send patches.


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


Re: [CentOS] Script not running correctly as cronjob

2017-02-01 Thread Daniel Reich
Thank you for the hints

I modified like you described.
I also moved the permission part out of the loop (once at the end of the script 
is enough).

Now with the "set -x" the script is working also in cron.

Best regards
Daniel



-Original Message-
From: CentOS [mailto:centos-boun...@centos.org] On Behalf Of Tony Mountifield
Sent: Wednesday, February 1, 2017 11:04 AM
To: centos@centos.org
Subject: Re: [CentOS] Script not running correctly as cronjob

In article <86827d81f1944333ae213f2d3f198...@2sic.com>,
Daniel Reich <daniel.re...@2sic.com> wrote:
> Hi
> 
> I have a script to resign all DNS zones every two weeks. When i run 
> the script from bash, it works like it should. But when it is executed in 
> cron not. Its starting normal as cronjob:
> Feb  1 03:00:01 xxx CROND[20116]: (root) CMD (sh 
> /opt/dnssec/resign_dnssec_zones.sh)
> 
> But after i get a mail that everything is finsihed, but it isn't.
> 03:04:28 DNSSEC-Signierung abgeschlossen
> 
> The script deletes the old signed zones, but don't resign it. The mail is 
> also sent.
> Below the script.
> 
> Anybody an idea why it doesn't work in cron?^ I cannot find any error 
> in any log.

After the first line, add a line saying: set -x

Then set cron to run it and examine the output that gets mailed to you.

The -x tells it to echo each command it is about to execute. That will help you 
to see how far it is getting.

Further comments below.

Cheers
Tony

> Best regards
> Daniel
> 
> 
> #!/bin/bash
> KSKDIR="/etc/named/KSK"
> ZSKDIR="/etc/named/ZSK"
> ZONEDIR="/var/named/chroot/var/named"
> LOG="/var/named/chroot/var/log/dnssec_resign.log"
> MAILREC="monitor@xx"
> 
> #delete old signed files
> rm -rf $ZONEDIR/*.signed
> 
> #delete the old log
> rm -rf $LOG
> 
> #read the zonefiles
> ZONEFILES=$(ls -p $ZONEDIR | grep -v '/$' | grep -v 'dsset*')
> 
> for FILES in $ZONEFILES; do
> #remove the .zone at the end
> ZONE=$(echo "${FILES%.*}")

Why not just: ZONE=${FILES%.*}

> #remove the old signed zone
> rm -rf $ZONEDIR/$ZONE.signed

You deleted them all further up.

> #Sign the zone
> cd $ZONEDIR

Why not do this before the loop? Then you also don't need $ZONEDIR/ everywhere.

> dnssec-signzone -o $ZONE -k $KSKDIR/K$ZONE.*.key -e +3024000 
> -f $ZONE.signed $ZONEDIR/$ZONE.zone $ZSKDIR/K$ZONE.*.key >> $LOG
> 
> #Set the correct permissions
> chown named.named $ZONEDIR/*.signed
> chmod 755 $ZONEDIR/*.signed
> sleep 5
> done
> rm -rf $ZONEDIR/named.zone
> 
> echo $(date +"%T")"DNSSEC-Signierung abgeschlossen - Neustart des 
> Servers" >> $LOG echo "$(cat $LOG)" | mail -s "DNSSEC-Signierung 
> abgeschlossen auf xxx" $MAILREC
> 
> 
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
> 


--
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org 
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script not running correctly as cronjob

2017-02-01 Thread David Both
Do not forget that cron does not use the root environment, such as 
$PATH. You need to set up the exect environment you need in the 
beginning of the crontab file. It would be helpful to see your crontab 
file to know what environment it has set up.


Also the /var/log/cron log file should contain error information that 
might be helpful.



On 02/01/2017 05:04 AM, Tony Mountifield wrote:

In article <86827d81f1944333ae213f2d3f198...@2sic.com>,
Daniel Reich  wrote:

Hi

I have a script to resign all DNS zones every two weeks. When i run the script 
from bash, it works like it should. But
when it is executed in cron not. Its starting normal as cronjob:
Feb  1 03:00:01 xxx CROND[20116]: (root) CMD (sh 
/opt/dnssec/resign_dnssec_zones.sh)

But after i get a mail that everything is finsihed, but it isn't.
03:04:28 DNSSEC-Signierung abgeschlossen

The script deletes the old signed zones, but don't resign it. The mail is also 
sent.
Below the script.

Anybody an idea why it doesn't work in cron?^
I cannot find any error in any log.

After the first line, add a line saying: set -x

Then set cron to run it and examine the output that gets mailed to you.

The -x tells it to echo each command it is about to execute. That will help
you to see how far it is getting.

Further comments below.

Cheers
Tony


Best regards
Daniel


#!/bin/bash
KSKDIR="/etc/named/KSK"
ZSKDIR="/etc/named/ZSK"
ZONEDIR="/var/named/chroot/var/named"
LOG="/var/named/chroot/var/log/dnssec_resign.log"
MAILREC="monitor@xx"

#delete old signed files
rm -rf $ZONEDIR/*.signed

#delete the old log
rm -rf $LOG

#read the zonefiles
ZONEFILES=$(ls -p $ZONEDIR | grep -v '/$' | grep -v 'dsset*')

for FILES in $ZONEFILES; do
#remove the .zone at the end
 ZONE=$(echo "${FILES%.*}")

Why not just: ZONE=${FILES%.*}


#remove the old signed zone
 rm -rf $ZONEDIR/$ZONE.signed

You deleted them all further up.


#Sign the zone
 cd $ZONEDIR

Why not do this before the loop? Then you also don't need $ZONEDIR/ everywhere.


 dnssec-signzone -o $ZONE -k $KSKDIR/K$ZONE.*.key -e +3024000 -f 
$ZONE.signed $ZONEDIR/$ZONE.zone
$ZSKDIR/K$ZONE.*.key >> $LOG

#Set the correct permissions
 chown named.named $ZONEDIR/*.signed
 chmod 755 $ZONEDIR/*.signed
 sleep 5
done
rm -rf $ZONEDIR/named.zone

echo $(date +"%T")"DNSSEC-Signierung abgeschlossen - Neustart des Servers" >> 
$LOG
echo "$(cat $LOG)" | mail -s "DNSSEC-Signierung abgeschlossen auf xxx" $MAILREC


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





--


*
David P. Both, RHCE
Millennium Technology Consulting LLC
Raleigh, NC, USA
919-389-8678

db...@millennium-technology.com

www.millennium-technology.com
www.databook.bz - Home of the DataBook for Linux
DataBook is a Registered Trademark of David Both
*
This communication may be unlawfully collected and stored by the National
Security Agency (NSA) in secret. The parties to this email do not consent to the
retrieving or storing of this communication and any related metadata, as well as
printing, copying, re-transmitting, disseminating, or otherwise using it. If you
believe you have received this communication in error, please delete it
immediately.

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


Re: [CentOS] Script not running correctly as cronjob

2017-02-01 Thread Tony Mountifield
In article <86827d81f1944333ae213f2d3f198...@2sic.com>,
Daniel Reich  wrote:
> Hi
> 
> I have a script to resign all DNS zones every two weeks. When i run the 
> script from bash, it works like it should. But
> when it is executed in cron not. Its starting normal as cronjob:
> Feb  1 03:00:01 xxx CROND[20116]: (root) CMD (sh 
> /opt/dnssec/resign_dnssec_zones.sh)
> 
> But after i get a mail that everything is finsihed, but it isn't.
> 03:04:28 DNSSEC-Signierung abgeschlossen
> 
> The script deletes the old signed zones, but don't resign it. The mail is 
> also sent.
> Below the script.
> 
> Anybody an idea why it doesn't work in cron?^
> I cannot find any error in any log.

After the first line, add a line saying: set -x

Then set cron to run it and examine the output that gets mailed to you.

The -x tells it to echo each command it is about to execute. That will help
you to see how far it is getting.

Further comments below.

Cheers
Tony

> Best regards
> Daniel
> 
> 
> #!/bin/bash
> KSKDIR="/etc/named/KSK"
> ZSKDIR="/etc/named/ZSK"
> ZONEDIR="/var/named/chroot/var/named"
> LOG="/var/named/chroot/var/log/dnssec_resign.log"
> MAILREC="monitor@xx"
> 
> #delete old signed files
> rm -rf $ZONEDIR/*.signed
> 
> #delete the old log
> rm -rf $LOG
> 
> #read the zonefiles
> ZONEFILES=$(ls -p $ZONEDIR | grep -v '/$' | grep -v 'dsset*')
> 
> for FILES in $ZONEFILES; do
> #remove the .zone at the end
> ZONE=$(echo "${FILES%.*}")

Why not just: ZONE=${FILES%.*}

> #remove the old signed zone
> rm -rf $ZONEDIR/$ZONE.signed

You deleted them all further up.

> #Sign the zone
> cd $ZONEDIR

Why not do this before the loop? Then you also don't need $ZONEDIR/ everywhere.

> dnssec-signzone -o $ZONE -k $KSKDIR/K$ZONE.*.key -e +3024000 -f 
> $ZONE.signed $ZONEDIR/$ZONE.zone
> $ZSKDIR/K$ZONE.*.key >> $LOG
> 
> #Set the correct permissions
> chown named.named $ZONEDIR/*.signed
> chmod 755 $ZONEDIR/*.signed
> sleep 5
> done
> rm -rf $ZONEDIR/named.zone
> 
> echo $(date +"%T")"DNSSEC-Signierung abgeschlossen - Neustart des Servers" >> 
> $LOG
> echo "$(cat $LOG)" | mail -s "DNSSEC-Signierung abgeschlossen auf xxx" 
> $MAILREC
> 
> 
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
> 


-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


[CentOS] Script not running correctly as cronjob

2017-02-01 Thread Daniel Reich
Hi

I have a script to resign all DNS zones every two weeks. When i run the script 
from bash, it works like it should. But when it is executed in cron not. Its 
starting normal as cronjob:
Feb  1 03:00:01 xxx CROND[20116]: (root) CMD (sh 
/opt/dnssec/resign_dnssec_zones.sh)

But after i get a mail that everything is finsihed, but it isn't.
03:04:28 DNSSEC-Signierung abgeschlossen

The script deletes the old signed zones, but don't resign it. The mail is also 
sent.
Below the script.

Anybody an idea why it doesn't work in cron?^
I cannot find any error in any log.

Best regards
Daniel


#!/bin/bash
KSKDIR="/etc/named/KSK"
ZSKDIR="/etc/named/ZSK"
ZONEDIR="/var/named/chroot/var/named"
LOG="/var/named/chroot/var/log/dnssec_resign.log"
MAILREC="monitor@xx"

#delete old signed files
rm -rf $ZONEDIR/*.signed

#delete the old log
rm -rf $LOG

#read the zonefiles
ZONEFILES=$(ls -p $ZONEDIR | grep -v '/$' | grep -v 'dsset*')

for FILES in $ZONEFILES; do
#remove the .zone at the end
ZONE=$(echo "${FILES%.*}")

#remove the old signed zone
rm -rf $ZONEDIR/$ZONE.signed

#Sign the zone
cd $ZONEDIR
dnssec-signzone -o $ZONE -k $KSKDIR/K$ZONE.*.key -e +3024000 -f 
$ZONE.signed $ZONEDIR/$ZONE.zone $ZSKDIR/K$ZONE.*.key >> $LOG

#Set the correct permissions
chown named.named $ZONEDIR/*.signed
chmod 755 $ZONEDIR/*.signed
sleep 5
done
rm -rf $ZONEDIR/named.zone

echo $(date +"%T")"DNSSEC-Signierung abgeschlossen - Neustart des Servers" >> 
$LOG
echo "$(cat $LOG)" | mail -s "DNSSEC-Signierung abgeschlossen auf xxx" $MAILREC


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


Re: [CentOS] script to make webpage snapshot

2016-08-12 Thread Anthony K

On 12/08/16 19:55, Anthony K wrote:

On 12/08/16 06:46, Valeri Galtsev wrote:

Dear Experts,

Could someone recommend a script or utility one can run from command 
line

on Linux or UNIX machine to make a snapshot of webpage?

Looks like this *[0]* is what you are after:

CmdShots is a FireFox add-on that takes full-page screenshots through 
the Command-line.



*[0]* https://github.com/omarabid/CmdShots 


For completeness sake, the author first sought a solution on Stack 
Overflow [1].  When one was not forthcoming, he created his own solution.


[1] 
http://stackoverflow.com/questions/13158083/take-a-full-page-screenshot-with-firefox



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


Re: [CentOS] script to make webpage snapshot

2016-08-12 Thread Anthony K

On 12/08/16 06:46, Valeri Galtsev wrote:

Dear Experts,

Could someone recommend a script or utility one can run from command line
on Linux or UNIX machine to make a snapshot of webpage?

Looks like this *[0]* is what you are after:

CmdShots is a FireFox add-on that takes full-page screenshots through 
the Command-line.



*[0]* https://github.com/omarabid/CmdShots


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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Mark Parsons
First time on this list, sorry if I mess up on something.

I use http://wkhtmltopdf.org/ there is a to image version as well. I
haven't had any trouble with it. I've mostly used on Windows but there are
Linux versions.

On Aug 11, 2016 7:09 PM, "Kahlil Hodgson" 
wrote:

> I have some some angularjs sites that I test with protractor and a
> chrome webdriver. I read in the docs at some point that I could take
> and save screenshots if I wanted. You may be able to write a simple
> nodejs script to kick of the webdriver and take the screenhsot.  Or
> someone may have already writen one :-)
>
> https://www.seleniumeasy.com/selenium-tutorials/take-
> screenshot-with-selenium-webdriver
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
>
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Kahlil Hodgson
I have some some angularjs sites that I test with protractor and a
chrome webdriver. I read in the docs at some point that I could take
and save screenshots if I wanted. You may be able to write a simple
nodejs script to kick of the webdriver and take the screenhsot.  Or
someone may have already writen one :-)

https://www.seleniumeasy.com/selenium-tutorials/take-screenshot-with-selenium-webdriver
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Frank Cox
On Thu, 11 Aug 2016 17:19:15 -0500 (CDT)
Valeri Galtsev wrote:

> This involves a person sitting with open web browser and clicking mouse. I
> need to do it for a few webpages once a day, as they change daily. I
> prefer to once spend time on making cron job, and forget about it forever.
> Hence I need it done from command line.

html2ps followed by pstoimg and/or imagemagick to create a graphic from the 
postscript.

-- 
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Valeri Galtsev

On Thu, August 11, 2016 5:27 pm, John R Pierce wrote:
> On 8/11/2016 3:10 PM, Valeri Galtsev wrote:
>> I usually am not good at explaining what I need. I really only need an
>> image of what one would see in web browser if one point to that URL. I
>> do
>> not care it to be interactive. I also don't want to get the content
>> ("mirror") of stuff that URL points to on variety of "depths" - I don't
>> want to use wget or curl for this reason. That is what I tried first and
>> it breaks with at lest one of the web sites - they do seem protect
>> themselves from "robots" or similar. And we don't need it. We just need
>> to
>> show what they page shows today, that's all.
>
> then screen capture is about it too many sites, ALL the content is
> dynamic, for instance,
> https://www.google.com/maps/@36.9460899,-122.0268105,664a,20y,41.31t/data=!3m1!1e3
>
> that page is composed of tiles of image data superimposed on the fly
> with ajax code running in the browser to fetch the layers displayed.
>
> you simply can't fetch the html and make any sense out of it, the
> browser is running a complex application to display that.
>

Yes, I understand as much, thanks. I'm still sure it is not hopeless task.

Valeri


Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread John R Pierce

On 8/11/2016 3:10 PM, Valeri Galtsev wrote:

I usually am not good at explaining what I need. I really only need an
image of what one would see in web browser if one point to that URL. I do
not care it to be interactive. I also don't want to get the content
("mirror") of stuff that URL points to on variety of "depths" - I don't
want to use wget or curl for this reason. That is what I tried first and
it breaks with at lest one of the web sites - they do seem protect
themselves from "robots" or similar. And we don't need it. We just need to
show what they page shows today, that's all.


then screen capture is about it too many sites, ALL the content is 
dynamic, for instance, 
https://www.google.com/maps/@36.9460899,-122.0268105,664a,20y,41.31t/data=!3m1!1e3


that page is composed of tiles of image data superimposed on the fly 
with ajax code running in the browser to fetch the layers displayed.


you simply can't fetch the html and make any sense out of it, the 
browser is running a complex application to display that.



--
john r pierce, recycling bits in santa cruz

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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Michael Abbondanza
Could try https://screenshotlayer.com/

I have had success automating their API.

On Thu, Aug 11, 2016 at 3:19 PM, Valeri Galtsev 
wrote:

>
>
> On Thu, August 11, 2016 5:13 pm, Dave Stevens wrote:
> > Quoting Valeri Galtsev :
> >
> >>
> >> On Thu, August 11, 2016 5:02 pm, John R Pierce wrote:
> >>> On 8/11/2016 1:46 PM, Valeri Galtsev wrote:
>  Could someone recommend a script or utility one can run from command
> line
>  on Linux or UNIX machine to make a snapshot of webpage?
> 
>  We have a signage (xibo) and whoever creates/changes content, likes
> to add
>  URLs of some webpages there. All works well if these are webpages on
> our
>  servers (which are pretty fast), but some external servers often take
> time
>  to respond and take time to assemble the page, in addition these
> servers
>  sometimes get really busy, and when response is longer than time
> devoted
>  for that content in signage window, this window hangs forever with
> blank
>  white field until you restart client. Trivial workaround: just to get
> snapshot (as, say daily cron job), and point signage client to that
> snapshot definitely will solve it, and simultaneously we will stop
> bugging
>  other people servers often without much need for it.
> 
>  But when I tried to search for some utility or script that makes
> webpage
>  snapshot, I discovered that my ability to search degraded somehow...
> >>>
> >>> many/most webpages these days are heavily dynamic content, a static
> snapshot would likely break.  plus any site-relative links on that
> snapshot would be pointing to your server, not the original, any ajax
> code on that webpage would try to interact with your server which
> won't be running the right back end stuff, etcetc.
> >>
> >> I usually am not good at explaining what I need. I really only need an
> image of what one would see in web browser if one point to that URL. I
> do
> >> not care it to be interactive. I also don't want to get the content
> ("mirror") of stuff that URL points to on variety of "depths" - I don't
> want to use wget or curl for this reason. That is what I tried first
> and it breaks with at lest one of the web sites - they do seem protect
> themselves from "robots" or similar. And we don't need it. We just need
> to
> >> show what they page shows today, that's all.
> >>
> >> Valeri
> >
> > why not File -> Print -> .pdf?
>
> This involves a person sitting with open web browser and clicking mouse. I
> need to do it for a few webpages once a day, as they change daily. I
> prefer to once spend time on making cron job, and forget about it forever.
> Hence I need it done from command line.
>
> Valeri
>
> >
> > D
> >
> >>
> >>>
> >>> --
> >>> john r pierce, recycling bits in santa cruz
> >>>
> >>
> >>
> >> 
> >> Valeri Galtsev
> >> Sr System Administrator
> >> Department of Astronomy and Astrophysics
> >> Kavli Institute for Cosmological Physics
> >> University of Chicago
> >> Phone: 773-702-4247
> >> 
> >> ___
> >> CentOS mailing list
> >> CentOS@centos.org
> >> https://lists.centos.org/mailman/listinfo/centos
> >>
> >
> >
> >
> > --
> > "As long as politics is the shadow cast on society by big business, the
> attenuation of the shadow will not change the substance."
> >
> > -- John Dewey
> >
> >
> >
> >
> >
>
>
> 
> Valeri Galtsev
> Sr System Administrator
> Department of Astronomy and Astrophysics
> Kavli Institute for Cosmological Physics
> University of Chicago
> Phone: 773-702-4247
> 
>
> ___
> CentOS mailing list
> CentOS@centos.org
> https://lists.centos.org/mailman/listinfo/centos
>



-- 

Michael Abbondanza

Technical Support Engineer

408-479-2207


Now Available - Free Hadoop On-Demand Training

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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Valeri Galtsev


On Thu, August 11, 2016 5:13 pm, Dave Stevens wrote:
> Quoting Valeri Galtsev :
>
>>
>> On Thu, August 11, 2016 5:02 pm, John R Pierce wrote:
>>> On 8/11/2016 1:46 PM, Valeri Galtsev wrote:
 Could someone recommend a script or utility one can run from command
line
 on Linux or UNIX machine to make a snapshot of webpage?

 We have a signage (xibo) and whoever creates/changes content, likes
to add
 URLs of some webpages there. All works well if these are webpages on our
 servers (which are pretty fast), but some external servers often take
time
 to respond and take time to assemble the page, in addition these servers
 sometimes get really busy, and when response is longer than time devoted
 for that content in signage window, this window hangs forever with blank
 white field until you restart client. Trivial workaround: just to get
snapshot (as, say daily cron job), and point signage client to that
snapshot definitely will solve it, and simultaneously we will stop
bugging
 other people servers often without much need for it.

 But when I tried to search for some utility or script that makes webpage
 snapshot, I discovered that my ability to search degraded somehow...
>>>
>>> many/most webpages these days are heavily dynamic content, a static
snapshot would likely break.  plus any site-relative links on that
snapshot would be pointing to your server, not the original, any ajax
code on that webpage would try to interact with your server which
won't be running the right back end stuff, etcetc.
>>
>> I usually am not good at explaining what I need. I really only need an
image of what one would see in web browser if one point to that URL. I
do
>> not care it to be interactive. I also don't want to get the content
("mirror") of stuff that URL points to on variety of "depths" - I don't
want to use wget or curl for this reason. That is what I tried first
and it breaks with at lest one of the web sites - they do seem protect
themselves from "robots" or similar. And we don't need it. We just need
to
>> show what they page shows today, that's all.
>>
>> Valeri
>
> why not File -> Print -> .pdf?

This involves a person sitting with open web browser and clicking mouse. I
need to do it for a few webpages once a day, as they change daily. I
prefer to once spend time on making cron job, and forget about it forever.
Hence I need it done from command line.

Valeri

>
> D
>
>>
>>>
>>> --
>>> john r pierce, recycling bits in santa cruz
>>>
>>
>>
>> 
>> Valeri Galtsev
>> Sr System Administrator
>> Department of Astronomy and Astrophysics
>> Kavli Institute for Cosmological Physics
>> University of Chicago
>> Phone: 773-702-4247
>> 
>> ___
>> CentOS mailing list
>> CentOS@centos.org
>> https://lists.centos.org/mailman/listinfo/centos
>>
>
>
>
> --
> "As long as politics is the shadow cast on society by big business, the
attenuation of the shadow will not change the substance."
>
> -- John Dewey
>
>
>
>
>



Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247


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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Valeri Galtsev

On Thu, August 11, 2016 4:13 pm, Liam O'Toole wrote:
> On 2016-08-11, Valeri Galtsev
>  wrote:
>> Dear Experts,
>>
>> Could someone recommend a script or utility one can run from command
>> line on Linux or UNIX machine to make a snapshot of webpage?
>>
>> We have a signage (xibo) and whoever creates/changes content, likes to
>> add URLs of some webpages there. All works well if these are webpages
>> on our servers (which are pretty fast), but some external servers
>> often take time to respond and take time to assemble the page, in
>> addition these servers sometimes get really busy, and when response is
>> longer than time devoted for that content in signage window, this
>> window hangs forever with blank white field until you restart client.
>> Trivial workaround: just to get snapshot (as, say daily cron job), and
>> point signage client to that snapshot definitely will solve it, and
>> simultaneously we will stop bugging other people servers often without
>> much need for it.
>>
>> But when I tried to search for some utility or script that makes
>> webpage snapshot, I discovered that my ability to search degraded
>> somehow...
>>
>> Thanks for all your pointers!
>>
>> Valeri
>
> Not an answer to the question you asked, but maybe this is a job for a
> caching proxy server like squid?
>

Thanks! It didn't occur to me. It will be much more sophisticated than
just an image "snapshot" of the webpage, but should solve our problem. If
I don't find anything doing "snapshot" successfully, this is what I will
do.

Valeri


Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Dave Stevens

Quoting Valeri Galtsev :



On Thu, August 11, 2016 5:02 pm, John R Pierce wrote:

On 8/11/2016 1:46 PM, Valeri Galtsev wrote:

Could someone recommend a script or utility one can run from command
line
on Linux or UNIX machine to make a snapshot of webpage?

We have a signage (xibo) and whoever creates/changes content, likes to
add
URLs of some webpages there. All works well if these are webpages on our
servers (which are pretty fast), but some external servers often take
time
to respond and take time to assemble the page, in addition these servers
sometimes get really busy, and when response is longer than time devoted
for that content in signage window, this window hangs forever with blank
white field until you restart client. Trivial workaround: just to get
snapshot (as, say daily cron job), and point signage client to that
snapshot definitely will solve it, and simultaneously we will stop
bugging
other people servers often without much need for it.

But when I tried to search for some utility or script that makes webpage
snapshot, I discovered that my ability to search degraded somehow...


many/most webpages these days are heavily dynamic content, a static
snapshot would likely break.  plus any site-relative links on that
snapshot would be pointing to your server, not the original, any ajax
code on that webpage would try to interact with your server which won't
be running the right back end stuff, etcetc.


I usually am not good at explaining what I need. I really only need an
image of what one would see in web browser if one point to that URL. I do
not care it to be interactive. I also don't want to get the content
("mirror") of stuff that URL points to on variety of "depths" - I don't
want to use wget or curl for this reason. That is what I tried first and
it breaks with at lest one of the web sites - they do seem protect
themselves from "robots" or similar. And we don't need it. We just need to
show what they page shows today, that's all.

Valeri


why not File -> Print -> .pdf?

D





--
john r pierce, recycling bits in santa cruz





Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

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





--
"As long as politics is the shadow cast on society by big business,
the attenuation of the shadow will not change the substance."

-- John Dewey





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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Valeri Galtsev

On Thu, August 11, 2016 5:02 pm, John R Pierce wrote:
> On 8/11/2016 1:46 PM, Valeri Galtsev wrote:
>> Could someone recommend a script or utility one can run from command
>> line
>> on Linux or UNIX machine to make a snapshot of webpage?
>>
>> We have a signage (xibo) and whoever creates/changes content, likes to
>> add
>> URLs of some webpages there. All works well if these are webpages on our
>> servers (which are pretty fast), but some external servers often take
>> time
>> to respond and take time to assemble the page, in addition these servers
>> sometimes get really busy, and when response is longer than time devoted
>> for that content in signage window, this window hangs forever with blank
>> white field until you restart client. Trivial workaround: just to get
>> snapshot (as, say daily cron job), and point signage client to that
>> snapshot definitely will solve it, and simultaneously we will stop
>> bugging
>> other people servers often without much need for it.
>>
>> But when I tried to search for some utility or script that makes webpage
>> snapshot, I discovered that my ability to search degraded somehow...
>
> many/most webpages these days are heavily dynamic content, a static
> snapshot would likely break.  plus any site-relative links on that
> snapshot would be pointing to your server, not the original, any ajax
> code on that webpage would try to interact with your server which won't
> be running the right back end stuff, etcetc.

I usually am not good at explaining what I need. I really only need an
image of what one would see in web browser if one point to that URL. I do
not care it to be interactive. I also don't want to get the content
("mirror") of stuff that URL points to on variety of "depths" - I don't
want to use wget or curl for this reason. That is what I tried first and
it breaks with at lest one of the web sites - they do seem protect
themselves from "robots" or similar. And we don't need it. We just need to
show what they page shows today, that's all.

Valeri

>
> --
> john r pierce, recycling bits in santa cruz
>



Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread John R Pierce

On 8/11/2016 1:46 PM, Valeri Galtsev wrote:

Could someone recommend a script or utility one can run from command line
on Linux or UNIX machine to make a snapshot of webpage?

We have a signage (xibo) and whoever creates/changes content, likes to add
URLs of some webpages there. All works well if these are webpages on our
servers (which are pretty fast), but some external servers often take time
to respond and take time to assemble the page, in addition these servers
sometimes get really busy, and when response is longer than time devoted
for that content in signage window, this window hangs forever with blank
white field until you restart client. Trivial workaround: just to get
snapshot (as, say daily cron job), and point signage client to that
snapshot definitely will solve it, and simultaneously we will stop bugging
other people servers often without much need for it.

But when I tried to search for some utility or script that makes webpage
snapshot, I discovered that my ability to search degraded somehow...


many/most webpages these days are heavily dynamic content, a static 
snapshot would likely break.  plus any site-relative links on that 
snapshot would be pointing to your server, not the original, any ajax 
code on that webpage would try to interact with your server which won't 
be running the right back end stuff, etcetc.


--
john r pierce, recycling bits in santa cruz

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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Liam O'Toole
On 2016-08-11, Valeri Galtsev
 wrote:
> Dear Experts,
>
> Could someone recommend a script or utility one can run from command
> line on Linux or UNIX machine to make a snapshot of webpage?
>
> We have a signage (xibo) and whoever creates/changes content, likes to
> add URLs of some webpages there. All works well if these are webpages
> on our servers (which are pretty fast), but some external servers
> often take time to respond and take time to assemble the page, in
> addition these servers sometimes get really busy, and when response is
> longer than time devoted for that content in signage window, this
> window hangs forever with blank white field until you restart client.
> Trivial workaround: just to get snapshot (as, say daily cron job), and
> point signage client to that snapshot definitely will solve it, and
> simultaneously we will stop bugging other people servers often without
> much need for it.
>
> But when I tried to search for some utility or script that makes
> webpage snapshot, I discovered that my ability to search degraded
> somehow...
>
> Thanks for all your pointers!
>
> Valeri

Not an answer to the question you asked, but maybe this is a job for a
caching proxy server like squid?

-- 

Liam

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


Re: [CentOS] script to make webpage snapshot

2016-08-11 Thread Frank Cox
On Thu, 11 Aug 2016 15:46:42 -0500 (CDT)
Valeri Galtsev wrote:

> Could someone recommend a script or utility one can run from command line
> on Linux or UNIX machine to make a snapshot of webpage?

wget?
httrack?

-- 
MELVILLE THEATRE ~ Real D 3D Digital Cinema ~ www.melvilletheatre.com
___
CentOS mailing list
CentOS@centos.org
https://lists.centos.org/mailman/listinfo/centos


[CentOS] script to make webpage snapshot

2016-08-11 Thread Valeri Galtsev
Dear Experts,

Could someone recommend a script or utility one can run from command line
on Linux or UNIX machine to make a snapshot of webpage?

We have a signage (xibo) and whoever creates/changes content, likes to add
URLs of some webpages there. All works well if these are webpages on our
servers (which are pretty fast), but some external servers often take time
to respond and take time to assemble the page, in addition these servers
sometimes get really busy, and when response is longer than time devoted
for that content in signage window, this window hangs forever with blank
white field until you restart client. Trivial workaround: just to get
snapshot (as, say daily cron job), and point signage client to that
snapshot definitely will solve it, and simultaneously we will stop bugging
other people servers often without much need for it.

But when I tried to search for some utility or script that makes webpage
snapshot, I discovered that my ability to search degraded somehow...

Thanks for all your pointers!

Valeri

Valeri Galtsev
Sr System Administrator
Department of Astronomy and Astrophysics
Kavli Institute for Cosmological Physics
University of Chicago
Phone: 773-702-4247

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


Re: [CentOS] script network reconfig after Centos 5-6 upgrade?

2013-07-17 Thread Philip Manuel

On 18/07/13 07:12, Les Mikesell wrote:
 I need to upgrade a bunch of centos  5 servers to 6.x in the near
 future, mostly keeping the same connectivity and functionality.Are
 there any tools that will examine a running 5.x box and produce the
 appropriate /etc/udev/rules.d/70-persistent-net.rules (etc). to make
 the same box come up with the same interface names with the same IPs
 it had before?

 --
Les Mikesell
  lesmikes...@gmail.com
 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos
We use a combination of puppet and extract, 
http://www.openfusion.net/sysadmin/extract
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script network reconfig after Centos 5-6 upgrade?

2013-07-17 Thread Erick Ocrospoma
Definitely, Puppet is what you need.


~ Happy install !




Cellphone   :  +51 950307809
Blog   :  http://piobox.blogspot.com/
LUG   :  http://www.utpinux.org
Linux User ID :  549567
IRC:   zerick
About :  http://about.me/zerick

--
sı ɯǝ1qoɹd ɹnoʎ ʇɐɥʍ ǝǝs ı ʞuıɥʇ ı


On 17 July 2013 17:53, Philip Manuel p...@zomojo.com wrote:


 On 18/07/13 07:12, Les Mikesell wrote:
  I need to upgrade a bunch of centos  5 servers to 6.x in the near
  future, mostly keeping the same connectivity and functionality.Are
  there any tools that will examine a running 5.x box and produce the
  appropriate /etc/udev/rules.d/70-persistent-net.rules (etc). to make
  the same box come up with the same interface names with the same IPs
  it had before?
 
  --
 Les Mikesell
   lesmikes...@gmail.com
  ___
  CentOS mailing list
  CentOS@centos.org
  http://lists.centos.org/mailman/listinfo/centos
 We use a combination of puppet and extract,
 http://www.openfusion.net/sysadmin/extract
 ___
 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] script network reconfig after Centos 5-6 upgrade?

2013-07-17 Thread Les Mikesell
On Wed, Jul 17, 2013 at 5:54 PM, Erick Ocrospoma zipper1...@gmail.com wrote:
 Definitely, Puppet is what you need.

How would puppet do anything before the IPs get assigned to the right NICs?

--
   Les Mikesell
 lesmikes...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] Script for enabling screen savers in GNOME and KDE on Centos 5.x

2012-03-27 Thread ankush grover
Hi Friends,

I am trying to configure screensavers settings on Gnome and KDE
running Centos 5.x 32-bit environment. I need to prepare a script
which will be push by Puppet and this script should be able to change
settings like idle_delay, set customized password-protected screen
saver, enabling lock etc..

I have tried below commands for Gnome and somehow the settings are not
taking place. The users screensavers setting remains the same.

Gnome Settings:
gconftool-2 --direct --config-source
xml:readwrite:/etc/gconf/gconf.xml.mandatory --type int  --set
/apps/gnome-screensaver/idle_delay 4
gconftool-2 --direct --config-source
xml:readwrite:/etc/gconf/gconf.xml.mandatory --type boolean --set
/apps/gnome-screensaver/lock_enabled true
gconftool-2 --direct --config-source
xml:readwrite:/etc/gconf/gconf.xml.mandatory --type boolean  --set
/apps/gnome-screensaver/idle_activation_enabled true
gconftool-2 --direct --config-source
xml:readwrite:/etc/gconf/gconf.xml.defaults --set --type list
--list-type=string /apps/gnome-screensaver/themes [blank-only]


On KDE I am not able to get what settings should be there for enabling
idle_delay, activating the customized password protected screen saver
etc..

KDE Settings
$ qdbus org.freedesktop.ScreenSaver /ScreenSaver


Do let me know whether any more information is required or not.


Regards

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


Re: [CentOS] script regular expression

2012-02-10 Thread Marc Deop
On Thursday 09 February 2012 23:38:51 sheraz naz wrote:
  #/bin/bash
  for i in $(cat certificates.txt)
  do  
  echo $i 
  done
  

Bad practice.
 
 Try:
 while read i;do echo $i;done  certificates.txt
 -- 

That's the right solution, but don't forget to always quote your variables $i

Regards

PS: you sometimes might need read -r

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


Re: [CentOS] script regular expression

2012-02-10 Thread Steve Brooks

On Thu, 9 Feb 2012, Alejandro Rodriguez Luna wrote:


Hi everyone, I was creating a script and i found something i can't figure out.

#/bin/bash
for i in $(cat certificates.txt)
do 
    echo $i
done

I expected this

RSA Secure Server Certification Authority
VeriSign Class 1 CA Individual Subscriber-Persona Not Validated


but i got this

RSA
Secure
Server
Certification
Authority
VeriSign
Class
1
CA
Individual
Subscriber-Persona
Not
Validated

 any ideas how to fix this? i mean, how can i get the whole line instead of 
word by word?


This will make it work your way.


#!/bin/sh

IFS=

for i in `cat certificates.txt` ; do
  echo $i
done


Cheers,

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


Re: [CentOS] script regular expression

2012-02-10 Thread Leonard den Ottolander
Hello Alejandro,

On Thu, 2012-02-09 at 23:29 -0800, Alejandro Rodriguez Luna wrote:
 #/bin/bash
 for i in $(cat certificates.txt)
 do  
 echo $i 
 done

(As people already pointed out in case the input is coming from a file
you should use a redirect.)

What you see has to do with the internal field separator (IFS), which is
usually set to space, tab and newline. Each of these characters is
considered a field separator i.e. a break point in your list. You can
read up on this at
http://www.tldp.org/LDP/abs/html/internalvariables.html#IFSH .

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] script regular expression

2012-02-10 Thread m . roth
Steve Brooks wrote:
 On Thu, 9 Feb 2012, Alejandro Rodriguez Luna wrote:

 Hi everyone, I was creating a script and i found something i can't
 figure out.

 #/bin/bash
 for i in $(cat certificates.txt)
 do 
     echo $i
 done

 I expected this

 RSA Secure Server Certification Authority
 VeriSign Class 1 CA Individual Subscriber-Persona Not Validated


 but i got this

 RSA
 Secure
snip

Sure will. i is in the list RSA Secure etc. and each word is a member of
the list, separated by whitespace. Y'know, it would be a lot easier to do
awk '{print $0;}' certificates.txt, which would be exactly what you want.

   mark


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


Re: [CentOS] script regular expression

2012-02-10 Thread Alejandro Rodriguez Luna
THanks all who gave me an answer, i found this doc and helped me. Thanks again

http://mywiki.wooledge.org/DontReadLinesWithFor

 
--
Alejandro Rodriguez Luna
E-mail: el_alexl...@yahoo.com.mx
Movil: 044-311-112-86-41
--



 De: m.r...@5-cent.us m.r...@5-cent.us
Para: CentOS mailing list centos@centos.org 
Enviado: Viernes, 10 de febrero, 2012 9:59:35
Asunto: Re: [CentOS] script regular expression
 
Steve Brooks wrote:
 On Thu, 9 Feb 2012, Alejandro Rodriguez Luna wrote:

 Hi everyone, I was creating a script and i found something i can't
 figure out.

 #/bin/bash
 for i in $(cat certificates.txt)
 do 
     echo $i
 done

 I expected this

 RSA Secure Server Certification Authority
 VeriSign Class 1 CA Individual Subscriber-Persona Not Validated


 but i got this

 RSA
 Secure
snip

Sure will. i is in the list RSA Secure etc. and each word is a member of
the list, separated by whitespace. Y'know, it would be a lot easier to do
awk '{print $0;}' certificates.txt, which would be exactly what you want.

       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


[CentOS] script regular expression

2012-02-09 Thread Alejandro Rodriguez Luna
Hi everyone, I was creating a script and i found something i can't figure out.

#/bin/bash
for i in $(cat certificates.txt)
do  
    echo $i 
done

I expected this

RSA Secure Server Certification Authority
VeriSign Class 1 CA Individual Subscriber-Persona Not Validated


but i got this

RSA
Secure
Server
Certification
Authority
VeriSign
Class
1
CA
Individual
Subscriber-Persona
Not
Validated

 any ideas how to fix this? i mean, how can i get the whole line instead of 
word by word?

 
--
Alejandro Rodriguez Luna
E-mail: el_alexl...@yahoo.com.mx
Movil: 044-311-112-86-41
--



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


Re: [CentOS] script regular expression

2012-02-09 Thread sheraz naz


--- On Fri, 2/10/12, Alejandro Rodriguez Luna el_alexl...@yahoo.com.mx wrote:

 From: Alejandro Rodriguez Luna el_alexl...@yahoo.com.mx
 Subject: [CentOS]  script regular expression
 To: CentOS mailing list centos@centos.org
 Date: Friday, February 10, 2012, 1:29 AM
 Hi everyone, I was creating a script
 and i found something i can't figure out.
 
 #/bin/bash
 for i in $(cat certificates.txt)
 do  
     echo $i 
 done
 
 I expected this
 
 RSA Secure Server Certification Authority
 VeriSign Class 1 CA Individual Subscriber-Persona Not
 Validated
 
 
 but i got this
 
 RSA
 Secure
 Server
 Certification
 Authority
 VeriSign
 Class
 1
 CA
 Individual
 Subscriber-Persona
 Not
 Validated
 
  any ideas how to fix this? i mean, how can i get the whole
 line instead of word by word?

Try:
while read i;do echo $i;done  certificates.txt

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


[CentOS] Script to sync with repo

2011-07-20 Thread Jerry Geis
under 5.6 I have a script that runs every night to rsync the repodata 
for local installations.
I added the 6.0 to do the same.

Something seems wrong now for 6.0. I do the same thing and I get errors 
from my local repo at install time.
Seems like the cyrus-sasl package is never happy and aborts the 
installation.

Is something wrong with the script below? It seems like it successfully 
copies the files.
I ran it manually and did not see any errors.

Any thoughts?

Thanks,

Jerry

# The kickstart files point to the repo
#
# This file will creat the directories and copy the files
#
for VERSION in 5.6 6.0
do
mkdir -p /var/www/html/centos/$VERSION/updates/x86_64/RPMS
mkdir -p /var/www/html/centos/$VERSION/updates/x86_64/repodata

rsync -av 
rsync://mirrors.kernel.org/mirrors/centos/$VERSION/updates/x86_64/RPMS/* 
/var/www/html/centos/$VERSION/updates/x86_64/RPMS
rsync -av 
rsync://mirrors.kernel.org/mirrors/centos/$VERSION/updates/x86_64/repodata/* 
/var/www/html/centos/$VERSION/updates/x86_64/repodata
done
~  
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script to sync with repo

2011-07-20 Thread Joseph L. Casale
for VERSION in 5.6 6.0

Check your httpd error log for a 404:)
Just a WAG, I presume you modified your 5x installs to not look in the default
5 location, where point releases get symlinked too once they are current.

Your 6.0 install looks for a 6 directory.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script to sync with repo

2011-07-20 Thread Devin Reade
Also try an invocation of rsync with the checksum flag; that'll 
catch any files that might be corrupted.  It does increase server
load and rsync run time, though, so you should probably disable it
again afterwards.

Devin

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


Re: [CentOS] Script to sync with repo

2011-07-20 Thread Joseph L. Casale
It does increase server
load and rsync run time, though, so you should probably disable it
again afterwards.

That's why most repo's don't allow the use of it, I use the same master
as you Jerry, and they are certainly far too large to allow that.

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


Re: [CentOS] Script to sync with repo

2011-07-20 Thread Paul Heinlein
On Wed, 20 Jul 2011, Jerry Geis wrote:

 under 5.6 I have a script that runs every night to rsync the repodata
 for local installations.
 I added the 6.0 to do the same.

 Something seems wrong now for 6.0. I do the same thing and I get errors
 from my local repo at install time.
 Seems like the cyrus-sasl package is never happy and aborts the
 installation.

 Is something wrong with the script below? It seems like it successfully
 copies the files.
 I ran it manually and did not see any errors.

 Any thoughts?

 Thanks,

 Jerry

 # The kickstart files point to the repo
 #
 # This file will creat the directories and copy the files
 #
 for VERSION in 5.6 6.0
 do
mkdir -p /var/www/html/centos/$VERSION/updates/x86_64/RPMS
mkdir -p /var/www/html/centos/$VERSION/updates/x86_64/repodata

rsync -av
 rsync://mirrors.kernel.org/mirrors/centos/$VERSION/updates/x86_64/RPMS/*
 /var/www/html/centos/$VERSION/updates/x86_64/RPMS
rsync -av
 rsync://mirrors.kernel.org/mirrors/centos/$VERSION/updates/x86_64/repodata/*
 /var/www/html/centos/$VERSION/updates/x86_64/repodata
 done

Here's my script. Obviously, it picks up the os/ tree as well as the 
updates/ tree. So far, no problems with 5.x or 6.x:

#!/bin/sh
for VERS in 5.6 6.0; do
   SRC=ftp.osuosl.org::centos/${VERS}/
   DEST=/srv/mirrors/centos/${VERS}/
   echo ---
   echo Sync-ing CentOS $VERS with $SRC
   echo
   /usr/bin/rsync -avSH \
 --exclude isos --exclude centosplus --exclude extras \
 $SRC $DEST
   echo ---
done

-- 
Paul Heinlein  heinl...@madboa.com  http://www.madboa.com/
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] Script Problem

2011-04-17 Thread Matt
I have a script I put in /etc/cron.fiveminutes

graphs.sh

#!/bin/sh
env LANG=C mrtg
/home/admin/domains/my---server.com/public_html/traffic/load/mrtg.cfg
--logging /dev/null /dev/null 21
env LANG=C mrtg
/home/admin/domains/my---server.com/public_html/traffic/eth0/mrtg.cfg
--logging /dev/null /dev/null 21
#exit 0;

Problem is there is some bug that raises an error even though mrtg
still graphs fine.

[root@server cron.fiveminutes]# env LANG=C mrtg
/home/admin/domains/my---server.com/public_html/traffic/eth0/mrtg.cfg
--logging /dev/null
Subroutine SNMPv1_Session::AF_INET6 redefined at
/usr/lib/perl5/5.8.8/Exporter.pm line 65.
 at /usr/bin/../lib64/mrtg2/SNMP_Session.pm line 594
Subroutine main::AF_INET6 redefined at /usr/lib/perl5/5.8.8/Exporter.pm line 65.
 at /usr/bin/mrtg line 97
/usr/bin/rateup: /usr/local/lib/libpng12.so.0: no version information
available (required by /usr/lib64/libgd.so.2)


The issue is it tries to alert root every time this script is run.  I
thought adding the /dev/null 21 would stop that but it does not.
Is there anyway to get the script to ignore the error and not alert
root?

Another solution is to install a newer version of mrtg from source
which supposedly resolves the issue but I would rather just ignore the
error for now until a newer 64bit rpm comes out since its not hurting
anything except the annoying warning messages.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] script question

2011-03-31 Thread Jerry Geis
I can do simply search and replace with sed.
However, I want to setup httpd.conf from a script
that changes the default / which is presently:

Directory /
Options FollowSymLinks
AllowOverride None
/Directory

and change it to the following:

Directory /
Order Deny,Allow
Deny from all
AllowOverride None
/Directory

How do you do that with scripts? Basically substitute everything between 
the two Directory tags.

Thanks,

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


Re: [CentOS] script question

2011-03-31 Thread Bill Campbell
On Thu, Mar 31, 2011, Jerry Geis wrote:
I can do simply search and replace with sed.
However, I want to setup httpd.conf from a script
that changes the default / which is presently:

While this can be done with sed, it's generally a lot easier to do with
python or perl, particularly when dealing with multi-line replacement
patterns.

It was this type of job that led me to perl in the late 1980s as perl was a
lot easier to understand than advanced sed features, and there was only one
regular expression syntax to remember.  Currently I use python for most
things, but don't want to start a scripting language wars thread here.

There's a very useful script 'replace' in the Kernighan and Pike book The
Unix Programming Environment which uses sed for in-place replacements as
an example of exception handling (MySQL has a similar 'replace' script but
with different arguments which tells me that their developers hadn't done
much basic *nix study as this book, while old, is still excellent).

The best book I've ever read on sed is Unix Text Processing by Dougherty
and O'Reilly which covers many *nix utilities.

Directory /
Options FollowSymLinks
AllowOverride None
/Directory

and change it to the following:

Directory /
Order Deny,Allow
Deny from all
AllowOverride None
/Directory

How do you do that with scripts? Basically substitute everything between 
the two Directory tags.

Thanks,

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


-- 
Bill
-- 
INTERNET:   b...@celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:  (206) 236-1676  Mercer Island, WA 98040-0820
Fax:(206) 232-9186  Skype: jwccsllc (206) 855-5792

It's just got so that 90 percent of the people in this country don't give
a damn.  Politics ain't worrying this country one tenth as much as parking
space. -- Will Rogers
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script question

2011-03-31 Thread Emmett Culley
On 03/31/2011 05:25 AM, Jerry Geis wrote:
 I can do simply search and replace with sed.
 However, I want to setup httpd.conf from a script
 that changes the default / which is presently:
 
 Directory /
  Options FollowSymLinks
  AllowOverride None
 /Directory
 
 and change it to the following:
 
 Directory /
  Order Deny,Allow
  Deny from all
  AllowOverride None
 /Directory
 
 How do you do that with scripts? Basically substitute everything between
 the two Directory tags.
 
 Thanks,
 
 Jerry
 ___
 CentOS mailing list
 CentOS@centos.org
 http://lists.centos.org/mailman/listinfo/centos
 
 
Try:

sed -i /Directory \//,/\/Directory/ s|Options FollowSymLinks|Order 
Deny,Allow\n Deny from all| /etc/httpd/conf/httpd.conf 
___
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 m.r...@5-cent.us escribió:

De: m.r...@5-cent.us m.r...@5-cent.us
Asunto: Re: [CentOS] Script Output Format
A: CentOS mailing list centos@centos.org
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


[CentOS] Script Output Format

2010-12-29 Thread Alejandro Rodriguez Luna
Hi all!

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


--

Alejandro Rodriguez Luna

Movil: 044-311-112-86-41

--


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


Re: [CentOS] Script Output Format

2010-12-29 Thread m . roth
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] script question

2010-06-11 Thread Jerry Geis
Hi all,


in a script if I have:
VERSION=3.2.0

I can do:
echo jj-$VERSION-jj
and get jj-3.2.0-jj

however if I do:
echo jj_$VERSION_jj
I get jj_

How do I get the $VERSION to work with the underscores like the dashes do.

Thanks,

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


Re: [CentOS] script question

2010-06-11 Thread Kwan Lowe
On Fri, Jun 11, 2010 at 10:04 AM, Jerry Geis ge...@pagestation.com wrote:

 Hi all,


 in a script if I have:
 VERSION=3.2.0

 I can do:
 echo jj-$VERSION-jj
 and get jj-3.2.0-jj

 however if I do:
 echo jj_$VERSION_jj
 I get jj_

 How do I get the $VERSION to work with the underscores like the dashes do.


You can use ${VERSION} to separate it.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script question

2010-06-11 Thread Christoph Neuhaus
 however if I do:
 echo jj_$VERSION_jj
 I get jj_

 How do I get the $VERSION to work with the underscores like the dashes  
 do.

echo jj_${VERSION}_jj
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script question

2010-06-11 Thread Brunner, Brian T.

  
 How do I get the $VERSION to work with the underscores like 
 the dashes do.

echo JJ\_$VERSION\_JJ
***
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager. This footnote also confirms that this
email message has been swept for the presence of computer viruses.
www.Hubbell.com - Hubbell Incorporated**

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


Re: [CentOS] script question

2010-06-11 Thread Bob Beers
On Fri, Jun 11, 2010 at 10:04 AM, Jerry Geis ge...@pagestation.com wrote:
 Hi all,


 in a script if I have:
 VERSION=3.2.0

 I can do:
 echo jj-$VERSION-jj
 and get jj-3.2.0-jj

 however if I do:
 echo jj_$VERSION_jj
 I get jj_

 How do I get the $VERSION to work with the underscores like the dashes do.

I see 4 ways:

echo jj_${VERSION}_jj

echo jj_$VERSION_jj

echo jj-$VERSION-jj | tr '-' '_'

printf jj_%s_jj $VERSION

I am sure there are others.

HTH,

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


Re: [CentOS] script question

2010-06-11 Thread m . roth
 On Fri, Jun 11, 2010 at 10:04 AM, Jerry Geis ge...@pagestation.com
 wrote:
 in a script if I have:
 VERSION=3.2.0

 I can do:
 echo jj-$VERSION-jj
 and get jj-3.2.0-jj

 however if I do:
 echo jj_$VERSION_jj
 I get jj_

 How do I get the $VERSION to work with the underscores like the dashes

echo \_$VERSION\_

   mark

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


Re: [CentOS] script question

2010-06-11 Thread John Doe
From: m.r...@5-cent.us m.r...@5-cent.us
 On Fri, Jun 11, 2010 at 10:04 AM, Jerry Geis 
 if I do: echo jj_$VERSION_jj
 I get jj_
 How do I get the $VERSION to work with the 
 underscores like the dashes
 echo \_$VERSION\_

Or:echo jj_${VERSION}_jj

JD


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


Re: [CentOS] script question

2010-06-11 Thread Brunner, Brian T.
 

 -Original Message-
 From: centos-boun...@centos.org 
 [mailto:centos-boun...@centos.org] On Behalf Of John Doe
 Sent: Friday, June 11, 2010 10:50 AM
 To: CentOS mailing list
 Subject: Re: [CentOS] script question
 
 From: m.r...@5-cent.us m.r...@5-cent.us
  On Fri, Jun 11, 2010 at 10:04 AM, Jerry Geis  if I do: echo 
  jj_$VERSION_jj I get jj_ How do I get the $VERSION to work 
 with the 
  underscores like the dashes
  echo \_$VERSION\_
 
 Or:echo jj_${VERSION}_jj

?

Parenthesis didn't work for me... Braces and escape work.  I gave the
escape example, but I think the braces solution is the pedantically most
proper.
***
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the system manager. This footnote also confirms that this
email message has been swept for the presence of computer viruses.
www.Hubbell.com - Hubbell Incorporated**

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


[CentOS] Script consumes memory

2009-09-29 Thread Frank M. Ramaekers
I have the following script that when executed, consumes memory and
makes the system inaccessible.  All process are halted.

First, I don't understand what is wrong with the script
Secondly, I'm surprised that Linux allows this to run unchecked to the
detriment of the entire system.

 SCRIPT -
#!/bin/sh
FTP=/usr/bin/ftp
#
VMID=asystem.ourcompany.com
VMUser=STATDASD
VMPass=STATDASD
VMDir=VMSYSA:.
DataFile=data.txt
VMFile=DS8100.DATA
#--- Get some information about me
#--work from the same directory as the script
MYSCRIPT=`$BASENAME $0`
MYSCRIPTDIR=`$DIRNAME $0`
if [ $MYSCRIPTDIR != . ]
  then
  cd $MYSCRIPTDIR
fi
#--- FTP to MAINT on mkmfvm
$FTP -vn $$EOD
open $VMID
user $VMUser $VMPass
cd $VMDir
ascii
put $DataFile $VMFile
bye
$$EOD

Frank M. Ramaekers Jr.
Systems Programmer   MCP, MCP+I, MCSE  RHCE
American Income Life Insurance Co.   Phone: (254)761-6649
1200 Wooded Acres Dr.Fax:   (254)741-5777
Waco, Texas  76710


 



_
This message contains information which is privileged and confidential and is 
solely for the use of the
intended recipient. If you are not the intended recipient, be aware that any 
review, disclosure,
copying, distribution, or use of the contents of this message is strictly 
prohibited. If you have
received this in error, please destroy it immediately and notify us at 
privacy...@ailife.com.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script consumes memory

2009-09-29 Thread Alan Sparks
Perhaps I'm missing it, but where are your definitions of DIRNAME and
BASENAME?
Without them, you're probably re-executing the script in the bactick
references.  Basically a fork-bomb.
-Alan

Frank M. Ramaekers wrote:
 I have the following script that when executed, consumes memory and
 makes the system inaccessible.  All process are halted.

 First, I don't understand what is wrong with the script
 Secondly, I'm surprised that Linux allows this to run unchecked to the
 detriment of the entire system.

  SCRIPT -
 #!/bin/sh
 FTP=/usr/bin/ftp
 #
 VMID=asystem.ourcompany.com
 VMUser=STATDASD
 VMPass=STATDASD
 VMDir=VMSYSA:.
 DataFile=data.txt
 VMFile=DS8100.DATA
 #--- Get some information about me
 #--work from the same directory as the script
 MYSCRIPT=`$BASENAME $0`
 MYSCRIPTDIR=`$DIRNAME $0`
 if [ $MYSCRIPTDIR != . ]
   then
   cd $MYSCRIPTDIR
 fi
 #--- FTP to MAINT on mkmfvm
 $FTP -vn $$EOD
 open $VMID
 user $VMUser $VMPass
 cd $VMDir
 ascii
 put $DataFile $VMFile
 bye
 $$EOD

 Frank M. Ramaekers Jr.
 Systems Programmer   MCP, MCP+I, MCSE  RHCE
 American Income Life Insurance Co.   Phone: (254)761-6649
 1200 Wooded Acres Dr.Fax:   (254)741-5777
 Waco, Texas  76710
   

  



 _
 This message contains information which is privileged and confidential and is 
 solely for the use of the
 intended recipient. If you are not the intended recipient, be aware that any 
 review, disclosure,
 copying, distribution, or use of the contents of this message is strictly 
 prohibited. If you have
 received this in error, please destroy it immediately and notify us at 
 privacy...@ailife.com.
 ___
 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] Script consumes memory

2009-09-29 Thread Frank M. Ramaekers
Good catchnot sure how I missed that!   (Too many things going on.

THANKS!

Frank M. Ramaekers Jr.
Systems Programmer   MCP, MCP+I, MCSE  RHCE
American Income Life Insurance Co.   Phone: (254)761-6649
1200 Wooded Acres Dr.Fax:   (254)741-5777
Waco, Texas  76710


 


-Original Message-
From: centos-boun...@centos.org [mailto:centos-boun...@centos.org] On
Behalf Of Alan Sparks
Sent: Tuesday, September 29, 2009 10:27 AM
To: CentOS mailing list
Subject: Re: [CentOS] Script consumes memory

Perhaps I'm missing it, but where are your definitions of DIRNAME and
BASENAME?
Without them, you're probably re-executing the script in the bactick
references.  Basically a fork-bomb.
-Alan

Frank M. Ramaekers wrote:
 I have the following script that when executed, consumes memory and
 makes the system inaccessible.  All process are halted.

 First, I don't understand what is wrong with the script
 Secondly, I'm surprised that Linux allows this to run unchecked to the
 detriment of the entire system.

  SCRIPT -
 #!/bin/sh
 FTP=/usr/bin/ftp
 #
 VMID=asystem.ourcompany.com
 VMUser=STATDASD
 VMPass=STATDASD
 VMDir=VMSYSA:.
 DataFile=data.txt
 VMFile=DS8100.DATA
 #--- Get some information about me
 #--work from the same directory as the script
 MYSCRIPT=`$BASENAME $0`
 MYSCRIPTDIR=`$DIRNAME $0`
 if [ $MYSCRIPTDIR != . ]
   then
   cd $MYSCRIPTDIR
 fi
 #--- FTP to MAINT on mkmfvm
 $FTP -vn $$EOD
 open $VMID
 user $VMUser $VMPass
 cd $VMDir
 ascii
 put $DataFile $VMFile
 bye
 $$EOD

 Frank M. Ramaekers Jr.
 Systems Programmer   MCP, MCP+I, MCSE  RHCE
 American Income Life Insurance Co.   Phone: (254)761-6649
 1200 Wooded Acres Dr.Fax:   (254)741-5777
 Waco, Texas  76710
   

  



 _
 This message contains information which is privileged and confidential
and is solely for the use of the
 intended recipient. If you are not the intended recipient, be aware
that any review, disclosure,
 copying, distribution, or use of the contents of this message is
strictly prohibited. If you have
 received this in error, please destroy it immediately and notify us at
privacy...@ailife.com.
 ___
 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

_
This message contains information which is privileged and confidential and is 
solely for the use of the
intended recipient. If you are not the intended recipient, be aware that any 
review, disclosure,
copying, distribution, or use of the contents of this message is strictly 
prohibited. If you have
received this in error, please destroy it immediately and notify us at 
privacy...@ailife.com.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] Script consumes memory

2009-09-29 Thread Les Mikesell
Frank M. Ramaekers wrote:
 I have the following script that when executed, consumes memory and
 makes the system inaccessible.  All process are halted.
 
 First, I don't understand what is wrong with the script
 Secondly, I'm surprised that Linux allows this to run unchecked to the
 detriment of the entire system.


Linux allows what you've set with ulimit or the administrator sets in 
/etc/security/limits.conf.

-- 
   Les Mikesell
lesmikes...@gmail.com


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


Re: [CentOS] Script consumes memory

2009-09-29 Thread nate
Frank M. Ramaekers wrote:
 I have the following script that when executed, consumes memory and
 makes the system inaccessible.  All process are halted.

You can probably drastically simplify your script by using
ncftpput

http://www.ncftp.com/ncftp/doc/ncftpput.html

nate

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


Re: [CentOS] Script consumes memory

2009-09-29 Thread John R Pierce
nate wrote:
 Frank M. Ramaekers wrote:
   
 I have the following script that when executed, consumes memory and
 makes the system inaccessible.  All process are halted.
 

 You can probably drastically simplify your script by using
 ncftpput

 http://www.ncftp.com/ncftp/doc/ncftpput.html
   

and simplify it even more using scp, assuming the server at the other 
end is unix or linux and supports ssh/scp.  first, exchange ssh-keys, 
then...

scp $DataFile $VMID:$$vmu...@$vmdir



btw,

if [ $MYSCRIPTDIR != . 
  then
   cd $MYSCRIPTDIR
fi


is rather redundant. cd . is a no-op, so you might as well just say...

  cd $MYSCRIPTDIR



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


Re: [CentOS] Script consumes memory

2009-09-29 Thread Les Mikesell

   
 I have the following script that when executed, consumes memory and
 makes the system inaccessible.  All process are halted.
 
 You can probably drastically simplify your script by using
 ncftpput

 http://www.ncftp.com/ncftp/doc/ncftpput.html
   
 
 and simplify it even more using scp, assuming the server at the other 
 end is unix or linux and supports ssh/scp.  first, exchange ssh-keys, 
 then...
 
 scp $DataFile $VMID:$$vmu...@$vmdir
 

And rsync over ssh is even better, especially if you repeat copies of 
mostly the same content or there is a chance you will expand to sending 
a directory full of files.

-- 
   Les Mikesell
lesmikes...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] script to monitor interface errors

2009-07-23 Thread Tom Brown
Has anyone knocked up a script to monitor for interface errors before?

i know i can look at the interface statistics with ethtool -S but i 
wonder if anything has something that looks at the last value for this 
statistic and then can alert if they increase?

any thought how to solve this? it has to be host based and cant be on 
the switch

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


Re: [CentOS] script to monitor interface errors

2009-07-23 Thread Alexander Georgiev
2009/7/23 Tom Brown t...@ng23.net:
 Has anyone knocked up a script to monitor for interface errors before?

 i know i can look at the interface statistics with ethtool -S but i
 wonder if anything has something that looks at the last value for this
 statistic and then can alert if they increase?

 any thought how to solve this? it has to be host based and cant be on
 the switch


surprise, surprise

I have a similar situation. On a very slow Pentium I machine, runing
2.2.XXX kernel, sometimes I have overruns and frame errors, which
choke up the interface and I have to restart it using
The overruns are due to torrent traffic generated by one of the geeks here.

ifconfig eth1 down
ifconfig eth1 up

So I was thinking of using a cron job and a simple script that
restarts the interface, provided the errors have increased since last
check.
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script to monitor interface errors

2009-07-23 Thread Tom Brown


 surprise, surprise

 I have a similar situation. On a very slow Pentium I machine, runing
 2.2.XXX kernel, sometimes I have overruns and frame errors, which
 choke up the interface and I have to restart it using
 The overruns are due to torrent traffic generated by one of the geeks here.

 ifconfig eth1 down
 ifconfig eth1 up

 So I was thinking of using a cron job and a simple script that
 restarts the interface, provided the errors have increased since last
 check.
   

information is available from within /proc/net/dev its just a case of 
formatting that somehow and then comparing the 2 values over a time period
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help

2009-06-18 Thread Mohan

Hi

If your file has only 2 columns and there is no space exists in 2nd 
column then you can use this script


#!/bin/sh
FILE=list.txt
OUTPUT=out.txt
while read VAL

do
VAL1=$(echo $VAL | awk '{print $1}' )
VAL2=$(echo $VAL | awk '{print $2}' )

echo DEAR: $VAL1  $OUPUT
echo DEAR: $VAL2  $OUPUT
echo   $OUTPUT

done$FILE

if you have spaces in between your 2nd column you might have to format 
the file using awk/sed

so that there would be a valid delimeter between column1 and column2

column 1| column2 here we can use '|' as the delimeter and change awk 
statement

to awk -F '| ' '{print $1}' or something like this.

--
Regards,
Mohan.



chloe K wrote:

Hi
 
I have a file. list.txt (two columns)
 
column1column2

nameaddress
 
 
I need to put in the letter file letter.txt eg:
 
Dear: Chloe

Address: CA
 
Can I use this
 
for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
 
Thank you for your help
 
 
 
 
 




Looking for the perfect gift?* Give the gift of Flickr!* 
http://www.flickr.com/gift/



___
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] script help

2009-06-18 Thread John Doe

From: chloe K chloekcy2...@yahoo.ca
 I have a file. list.txt (two columns)
  
 column1column2
 nameaddress
  
 I need to put in the letter file letter.txt eg:
  
 Dear: Chloe
 Address: CA
  
 Can I use this 
  
 for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt

For single words space separated:

  cat list.txt | while read LINE
do
  set $LINE
  printf Dear: %s\nAddress: %s\n $1 $2  $1.letter.txt
done

JD


  

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


Re: [CentOS] script help

2009-06-18 Thread Mfawa Alfred Onen
Dear Chloe,
  John Doe`s script is a good start, even though it will work for single
words space separated. The LINE Variable only passes the Arguments as single
words to ($1 and $2 respectively). I will also work on something for you
too...

On Thu, Jun 18, 2009 at 10:34 AM, John Doe jd...@yahoo.com wrote:


 From: chloe K chloekcy2...@yahoo.ca
  I have a file. list.txt (two columns)
 
  column1column2
  nameaddress
 
  I need to put in the letter file letter.txt eg:
 
  Dear: Chloe
  Address: CA
 
  Can I use this
 
  for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt

 For single words space separated:

  cat list.txt | while read LINE
do
  set $LINE
  printf Dear: %s\nAddress: %s\n $1 $2  $1.letter.txt
done

 JD




 ___
 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] script help

2009-06-17 Thread chloe K
Hi
 
I have a file. list.txt (two columns)
 
column1    column2
name    address
 
 
I need to put in the letter file letter.txt eg:
 
Dear: Chloe
Address: CA
 
Can I use this 
 
for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
 
Thank you for your help
 
 
 
 
 


  __
Looking for the perfect gift? Give the gift of Flickr! 

http://www.flickr.com/gift/___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help

2009-06-17 Thread Brian
 Can I use this

 for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt


Why don't you just try it and see if it works?
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help

2009-06-17 Thread MHR
On Wed, Jun 17, 2009 at 10:54 AM, chloe Kchloekcy2...@yahoo.ca wrote:
 Hi

 I have a file. list.txt (two columns)

 column1    column2
 name    address

 I need to put in the letter file letter.txt eg:

 Dear: Chloe
 Address: CA

 Can I use this

 for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt


I've never seen any shell or sed syntax that allows you to subscript a
line like this.  You should read up on awk, although there is no
simple way to do dual file processing along these lines.  (An awk
script for this would need to know it has two files to process and
read in the first one, then print it with replacements from the second
one.)

Also, if the above were to work, it would be for i in `cat - the
in is part of for syntax

Man pages are really handy for this sort of thing

HTH

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


Re: [CentOS] script help

2009-06-17 Thread MHR
On Wed, Jun 17, 2009 at 11:16 AM, Brianemailli...@beckerspace.com wrote:
 Can I use this

 for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt


 Why don't you just try it and see if it works?

There _is_ that, but it won't

:-)

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


Re: [CentOS] script help

2009-06-17 Thread Mfawa Alfred Onen
There is going to be a problem with your sed line as the semi-column is not
helping matters. You can try using a database for easy retrieval with your
script. I hope it puts you on the way.

On Wed, Jun 17, 2009 at 7:16 PM, Brian emailli...@beckerspace.com wrote:

  Can I use this
 
  for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
 

 Why don't you just try it and see if it works?
 ___
 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] script help

2009-06-17 Thread Filipe Brandenburger
Hi Chloe,

Please start by reading this:
http://www.catb.org/~esr/faqs/smart-questions.html

On Wed, Jun 17, 2009 at 13:54, chloe Kchloekcy2...@yahoo.ca wrote:
 I have a file. list.txt (two columns)

Separated by what? Tabs? Spaces? Can the fields themselves have spaces
in them? Do you have many records, one per row? Please give a more
informative example of the file you have...

 I need to put in the letter file letter.txt eg:

 Dear: Chloe
 Address: CA

Is that supposed to be a template? What are you trying to achieve?
Replace Chloe with the first field and CA with the second field of
the list.txt file? Create one file per row of list.txt?

If you ask vague questions all you will have are vague answers...

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


Re: [CentOS] script help

2009-06-17 Thread Julian Thomas
On Wed, 17 Jun 2009 11:16:58 -0700 MHR wrote:


I've never seen any shell or sed syntax that allows you to subscript a
line like this.  You should read up on awk, although there is no
simple way to do dual file processing along these lines.

Easy way to do this with awk is to have the first part of the script use awk to 
get the name and address. and then 
use them as arguments to a second invocation of awk.
-- 
 Julian Thomas:   j...@jt-mj.nethttp://jt-mj.net
 In the beautiful Genesee Valley of Western New York State!
 -- --
 You will always be lucky if you know how to make friends with strange cats.
 - Colonial American proverb


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


Re: [CentOS] script help

2009-06-17 Thread Les Mikesell
chloe K wrote:
 Hi
 
 I have a file. list.txt (two columns)
 
 column1column2 nameaddress
 
 
 I need to put in the letter file letter.txt eg:
 
 Dear: Chloe Address: CA
 
 Can I use this
 
 for i `cat list.txt` | sed 's/Chloe/$i.1; /CA/$i.2/g' $i.letter.txt
 
 Thank you for your help
 

#!/bin/sh
while read NAME ADDRESS
do
sed -es/Chloe/$NAME/ -es/CA/$ADDRESS/ letter.txt$NAME.letter.txt
done list.txt

Seems sort of fragile in that the name field can't have spaces.

-- 
   Les Mikesell
lesmikes...@gmail.com
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


[CentOS] script help - '3rd last field'

2009-06-08 Thread Tom Brown
Hi

I need some logic to work out a value for me - this value is _always_ 
the 3rd last field in a string seperated by '.' but the string could be 
5 or 6 fields long, e.g

foo.bar.VALUE.baz.lala

foor.bar.gigi.VALUE.baz.lala

I need to find VALUE - if this were python or something i could do it 
but this has to be in shell -

Any clues?

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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread muhammad panji
On Mon, Jun 8, 2009 at 4:29 PM, Tom Brownt...@ng23.net wrote:
 Hi

 I need some logic to work out a value for me - this value is _always_
 the 3rd last field in a string seperated by '.' but the string could be
 5 or 6 fields long, e.g

 foo.bar.VALUE.baz.lala

 foor.bar.gigi.VALUE.baz.lala

 I need to find VALUE - if this were python or something i could do it
 but this has to be in shell -


awk -F\. {'print $3'}
awk -F\. {'print $5'}
awk -F\. {'print $6'}



-- 
Muhammad Panji
http://sumodirjo.wordpress.com
http://www.kurungsiku.web.id
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread Ralph Angenendt
michael.ket...@rm-solutions.de wrote:
 Sehr geehrte Damen und Herren, 
 
 ich bin ab dem 15.06.2009 wieder zurück im Büro.
 Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
 [simon.schilli...@rm-solutions.de]
 
 Viele Grüße,
 Michael Kettel

You can resubcribe then, when you are back. Please do not use
autoresponders if you do not know how they work.

No regards,

Ralph


pgp6bs1DJZG73.pgp
Description: PGP signature
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread James Bensley
Is there anyway you can tell which field it will be in (i.e. to use as
a search clause, so search for the field with X properties?)

Ultimately to get the data in the X'th field you are going to need
either awk or sed (they can both easily do this, awk probably easier
than sed)

You need to work out how you will know which field it will be in i.e.
the first, second, third? My shell scripting is rubbish but I would
guess it would go something like;

myString = first.second.VALUE.fourth.fith

awk -F\. {'print 3'} myString

This would print the third field seperated by a '.' (full stop/period)
of myString

That's a rubbishy wild stab in the dark as im rubbish at shell scripting.

I would actually bet money I have made things more complex hahahah!

Sorry, i tried :'(

James.

-BEGIN GEEK CODE BLOCK-
  Version: 3.1
GIT/MU/U dpu s: a-- C++$ U+ L++ B- P+ E? W+++$ N K W++ O M++$ V-
PS+++ PE++ Y+ PGP t 5 X+ R- tv+ b+ DI D+++ G+ e(+) h--(++) r++ z++
--END GEEK CODE BLOCK--
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread michael . kettel
Sehr geehrte Damen und Herren, 

ich bin ab dem 15.06.2009 wieder zurück im Büro.
Bitte wenden Sie sich in dringenden Fällen an Simon Schillings 
[simon.schilli...@rm-solutions.de]

Viele Grüße,
Michael Kettel


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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread Jacques B.
On Mon, Jun 8, 2009 at 5:29 AM, Tom Brownt...@ng23.net wrote:
 Hi

 I need some logic to work out a value for me - this value is _always_
 the 3rd last field in a string seperated by '.' but the string could be
 5 or 6 fields long, e.g

 foo.bar.VALUE.baz.lala

 foor.bar.gigi.VALUE.baz.lala

 I need to find VALUE - if this were python or something i could do it
 but this has to be in shell -

 Any clues?

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


I am pretty sure there is a way in awk to figure out how many fields
you have, then take the total # of fields -3 each time to get the
third last one.  Just heading out the door and off hand can't remember
how it would be done.

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


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread Alex S.
Hi.

   echo foo.bar.VALUE.baz.lala | awk -F. '{ print $(NF-2); }'

-- 
Alex S.magicb...@gmail.com



On 08.06.2009 13:29, Tom Brown wrote:
 Hi

 I need some logic to work out a value for me - this value is _always_
 the 3rd last field in a string seperated by '.' but the string could be
 5 or 6 fields long, e.g

 foo.bar.VALUE.baz.lala

 foor.bar.gigi.VALUE.baz.lala

 I need to find VALUE - if this were python or something i could do it
 but this has to be in shell -

 Any clues?

 thanks
 ___
 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] script help - '3rd last field'

2009-06-08 Thread Tom Brown

 I am pretty sure there is a way in awk to figure out how many fields
 you have, then take the total # of fields -3 each time to get the
 third last one.  Just heading out the door and off hand can't remember
 how it would be done.

   

i can do it in cheetah templating with

set myloc = $getVar(hostname,)split('.')[-3]

the -3 says the last 3rd field in the string - i need the same so maybe 
awk can do this
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread Mogens Kjaer
muhammad panji wrote:
...
 awk -F\. {'print $3'}
 awk -F\. {'print $5'}
 awk -F\. {'print $6'}

awk -F\. {'print $(NF-2)'}

Mogens
-- 
Mogens Kjaer, Carlsberg A/S, Computer Department
Gamle Carlsberg Vej 10, DK-2500 Valby, Denmark
Phone: +45 33 27 53 25, Mobile: +45 22 12 53 25
Email: m...@crc.dk Homepage: http://www.crc.dk
___
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos


Re: [CentOS] script help - '3rd last field'

2009-06-08 Thread Tom Brown

echo foo.bar.VALUE.baz.lala | awk -F. '{ print $(NF-2); }'

   

excellent - just what i needed

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


  1   2   >