Re: [ilugd] How to run script on other machine if ping breaks?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Amit Sharma writes: Hi, I have 2 linux servers A and B. Both are running MySQL and A is defined as Master and B as Slave. A ipaddress is 10.10.10.10 and B has 10.10.10.50 Now, in case A goes down due to any reason, I would like that B gets ip address 10.10.10.10 so that the application run without any issues. I have created the script for ip change and other setting but would like to know how to run it on B at the time when B is unable to get ping request from A for say 5 minutes. What you need is a failover cluster. Heartbeat[1] is the way to go. References: [1] http://linux-ha.org/wiki/Main_Page - -- They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety. -- Benjamin Franklin, Memoirs of the life and writings of Benjamin Franklin -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkttQZQACgkQHy+EEHYuXnSdewCeLoAb0BY9bnta+kmfAD4aK0D3 FnEAni9GB6u5tyE/96W5+IkhyP5Rpjmx =AdTA -END PGP SIGNATURE- ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] I am unable to understand this C code
On Sat, Feb 6, 2010 at 4:29 PM, rakesh kumar kumar3...@gmail.com wrote: Hi all, Today while studying a book i just saw the following lines of code: int main(void) { int printf(const char *n,...); This is pretty obvious and is declaration of a local function. int a=1; printf(abcdef); This call willl result in the call to above defined local printf() function. return 0; } and the output was: abcdef When i tried to run this code, it ran well without any error and this was asked in GATE exam also. I am confused, how it ran without stdio.h, when i used printf() function and gave the same output as printf gives. Okay after that i commented the third line int printf(const char *n,);, the I think this is because of the improved intelligence in today's compilers. However the compiler warns you about the declaration of the function, but during linkage time since it links the program to the standard c library and hence the printf() function from there is called. output didn't get affected. Now i am thinking when we can use printf() function without any prototype or defining any header, then why do we need to use #include in our program, because when i changed this program a bit One scenario I can think of is portability, other may be conflct which may arise because of a similar declaration of the function somewhere else in the code. by substituting printf() with scanf() it worked fine like scanf() does normally. Can anyone explain me,what is this? Thanks ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd -- Sudhir Kumar ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
[ilugd] Unable to set virtual environment
I am trying to run qemu but I think it is very slow Or not working, $ qemu -cdrom Ubuntu_9.10_i386.iso -hda qemu_disk.img -m 256 -boot d open /dev/kvm: No such file or directory Could not initialize KVM, will disable KVM support May anybody tell me about the error. After booting , ubuntu logo comes followed by a blank screen, but it do not show any desktop. I am unable to boot any of iso images. Does this issue related to hardware ? here is the output of cat /proc/cpuinfo http://www.textbin.com/show_text.php?id=2434o I have also tried using all sort of GUI, like vboxgtk, qemu-launcer but nothing worked out. Do anybody have clue what is wrong with my machine. -- ┌─┐ │Narendra Sisodiya ( नरेन्द्र सिसोदिया ) │Society for Knowledge Commons │Web : http://narendra.techfandu.org └─┘ ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] How to run script on other machine if ping breaks?
Amit Sharma amit_...@... writes: I have created the script for ip change and other setting but would like to know how to run it on B at the time when B is unable to get ping request from A for say 5 minutes. If you want to keep it lightweight instead of bringing in the heartbeat framework, you can script something up based on the ping response itself. ping -c1 ip.address.of.A || do_ip_change_etc You'll have to run it in a loop. And think of the sleep time between pings, and number of ping fails before you switch. PJ ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] I am unable to understand this C code
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 rakesh kumar writes: Hi all, Today while studying a book i just saw the following lines of code: int main(void) { int printf(const char *n,...); prototype of the printf(3) function. int a=1; printf(abcdef); return 0; } [...] You include stdio.h to include the prototypes of the functions, but in above case you already declared the prototype of the function which you invoked, so no need to include the header file. - -- They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety. -- Benjamin Franklin, Memoirs of the life and writings of Benjamin Franklin -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkttliIACgkQHy+EEHYuXnSHcwCfeuCnS30swq+6UBfC5KyGILMm eU8An3RPK8y+vRjQMaXVYi7YEXJ7/MC9 =dyfW -END PGP SIGNATURE- ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Unable to set virtual environment
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 narendra sisodiya writes: I am trying to run qemu but I think it is very slow Or not working, $ qemu -cdrom Ubuntu_9.10_i386.iso -hda qemu_disk.img -m 256 -boot d open /dev/kvm: No such file or directory Could not initialize KVM, will disable KVM support Try loading kvm.ko and, kvm-intel.ko or kvm-amd.ko, depending on the vendor of the CPU. May anybody tell me about the error. After booting , ubuntu logo comes followed by a blank screen, but it do not show any desktop. For how long you waited ? I'm sure this is live cd image and it takes hell lot of time to load... Try loading kqemu.ko to accelerate qemu. - -- They who can give up essential liberty to obtain a little temporary safety, deserve neither liberty nor safety. -- Benjamin Franklin, Memoirs of the life and writings of Benjamin Franklin -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAkttl5QACgkQHy+EEHYuXnTEIwCg5CM+pWCI7yXv9EMSVIHfav6q cYMAoLoztELTPgPo+DUra9bjMUtGT6+Q =iyJU -END PGP SIGNATURE- ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] I am unable to understand this C code
* I think that GATE questions are generally being asked on the basis of logic and not depend how intelligent our compiler is*. I never experienced that any GATE question have been asked based other than the logic. Sudhir, as you wrote that at first time in the third line, when printf was used, it was declaration but i want to ask if it is a declaration then where is the body of the function? and again if it is declaration then when i used the declared function then it should work according to how it was declared no matter that we have used a function that is already declared in C library because function overloading is allowed. It didn't show any warning or anything. I think as it appeared to me,this program has used the library defined printf() function and if compiler can use printf() or scanf() function without declaring prototype then it is out of our convention that we use in our C program and so i think it is something other than the intelligence of compiler. Haven't you ever experienced this type of problem or question? Please tell me some fruitful solution and logic that i can use to solve other question asked in GATE or in other respected exams. Thanks On Sat, Feb 6, 2010 at 4:52 PM, sudhir kumar smalik...@gmail.com wrote: On Sat, Feb 6, 2010 at 4:29 PM, rakesh kumar kumar3...@gmail.com wrote: Hi all, Today while studying a book i just saw the following lines of code: int main(void) { int printf(const char *n,...); This is pretty obvious and is declaration of a local function. int a=1; printf(abcdef); This call willl result in the call to above defined local printf() function. return 0; } and the output was: abcdef When i tried to run this code, it ran well without any error and this was asked in GATE exam also. I am confused, how it ran without stdio.h, when i used printf() function and gave the same output as printf gives. Okay after that i commented the third line int printf(const char *n,);, the I think this is because of the improved intelligence in today's compilers. However the compiler warns you about the declaration of the function, but during linkage time since it links the program to the standard c library and hence the printf() function from there is called. output didn't get affected. Now i am thinking when we can use printf() function without any prototype or defining any header, then why do we need to use #include in our program, because when i changed this program a bit One scenario I can think of is portability, other may be conflct which may arise because of a similar declaration of the function somewhere else in the code. by substituting printf() with scanf() it worked fine like scanf() does normally. Can anyone explain me,what is this? Thanks ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd -- Sudhir Kumar ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] ILUGD meeting: 2.30pm, Sun., 7th Feb., 2010, SIT, JNU
Giving a top-post for a reminder :), See ya guys there. On Fri, Feb 5, 2010 at 6:36 PM, Sudhanwa Jogalekar sudhanwa@gmail.com wrote: Hi, On Wed, Feb 3, 2010 at 4:40 PM, Gaurav Mishra gauravtec...@gmail.com wrote: Hello everyone, Long time since we have had a meeting. So, we will be having one this coming Sunday at the School of Information Technology, JNU. Time and place are tentative and feel free to debate on it if required. There is one main agenda item as of now (Please feel free to add any more agenda items and we can drool over it at the meeting): (a) Planning for Freed.in 2010. Event: ILUG-Delhi meeting Date: Sun., Feb. 7th, 2010 Time: 2.30pm Agenda: o Freed.in planning meeting o Misc: Good to hear that some action is started about Freed.in When is it? -Sudhanwa ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] I am unable to understand this C code
On Saturday 06 Feb 2010, Ashish SHUKLA wrote: [snip] You include stdio.h to include the prototypes of the functions, but in above case you already declared the prototype of the function which you invoked, so no need to include the header file. Well, you also include it to define the FILE data structure and the named streams (stdin, stdout and stderr), but if you're not using them you can happily skip stdio.h. Heck, you can skip the prototype too and all gcc will do is whine a bit if strict ANSI is set (IIRC). Bad programming practice, though. Regards, -- Raj -- Raj Mathurr...@kandalaya.org http://kandalaya.org/ GPG: 78D4 FC67 367F 40E2 0DD5 0FEF C968 D0EF CC68 D17F PsyTrance Chill: http://schizoid.in/ || It is the mind that moves ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] ILUGD meeting: 2.30pm, Sun., 7th Feb., 2010, SIT, JNU
See you. I know - top post ;) R -Original Message- From: ilugd-bounces+rajesh.lalwani=blogworks...@lists.linux-delhi.org [mailto:ilugd-bounces+rajesh.lalwani=blogworks...@lists.linux-delhi.org] On Behalf Of Gaurav Mishra Sent: Sunday, February 07, 2010 12:47 AM To: Sudhanwa Jogalekar; ilugd Subject: Re: [ilugd] ILUGD meeting: 2.30pm, Sun., 7th Feb., 2010, SIT, JNU Giving a top-post for a reminder :), See ya guys there. On Fri, Feb 5, 2010 at 6:36 PM, Sudhanwa Jogalekar sudhanwa@gmail.com wrote: Hi, On Wed, Feb 3, 2010 at 4:40 PM, Gaurav Mishra gauravtec...@gmail.com wrote: Hello everyone, Long time since we have had a meeting. So, we will be having one this coming Sunday at the School of Information Technology, JNU. Time and place are tentative and feel free to debate on it if required. There is one main agenda item as of now (Please feel free to add any more agenda items and we can drool over it at the meeting): (a) Planning for Freed.in 2010. Event: ILUG-Delhi meeting Date: Sun., Feb. 7th, 2010 Time: 2.30pm Agenda: o Freed.in planning meeting o Misc: Good to hear that some action is started about Freed.in When is it? -Sudhanwa ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] Unable to set virtual environment
On 02/06/2010 09:53 PM, wahjava...@gmail.com (Ashish SHUKLA) wrote: narendra sisodiya writes: I am trying to run qemu but I think it is very slow Or not working, $ qemu -cdrom Ubuntu_9.10_i386.iso -hda qemu_disk.img -m 256 -boot d open /dev/kvm: No such file or directory Could not initialize KVM, will disable KVM support Try loading kvm.ko and, kvm-intel.ko or kvm-amd.ko, depending on the vendor of the CPU. kvm can only be loaded if the CPU supports VT extensions (in Intel). Unless the CPU has virtualization support, it will not load the KVM module. If only the requirement is of running a Live ISO as a virtualized guest, then I would go for VirtualBox, OR if the CPU has VT support, then virt-manager. I usually buy machines with VT support only, as the performance advantage of running guest machines via that is worth it. Regards Vivek Kapoor http://exain.com ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd
Re: [ilugd] ILUGD meeting: 2.30pm, Sun., 7th Feb., 2010, SIT, JNU
On Sun, Feb 7, 2010 at 12:46 AM, Gaurav Mishra gauravtec...@gmail.comwrote: Giving a top-post for a reminder :), See ya guys there. On Fri, Feb 5, 2010 at 6:36 PM, Sudhanwa Jogalekar sudhanwa@gmail.com wrote: Hi, On Wed, Feb 3, 2010 at 4:40 PM, Gaurav Mishra gauravtec...@gmail.com wrote: Hello everyone, Long time since we have had a meeting. So, we will be having one this coming Sunday at the School of Information Technology, JNU. Time and place are tentative and feel free to debate on it if required. Also to remind those who know, and inform those who do not: The main gate of JNU adjoining Munirka is closed due the re-laying of water pipelines on the road. The entrance to the university is now from the East gate which is opposite the institutional area (Mezbaan restaurant for the foodies), on Aruna Asaf Ali Marg. This road connects Vasant Kunj - Fortis Hospital - to the outer ring road, near Ber Serai. If you are travelling along (a) The outer ring road, turn after the IIT hostel gate, pass Ber Serai go along the road towards Vasant Kunj. (b) the Katwaria Sarai road, behind IIT - turn LEFT at the T-junction at the end of the road, and you hit the gate almost immediately (c) travelling toward JNU from Vasant Kunj - use the Aruna Asaf Ali marg (landmark Fortis Hospital). Buses (615) are diverted to this gate, so you just have to sit still. There is one main agenda item as of now (Please feel free to add any more agenda items and we can drool over it at the meeting): (a) Planning for Freed.in 2010. Event:ILUG-Delhi meeting Date: Sun., Feb. 7th, 2010 Time: 2.30pm Agenda: o Freed.in planning meeting o Misc: Good to hear that some action is started about Freed.in When is it? -Sudhanwa ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd -- Freed.in : Freedom in technology and software ___ Ilugd mailing list Ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd