Connecting two computers using a twisted pair cable (or a switch)

Sometimes being able to connect two computers using a twisted pair cable or a switch is extremely useful for copying data.

Once we have plugged the cable in both computers (or we have plugged both cables in the switch), we must assign a new IP address to both machines:

ifconfig eth0 10.0.0.1 netmask 255.255.255.0
ifconfig eth0 10.0.0.2 netmask 255.255.255.0

To check whether both computers communicate, we must ping each computer from the other one:

ping 10.0.0.1
ping 10.0.0.2

It is important to ping always the other machine, because pinging the same address (i.e., 10.0.0.1 from 10.0.0.1) always works.

If no packet has been lost, computers communicate because both can send a receive packets. But to move files, one must select a proper protocol.

For security reasons, during this connection no computer should be physically connected to the net.

When everything is done, we get the default internet connection configuration again by restarting the system or by running as administrator:

/etc/init.d/network restart
Posted in Personal technotes. Comments Off on Connecting two computers using a twisted pair cable (or a switch)

Copying your MBR

To check whether an issue with my laptop’s in-line recording is a hardware problem or a buggy audio driver, the guy from Dell’s technical support asked me to install Windows to discard a software failure. I have been asked to do that after having the mainboard replaced (laptops have no separated sound cards). I have to decrease the size of one of my partitions, create a new one and format it as FAT32.

But the issue here is that Windows will rewrite the master boot record (to promote competition ;-)) when installing it.

I have asked how to restore the original MBR at Mandriva Expert and thanks to the replies, I have a method to copy and restore the MBR.

As administrator, run the following command:

dd if=/dev/sda of=mbrsave bs=512 count=1

To have it back, run as administrator again:

dd if=/path/to/mbrsave of=/dev/sda

Many thanks, George and Jean-Pierre, for the tip.

Posted in Personal technotes. Comments Off on Copying your MBR