Replicating Couchdb documents from local to remote server

Comments

CouchDB

Apache CouchDB is an Opensource document-oriented database, accessible via a RESTful JSON API. Ad-hoc and schema-free with a flat address space.

Replication synchronizes two copies of the same database, allowing users to have low latency access data no matter where they are. These databases can live on the same server or on two different servers, CouchDB doesn’t make a distinction. If you change one copy of the database, replication will send these changes to the other copy.

Here is a step by step documentation on how i did the Replication (CouchDB)

  1. Checked out the latest couchdb source from their svn and installed it on both the machines (local and remote)
  2. Replication in Couchdb can be done via both, Futon(web interface) and Curl(command line interface). You can access your Futon when couchdb server is running at http://localhost:5984/_utils
  3. For manual Replication (copying all documents in a couchdb database) use Futon or curl
  4. Using Futon:

    open http://localhost:5984/_utils on your favourite browser and click on the Replicator Option in the Menu to the right

    Web interface for your CouchDB admin

    Next type out the needed datas in the input field, source database name and target database url. see below pic

    Click on the button called “Replicate” to start with the replication process

  5. Using curl:
    curl -X POST http://localhost:5984/_replicate -d '{"source":"http://localhost:5984/mageshdb", "target":"http://192.168.15.2:5984/mageshdb"}' 
  6. If you want to replicate documents automatically, i.e whenever a new document is added/changed in the local server, it is replicated to the remotely synced server automatically. Automatic or Continuous Replicating is not available via Futon so using curl:
    curl -X POST http://localhost:5984/_replicate -d '{"source":"http://localhost:5984/spulz", "target":"http://192.168.15.2:5984/spulz", "continuous":true}'

    A new parameter “continuous”:true is added to the previous curl command, to make replication continuous or automatic

  7. If you want to replicate documents from the remote server to the local? then just swap the source and target database in the previous curl command like
    curl -X POST http://localhost:5984/_replicate -d '{"target":"http://192.168.15.2:5984/spulz", "source":"http://localhost:5984/spulz", "continuous":true}'

Note: but this continuous replication cannot survive a server restart (feature might be added in couchdb’s future release)
so hav to run the curl command everytime when the server is restarted

Try this, and comment below

Share and Enjoy
Tinyurl for this post

Written by magesh

March 10th, 2010 at 7:49 am

Playing The Real Farmville Can Save the World

Comments

Do u like playing Farmville on FaceBook? well i dont, but loved the fun in playing Real Farmville (Planting Trees in real) On 26th-Jan 2010, Chennai’s Chapter of “The Saplings Project” was organized at Dr.MGR’s School for the Hearing and Speech, Ramapuram

Early Morning when i woke up, thought only a few(may be 1 or 2 ) would be turning up for this event(planting trees) But when i reached the venue, was suprised to see a lot of people which includes the NSS volunteer’s from nearby college (Alpha College) and few from another organisation lead by Mr. Mullai Vanam and Mr. SugaVanam. By the time we reached the venue these people had finished digging pits and ready for planting.

We also went around the school and found Puratchi Thalaivar MGR’s House in the front (behind which the school is being constructed ) learnt a lot about our Dr. M.G.R’s Past life as people were discussing about him :)

Later Then we started our action, to plant these sapplings, It was fun coz @Rajasekarn, @SandeepVarma also joined along with @Kiruba and me. We planted a sapling just then @sandeepvarma branded it as “The Tedx Tree” I felt really happy coz this is the first time,  i see myself doing a useful work on a Republic day


I really appreciate this idea of “Sapplings Give Away” done by people like sathish(@bombaylives), Ranjith(@ranjithwalunj) and SugaVanam. We all know that one day or the other our Earth is gonna end, becoz of these natural calamities like Global warming or Tsunami or whatever. But if we all join hands to carry out these kind of Sapling projects throughout India (later worldwide) Definitely we would hav a chance to save the world, making it a better place to live :)

Friends do read about “TheSaplingsProject“, An awesome intiative started by Satish and Ranjith, do share it with your friends and relatives. Scared after watching the movie 2012? Dont worry we still have one last chance to Save the Earth

(pic’s courtesy: SandeepVarma)

Share and Enjoy
Tinyurl for this post

Written by magesh

January 26th, 2010 at 6:46 pm

Being Expressive Using Smileys during online chat

Comments

Now a days, people being more active online with the advent of Social-MEdia’s like twitter, facebook and more. More than sharing words, we can also share our thoughts these days(by updating ur status in twitter, facebook or any). These technologies help us being more expressive though not in real. So Learn to use the Smileys while chatting with your friends on Gtalk, yahoo, AOL, facebook or any IM to have more fun :)

Share and Enjoy
Tinyurl for this post

Written by magesh

January 11th, 2010 at 5:25 pm

OPEN SOURCE INDIA TECH DAYS '09

Comments

Meet The Messiah

Meet The Messiah

Hi everybody..!

This post is to share my experience at the Open Source India Tech Days ‘09, actually i was there for the last two days but missed the first day ( not being able to bunk my internal assesment tests) I really enjoyed my time there at the Chennai Trade Center Hall. I attended the second and third day of this big event, so i will tell you about what happened there on those two days.

On 13th March ‘09 i was really amazed seeing so many college students at the OSI Days hall. The first speaker on that day was Mr. Narendra Bhandari of Intel

He was telling us about the Mobile Technologies and its future. He enlightened us with some knowledge about the Moblin (mobile tech from Intel) he also explained about the importance for opensource in todays Business. Well i did enjoyed his speech. The next speaker on that day was Mr. Rakshat Hooja, IDA Systems  who actually introduced us with the openmokku, an opensource mobile platform based on GNU/Linux. Then Mr. Thilak Kumar of Wind River, (google’s android specialist) talked about the opensource mobile platforms and their importance in todays world. He also added some informations about the latest Handsets. And they had a nice pannel discussion expressing their overall thoughts about the opensource technologies.

Chennai Trade Centre Hall

Chennai Trade Centre Hall

The audience out there really enjoyed their speech and started shooting a lot of questions which was answered by the pannel member untiringly

At the same time concurently, IBM’s workshop was going on at the nearby hall ( i was not able to attend it)

Then i saw a lot of Stalls out there,  The Chennai LUG team had a stall , IBM , Lynus Academy, NRCFOSS & CDAC, IIT Mumbai and lots more (i dont remember well )

Then the last day of the OSI Techdays i.e 14th March ‘09

The first speaker on stage was a 14 year old kid ( well i should not address him as a kid because he possesses a lot of knowledge more than college students do)

He was talking about his “Falling in love with FOSS, he shared all his experiences telling us how he made his hands dirty playing around Linux and the so called “Open Source Softwares”.

The next speaker was Mr. Gautam Sinha, CTO Times Business Solution Limited. He shared a lot of his company experience using FOSS ( well not about his commercial facts) He told about  why the Open Source is Consumed by the IT Management.. There was a lot of people asking questions to him about the in and arounds of the IT industries and Mr. Sinha provided a better solution to all of them.

ilugc

Then there was a hilarious pannel discussion by the Chennai LUG people, talking about different linux distros (Fedora, Debian, Mandriva, Opensuse,Gentoo, Ubutu & BOSS ).. Mr. Bharathi introduced Chennai LUG to the newbies and as soon as the discussion started they were about to start a flame war as to ” Which is the best Distro” Some how they managed to end the discussion Mr.Bharathi said ” Just Try what ever Distro is in your hand, and dont see which is the best” because every Distro has a similar base but one or two features may differ.. So we Audience had a nice time

Then  Mr. Venkatesh kumar gave a speech introducing IBM’s Lotus Symphony ( which is an office utility collaborated with openoffice, build on Eclipse )

Then soon after the lunch Mr.Akarsh Simha  had a interesting speech  about the Desktop productivity tools… He was telling about all the things that he loved in using the KDE desktop environment… he told about many interesting features about the kde desktop which made me to try kde that evening (well i havent used kde but using gnome for more than 7months)

Then Mr.Bharathi of the Chennai LUG gave an interesting speech figuring out the importance of the LUG’s in India, and what are the roles played by the lug’s to help out linux newbies. He also told about the mailing list, and how people communicate inside the community via the mailing list.

People were amazed hearing about the activities of our Chennai LUG, that they were quering people at the LUG stalls to know more about the LUG’s

Then Mr. Srivathsa of Dell, Mr Anil of Microsoft, Ashok krish of TCS and Mr. Shrinivasan of Cloudversity had a pannel discussion about the Career trends in FOSS, which was very much useful for the students( both school and college)

Then Mr. Redhaun had a hilarious talk about the opensource business as well as opensource politics, He also shared  about his experience with foss , and the story of Compiere and Adempiere (an Open Source ERP) He also asked people to contribute to his projects.. He stated himself as a tech-mafia (thats the jovial part of his presentation)

Then Mr. Ashok of TCS  was talking about Where and why Foss is used.. He also gave ideas for the students on how to decide before starting your career with foss.

Then Mr. Lim kin chew, SIM university was talking about the FOSS in ASIA

Thats how the OSI Tech Days came to end. We must actually thank LFY for making up such a essential fest at the right time.

We also hope to have these kind of programmes to be held often around chennai. So I really enjoyed the two days at the OSI Tech Days ( Opensource Festival)

If you also attended the OSI Tech Days programme or want to share something on it. Please feel free to post your comment below.

Share and Enjoy
Tinyurl for this post

Written by magesh

March 14th, 2009 at 11:21 am

Posted in FOSS

Tagged with ,

How to Start-up with Linux? for students

Comments

Many people those who mail me or those who i met had a question

” how do i start with linux..? i fear that iam getting into trouble ”

well, to answer them

Its not like linux will take you into troubles but you will have to learn more. There are lots of things out there for you to learn.

If you would like to start with linux, you can download or get the Ubuntu Linux (one of the linux distros for the newbies, basic users)

Install the Ubuntu Linux first… read online guides for installing ubuntu before you do it.

The best idea to gather knowledge is to google….!  Just visit www.google.com and search for anything you would like to know. You will get to know many things

Once you’ve installed the linux, just play around it and see what are the available options and feel the difference

I would like to tell you that linux is not just Command oriented… Peopleo often scare of linux because they think “Command knowledge is necessary to use linux”

But there is nothing as such, you can use linux just as you use your windows or Mac or any Operating System (with the GUI and Visual Effects )

desktop effects

desktop effects

To have a better experience on linux and the opensources  join any opensource communities

There are a number of communities available for opensources and linux. If you are in chennai, you can join the Linux User Group Chennai. click here to know more. If you are from other States or Country well you can google to find your regional LUG’s

You can join mailing lists, there are several open communities with mailing lists. You can get to know about what others are doing with the opensource and linux. You can also share your views, get help and have fun

For Students.. It is essential to learn linux, because you need to know the mechanism of the softwares/Systems like you must know how does an operating system work. Once you start with linux you get the answers for all your questions.. you will learn the operations of your OS as well as the applications

Students can also download the Source codes of your favourite applications (Since it is opensource, you get the code free) You can learn the codes to know how the application works, you can add your codes to it and contribute to the open communities

Later after getting used to Ubuntu Linux, you can try other major Linux Distros like the Fedora, Debian and Opensuse

you will find many things to be intersting

Share and Enjoy
Tinyurl for this post

Written by magesh

March 13th, 2009 at 11:26 am

Posted in linux

Tagged with ,

Recover lost Datas or Partition

Comments

As usual when i was playing around with the linux command.. i Lost all the datas in my Pen Drive (due to carelessness) I was shocked, without knowing what to do. i just google and came across a tool for recovering partitions as well as lost files (any type of file it be)

Tool Name  :  TestDisk & PhotoRec

