[Ilugc] extract sentences from a xml file in bash

2012-03-07 Thread Shrinivasan T
Friends.

I have a text file to extract content from.

The format is like below

title = Mr
name = shrini
phone = some number
email = email address
address = home address
city = chennai
state  = tamilnadu
country = india

The same block continues as multiple times in the file, but in records
are in different order.

I want to extract any two lines from the entire file. for example, I
want to get the
pair of name, phone or name, city or name,email address or name, state etc

How can we use the bash utilities to achieve this?

Thanks.

-- 
Regards,
T.Shrinivasan


My Life with GNU/Linux : http://goinggnu.wordpress.com
Free/Open Source Jobs : http://fossjobs.in

Get CollabNet Subversion Edge :     http://www.collab.net/svnedge
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


[Ilugc] Please suggest Linux server

2012-03-07 Thread freeos
Hi,

We have a plan to replace windows 2003 server by CentOS. This CentOS
will authenticate all other windows desktops using Samba PDC. Total users
are 30.

As of now we have thinclients with Windows 2003 server. Before adopted
with this setup, we had checked using one thinclient. While testing, we
felt that it was ok. After place 15 thinclients by connecting with IBM
X3400 server , we started to realize slow issue. For example, if one user
opens a pdf file, it takes time. Due to this slow issue,we are planning to
replace all these thinclients by desktops. Then these desktops will be
installed by Windows OS. Then these windows desktops will be authenticated
by Samba PDC. Samba PDC configured in a desktop configurationCeleron 1.8
GHZ,512 MB RAM). This system will act as gateway and squid proxy also for
our network.IBM X3400 is 4 years old. So we are not able to decide to
continue with this server for further operations. Please suggest
configuration or server model for Samba PDC to authenticate 30 users.

Thanks for your time.
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Please suggest Linux server

2012-03-07 Thread Ravi Kumar Tenneti
Hi,

GHZ,512 MB RAM). This system will act as gateway and squid proxy also for
> our network.IBM X3400 is 4 years old. So we are not able to decide to
> continue with this server for further operations. Please suggest
> configuration or server model for Samba PDC to authenticate 30 users.
>
>
Try ClearOS. Apt for this setup IMO

http://www.clearfoundation.com/Software/overview.html

Regards

Ravi Kumar
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Please suggest Linux server

2012-03-07 Thread kenneth gonsalves
On Wed, 2012-03-07 at 16:28 +0530, Ravi Kumar Tenneti wrote:
> GHZ,512 MB RAM). This system will act as gateway and squid proxy also
> for
> > our network.IBM X3400 is 4 years old. So we are not able to decide
> to
> > continue with this server for further operations. Please suggest
> > configuration or server model for Samba PDC to authenticate 30
> users.
> >
> >
> Try ClearOS. Apt for this setup IMO
> 
> http://www.clearfoundation.com/Software/overview.html
> 
> 

he is asking for recommendation for hardware.
-- 
regards
Kenneth Gonsalves

___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] extract sentences from a xml file in bash

2012-03-07 Thread Raja Subramanian
On Mar 7, 2012 1:54 PM, "Shrinivasan T"  wrote:
> How can we use the bash utilities to achieve this?

Use Perl. I'm sure there's an ini parser on CPAN which will make this
trivial.

- Raja
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] extract sentences from a xml file in bash

2012-03-07 Thread Suraj Kumar
On Wed, Mar 7, 2012 at 1:53 PM, Shrinivasan T wrote:

> The same block continues as multiple times in the file, but in records
> are in different order.
>

Is there a fixed set of 'fields' per record? If yes, the solution could be
a lot simpler and possibly done using awk or a combination of shell tools.
If not, try this perl "one liner":

sample input file:

$ cat file
name=ravi
phone=101
email=a@b.c
phone=011
email=c@b.a
name=vira
email=a...@a.com
name=crap
email=s...@s.com
name=supercrap

The solution (which I've formatted here for ease of readability):

$ cat file | perl -MYAML -ni -e '
BEGIN {
@db = ();
$rec = {};
%keycounter = ();
$next_rec_at = 1;
}
chomp;
($k, $v) = $_ =~ m/^(.*?)\s*=\s*(.*)/gms;
$kcount = ( defined $keycounter{$k} ? $keycounter{$k} : 0 );
if ($kcount >= $next_rec_at) {
push(@db, $rec);
$rec = {};
$new_rec_at++;
}
$rec->{$k} = $v;
$keycounter{$k}++;

END {
push(@db, $rec);
print YAML::Dump(\@db); # ... or do your report generation here
}'

output:

- email: a@b.c
  name: ravi
  phone: 101
- email: c@b.a
  name: vira
  phone: 011
- email: a...@a.com
  name: crap
- email: s...@s.com
  name: supercrap

cheers,

  -Suraj

-- 
Career Gear - Industry Driven Talent Factory
http://careergear.in/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Need Help on Storage

2012-03-07 Thread Suraj Kumar
On Wed, Mar 7, 2012 at 12:42 PM, Yuvaraj  wrote:

> I have a slight issue on our server.
>
> I have added some extra storage on an Infortrend Raid – the disks show up
> on boot up and is assigned by the system.


Given this is a hardware raid controller, you probably noticed the disk
'showing up' on the raid controller utility menu just before the OS is
booted. correct?



> Now when in LVM manager the disks
> don't show up. I have included the part of the boot message so you can see
> the disk assignment.
>

Usually, with a hardware raid controller, you don't get to access to the
underlying disks*. You will instead see unified disk(s).

* unless you also have some kind of a specialized software (such as HP ACU
CLI) using which you can 'talk' to the raid controller to query various
things from it (such as the list of drives installed, their status, etc.,).
Some raid controllers do support 'direct disk' mode, but you have to check
with your RAID hardware's manual.

regards,

  -Suraj

-- 
Career Gear - Industry Driven Talent Factory
http://careergear.in/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] block facebook squid

2012-03-07 Thread Suraj Kumar
On Tue, Mar 6, 2012 at 1:05 PM, Mohan Sundaram  wrote:

> If NAT is enabled, then you'll need to redirect DNS requests to a
> local DNS server which either denies access by dropping those
> requests.
>

Messing with the World's DNS is a Bad Idea, IMHO. Keeping track of such
'blockings' you've done all over the place (at the DNS, proxy and firewall)
will eventually get tedious.

regards,

  -Suraj

-- 
Career Gear - Industry Driven Talent Factory
http://careergear.in/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] extract sentences from a xml file in bash

2012-03-07 Thread Balasubramaniam Natarajan
bala@Lapi:/tmp$ cat test.txt
title = Mr
name = shrini
phone = some number
email = shr...@email.com
address = home address
city = chennai
state  = tamilnadu
country = india
title = Mr
name = Bala
phone = some number
email = b...@email.com
address = home address
city = chennai
state  = tamilnadu
country = india
bala@Lapi:/tmp$ cat test.txt | grep -P "\b(name|email)\b"
name = shrini
email = shr...@email.com
name = Bala
email = b...@email.com
bala@Lapi:/tmp$
-- 
Regards,
Balasubramaniam Natarajan
www.etutorshop.com/moodle/
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Please suggest Linux server

2012-03-07 Thread Rajagopal Swaminathan
Greetings,

On Wed, Mar 7, 2012 at 4:05 PM, freeos  wrote:
> Hi,
>
>    We have a plan to replace windows 2003 server by CentOS. This CentOS
> will authenticate all other windows desktops using Samba PDC. Total users
> are 30.

Great!

>
>    As of now we have thinclients with Windows 2003 server. Before adopted
> with this setup, we had checked using one thinclient. While testing, we
> felt that it was ok. After place 15 thinclients by connecting with IBM
> X3400 server , we started to realize slow issue. For example, if one user
> opens a pdf file, it takes time. Due to this slow issue,we are planning to
> replace all these thinclients by desktops. Then these desktops will be
> installed by Windows OS. Then these windows desktops will be authenticated
> by Samba PDC. Samba PDC configured in a desktop configurationCeleron 1.8
> GHZ,512 MB RAM). This system will act as gateway and squid proxy also for
> our network.IBM X3400 is 4 years old. So we are not able to decide to
> continue with this server for further operations. Please suggest
> configuration or server model for Samba PDC to authenticate 30 users.
>
>    Thanks for your time.

