Wednesday, December 16, 2009

learning vs innovation

I am sure most of you might have got the chance to build your resume someday in your life. It doesn't matter if you are from engineering background, medical or may be any other respected field, one sentence which is commonly used by all of us despite of our backgrounds and education is that "I am a good learner". Now, I don't have any serious issues with this sentence because I myself have used it many times in my resume also but most of the time by copying from the web or from resume of my friends. The problem is that instead of saying that I am good in learning, shouldn't we come up with a sentence like we are good in innovation. Why, we indians always try to learn the things rather than inventing what we need ourselves. I mean just take an example of Microsoft people sitting over there creates a new technology .net and then NIIT in india launches a nationwide course for that.  Why should I learn .net so that at the end of course I should know that Sun has launched java for me. The problem is not in the IT industry only. We lacks innovation almost everywhere. Why can't we try to come up with our own medicine for swine flu rather than waiting for US to come up with the therapy and then our so called lab technicians are going to learn about that to develop one in india. Why do we need to send our research papers to US to get an approval of anything if we come up with. If we have a problem in our own country, why can't we come up with a solution ourselves or at least respect the people who are trying. The question is to find out the meaning of education here. Is it learning new things only or we are just taught in a way to cram as much as possible to increase our chances of getting a good job. God knows, I m still confused.

Wednesday, January 21, 2009

Internet connection sharing on fedora core 10

Many times it happens that you are happily enjoying a broadband internet connection on your laptop and then suddenly your room-mate decides to bring a new machine for him also. So, now instead of buying one more internet connection, you can actually share the same connection by making one of your machine as a router.

I assume the machine which is connected to the internet has at least two network interfaces (e.g eth0, wlan0 etc). If the machine A has internet connection on eth0 then it can use wlan0 or may be another Ethernet interface ath0 to set up a network with machine B on the corresponding interface.

So, the steps for internet connection sharing are as follows:

Step 1: Set up a network between machine A and machine B.
Step 2: Flush the iptables rules in machine A.
Step 3: Set up IP forwarding in machine A.
Step 4: Set up the new nameserver in /etc/resolve.conf for machine B.
Step 5: Happily enjoy the connection on both machines.

This is how you can execute the above steps:

Step 1: Set up network between machine A and machine B.
I assume machine A is connected to the internet on Ethernet interface eth0 and the two machines are connected to each other through wireless interface wlan0.

So the network settings for the two connections would be something like this:

eth0:
Machine A:
IP: 192.168.1.2 Subnetmask: 255.255.255.0 Gateway: 192.168.1.1
This can be different depending upon your connection. They will be set automatically if your service provider uses DHCP. Its just the gateway which is important for us.

Now, for network on wlan0 use the following settings on two machines:

wlan0:
Machine A:
IP: 192.168.0.1 Subnetmask: 255.255.255.0 Gateway: 192.168.1.1

Machine B:
IP: 192.168.0.2 Subnetmask: 255.255.255.0 Gateway: 192.168.0.1

Please keep in mind that, the default gateway for wlan0 on machine A is the default gateway on eth0 for machine A and default gateway for wlan0 on machine B is IP of machine A on wlan0.


Step 2: Flush the old iptable rules on machine A:
Type the following commands on your terminal to flush the existing firewall rules:
iptables -F
iptables -t nat -F
iptables -t mangle -F

Now to delete the chains containing above rules type following commands in terminal:
iptables -X
iptables -t nat -X
iptables -t mangle -X

Save and restart the iptables with the following commands:
service iptables save
service iptables restart


Step 3: Set up IP forwarding in machine A.
Set value of net.ipv4.ip_forward = 1 in /etc/sysctl.conf and save the file.

Set new forwarding rule in iptables by typing following command in terminal:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Again save and restart the iptables by typing following command:
service iptables save
service iptables restart


Step 4: Setup the new nameserver in /etc/resolve.conf for machine B.

Open the /etc/resolve.conf in machine B and add following line:
nameserver 192.168.1.1

Mind it, that the nameserver added is the default gateway for eth0 connection on machine A.

Step 5: Well, If all the above steps have executed successfully for you, then don't waste your time on step 5 :).