Just install the package named TestDisk

$yum install testdisk   (if using any rpm kinda linux)

Then the package gets installed at ease… It is actually a command line tool (which looks as though a GUI tool)

to recover partitions you need to use

$testdisk

And then the rest is easy as you see it on the screen

If you want to recover files from your hard disk or any flash drives, you can use the photorec (which supports a lot of file system including the windows and linux types also)

To start with recovering your files just type this in your terminal

$photorec

Then the following output would be seen in your terminal

PhotoRec

Then next you have to select your device where  files are need to be recovered from  and then press Enter

you would see the next screen as

partition table type

As you see, you need to select your partition table from list shown

Then pressing Enter you would see this

partition

Just select the partition (you also have lots of options to be enabled if needed

Then you select the file type you wish to recover, for example if i wish to recover only .doc files i would mark it in the following list of options before starting my search.. It is easy as you see

screenshot-4

Then the last you need to do is select a destination to save the recover files

it will take little time (depends on with the media you use)

This is an efficient way of recovering both files as well as partitions, for recovering partitions try the testdisk same as the photorec

Enjoy with linux

If you need any help or know any other package like this Dont forget to comment below….!


Share and Enjoy
Tinyurl for this post

Written by magesh

March 4th, 2009 at 7:51 am

Fedora Classrooms

Comments

here is another interesting thing about the web2.0

Have you ever imagined about a Virtual ClassRoom…? i have been dreaming about this long time ago but

the Fedora people have successfully come forward with a new method for teaching (“Fedora Class Rooms”).

For those who want to learn Linux from the Basics can join this Fedora Class rooms and watch Fedora Project Experts taking class on different topics from time to time… to know more about it click here

This Fedora Class room  is handled via the IRC , the classes are being held at the weekends for the convenience of everyone..  To know about the classroom schedules every week just visit https://fedoraproject.org/wiki/Classroom

keep track of the topics for the next classes and follow the UTC timing to attend the classes at the scheduled time… you can also interact between the class hours by asking question related to the topics during the Q&A sessions. The instructors are very polite and ready to help us.

And People willing to take classes are also invited check out the classroom link above to know more about registering for the classroom presentation..

For my College friends who say that ” iam sitting at home wasting weekends ” here’s a good place for you to hangout during the weekends..

All classes will be held in irc @ #fedora-classroom (channel) in irc.freenode.net.

All you need to do is

  • have Fedora or any linux installed in your system
  • install the irc client such as the xchat (yum install xchat if using fedora or CentOS)
  • see that your system has the UTC clock to track the classroom timings
  • connect the  irc.freenode.net
  • choose the channel #fedora-classroom
  • And stay tuned

And if you were busy and missed out the class, you can also view the log of the conversation , the conversations in the fedora-classrooms are being archived and kept in the fedora project wiki

https://fedoraproject.org/wiki/Classroom

Now this is a easy way of learning isnt it… if you have any comments or need any help regarding this post

Add your comments below…..!

Share and Enjoy
Tinyurl for this post

Written by magesh

March 3rd, 2009 at 11:25 pm

Posted in linux

Tagged with ,

Why do People move to Linux…. and what is so special about the linux Operating System

Comments

People move to linux from Windows because…. they want security(Which is at the peak in LINUX OS’s)

Mainly there is no Virus infection…. people need not waste their time downloading antiviruses and scanning their Disks once in a week……

the speed of processing is really good, especially when copying large datas or burning  dvd’s

No need to rescue the system using CTRL+ALT+DEL all the time ( when there is a  sytem which doesnt hangs)

Linux is a favourite for all those kind of people who wants to free, customizing his own system as he likes….. like changing the themes( creating it by himself) and those who wants to have their own unique style

These are the ideas i have about linux…. if you have something to share please feel free to leave your comments below and continue the discussion……

Share and Enjoy
Tinyurl for this post

Written by magesh

March 2nd, 2009 at 5:28 am

Posted in Hot Discussion

Tagged with ,