This is a purely windows related issue.

Can you please clarify your current x3400 config so we can possibly help better?

-- 
Regards,

Rajagopal
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Call for speakers - March 10

2012-03-07 Thread ragu varan
> Give the following details, if you are interested in giving a talk.
>
> Topic
> Description
> Duration
> Links
> About Yourself

Topic : Configuring LDAP in linux

Description : Just configuring Ldap server and client. Will show demo
on how centralized logins are used among the servers.

Duration : 1 hour

Links : 
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch31_:_Centralized_Logins_Using_LDAP_and_RADIUS

About Yourself :

My name is Raguvaran Working as a Technical Support Engineer in
CollabNet . I have finished Redhat Certification and have 1 and half
year experience as Linux System Administrator.


Thanks&Regards,
Raguvaran
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


[Ilugc] Problem adding widgets to GNOME panel

2012-03-07 Thread sugantha
Hello All,

I run a machine with CentOS 5.5, GNOME version 2.16.1. When I log in, or
when I try to add new widgets like Clock, or WindowList to my GNOME panel
(by doing 'Add to Panel') . I get the below error message all over my
screen,

The panel encountered a problem while loading
"OAFIID:GNOME_WindowMenuApplet"

The panel encountered a problem while loading
"OAFIID:GNOME_WindowListApplet".

The panel encountered a problem while loading
"OAFIID:GNOME_WindowMenuApplet"

Each of the message in separate windows. Widgets like WindowListApplet are
critical to me, since without it, any minimized window just disappears and
I have no way of retrieving that window.

I googled around and tried the following,

$ pkill gnome-panel
$ gnome-panel &

deleted ~/.gconf/apps/ and allowed the panel to build itself from scratch
when I logged back in. but nothing seems to work. Please tell me your
suggestions.

Note : Crossposted in linuxquestions.org

Regards
Sugantha
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Call for speakers - March 10

2012-03-07 Thread Joseph
HI
I would like to know the timings
is it in IIT campus ?
thanks
Joseph
On 03/07/2012 11:18 PM, ragu varan wrote:
>> Give the following details, if you are interested in giving a talk.
>>
>> Topic
>> Description
>> Duration
>> Links
>> About Yourself
> Topic : Configuring LDAP in linux
>
> Description : Just configuring Ldap server and client. Will show demo
> on how centralized logins are used among the servers.
>
> Duration : 1 hour
>
> Links : 
> http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch31_:_Centralized_Logins_Using_LDAP_and_RADIUS
>
> About Yourself :
>
> My name is Raguvaran Working as a Technical Support Engineer in
> CollabNet . I have finished Redhat Certification and have 1 and half
> year experience as Linux System Administrator.
>
>
> Thanks&Regards,
> Raguvaran
> ___
> ILUGC Mailing List:
> http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


[Ilugc] MS Cloud operations in TN

2012-03-07 Thread Kumaran R
Hi ILUGC,

 I guess it is time for ILUGC to start another campaign against
the TN govt. When the neighboring state of Kerala is doing so much
with Open Source, why is TN govt. falling into a trap with MS?  (Refer
yesterday's hindu:
http://www.thehindu.com/news/states/tamil-nadu/article2967682.ece)

 IMO, the last thing that we would want is for our state to fall
into a vendor lock-in with MS. I guess it would take a fraction of the
cost if we develop TN. govt. its own private cloud.

Anyway, I think we first need to tell TN govt. that what they are
doing is wrong. Any ideas on how to go about with this?


With Regards,
~~Kumaran R
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] MS Cloud operations in TN

2012-03-07 Thread kenneth gonsalves
On Thu, 2012-03-08 at 10:06 +0530, Kumaran R wrote:
> I guess it is time for ILUGC to start another campaign against
> the TN govt. When the neighboring state of Kerala is doing so much
> with Open Source, why is TN govt. falling into a trap with MS?  (Refer
> yesterday's hindu: 

as a person with fair amount of experience with dealing with govt
officials in various states I can assure you that the argument that
'neighouring state is doing this so our state should do it' is the
surest way to ensure that it is not done. Each state thinks it is better
than the others and this argument just irritates the officials. Base
your arguments with reasons.
-- 
regards
Kenneth Gonsalves

___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Call for speakers - March 10

2012-03-07 Thread R.Kanagaraj (RK)
Need to know the venue and timing.

On Thu, Mar 8, 2012 at 12:18 AM, Joseph  wrote:

> HI
> I would like to know the timings
> is it in IIT campus ?
> thanks
> Joseph
> On 03/07/2012 11:18 PM, ragu varan wrote:
> >> Give the following details, if you are interested in giving a talk.
> >>
> >> Topic
> >> Description
> >> Duration
> >> Links
> >> About Yourself
> > Topic : Configuring LDAP in linux
> >
> > Description : Just configuring Ldap server and client. Will show demo
> > on how centralized logins are used among the servers.
> >
> > Duration : 1 hour
> >
> > Links :
> http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch31_:_Centralized_Logins_Using_LDAP_and_RADIUS
> >
> > About Yourself :
> >
> > My name is Raguvaran Working as a Technical Support Engineer in
> > CollabNet . I have finished Redhat Certification and have 1 and half
> > year experience as Linux System Administrator.
> >
> >
> > Thanks&Regards,
> > Raguvaran
> > ___
> > ILUGC Mailing List:
> > http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
>
> ___
> ILUGC Mailing List:
> http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
>



-- 

With Regards,
RK,
+91 9976294191
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] MS Cloud operations in TN

2012-03-07 Thread vijayaraghavan seshan
The normal way would be to approach ELCOT with the proposal.but
having said that ..there is a lot of political and monetory
influence is connected with government in these activities ..but
still its no harm in taking this to ELCOT ...people are still educated
there will have ears to listen .taking it from there to the
government to amend depends ministers who still thinks cloud computing
as computer to use at the time of rainy season as we use
umbrellasuch is the knowledge of people in power.still I would
suggest it as worth a try .

On 3/8/12, kenneth gonsalves  wrote:
> On Thu, 2012-03-08 at 10:06 +0530, Kumaran R wrote:
>> I guess it is time for ILUGC to start another campaign against
>> the TN govt. When the neighboring state of Kerala is doing so much
>> with Open Source, why is TN govt. falling into a trap with MS?  (Refer
>> yesterday's hindu:
>
> as a person with fair amount of experience with dealing with govt
> officials in various states I can assure you that the argument that
> 'neighouring state is doing this so our state should do it' is the
> surest way to ensure that it is not done. Each state thinks it is better
> than the others and this argument just irritates the officials. Base
> your arguments with reasons.
> --
> regards
> Kenneth Gonsalves
>
> ___
> ILUGC Mailing List:
> http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
>


-- 
Thanks
VJRGVN
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc


Re: [Ilugc] Please suggest Linux server

2012-03-07 Thread Kumaran R
I don't know much about the server hardware requirements. But IMO, you
can have the Desktops in this configuration:
CPU+Board: Intel Atom Desktop Kit - Rs. 3400
RAM - Hynix LapTop RAM 1 GB - Rs. 475
No Hard-Disk
Some Case ~ Rs.1000

We had a similar issue in my school, and we had to dispose of around
15 thin-clients. Now, we're using the above configuration (but with
HDDs). You can use PXE and reduce your cost.


With Regards,
~~Kumaran R
___
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc