HOW-TO: Copy files from network
then!
often happens that we need to send information from one PC to another, but for reasons they are, the solutions "conventional" we do not solve the problem. Suppose we want to send the entire contents of a hard drive or just want to send "information release" for communication between programs, but do not want to be reading files in shared folders, or want to make a communication program ...
Well, we can use sockets to send this information. In Linux, we have the tool "nc" (there is plenty of information on the Internet) is nc tool that will allow us to create sockets for everything that comes to mind.
Let's review the concept of socket. Socket is a communication method by which two entities communicate, which can acquire the role of client or server.
Make a socket is very easy, in a "customer" write ip 192.168.1.10:
nc-l-p 6000
In a "server" write: nc 192.168.1.10 6000
Observe that everything you write on the server appears in the client console. In this case, client and server can be two consoles on the same computer. Press Ctrl + c to end the session. Look
"man nc" to see what each parameter. Now let's send a file:
PC (or console) Receiver: nc-l 6000 6000
Observe that although the file was received, the connection does not close until you hit control + c in the issuer (if we do it in the receiver may not receive all the information) that also sets the transmission is closed if the client hit control + c, we must remember those things.
Now suppose we have a large file and we are so clever they decided to send it compressed, but it is so great that can not be compressed without filling up the remainder of the disc. Well, we can compress the fly
192.168.1.10 PC Receiver: nc-l 6000 compress the file but not store it in local disk, but it sends it to standard output (Parameter "f -") There is addressed to and sent to 192.168.1.10 nc
Meanwhile, the receiver directs all that reaches across the network to the standard output and there is directed to tar to be unpacked in the same place.
benefits are obviously the better use of bandwidth and that the information is compressed.
observed that the transmission does not close until the issuer press control + c on your console.
power Imagine this: you can do, communication scripts, backups on the fly communication protocols and everything you can think of. Let
partridge rolling over and giving another turn of thread. Let's make a program of communication theory.
PC 1: 192.168.1.10
In a console 1:
nc-l-u-p 6000
In another console 2: nc-u
192.168.1.11-p 7000
PC 2: 192.168.1.11
In a console 1:
nc-l-u-p 7000
In another console 2: nc-u
6000 192.168.1.10
There it is: everything write to the console 2 will be sent to the console 1 from the other team, and all that another computer on your console type 2 will be sent to the console 1 from ours.
Observe the "-u". This means that using the protocol "UDP" (send unacknowledged) ie if the other press control + c on your console, do not break our console, in fact, do not know if it's there.
Henceforth, all yours, all you can think of.
Linux power!
Tuesday, December 16, 2008
Friday, December 5, 2008
Portable Mba Marketing
Repair: Recover Root Password
And again. It is known that there are people who, after installing ubuntu, is "forgotten" root password and can not access the system.
1-Start with the LiveCD
2-Open a console
3-Mount the main unit of your Linux (
here
see Section 2)
In our case, / dev/sda5 is the main unit: sudo mount / dev/sda5
4 - Make a chroot in / mnt
sudo chroot / mnt
5 - change the password as if such a thing
Passwd
6 - Finish and restart your computer.
exit sudo reboot Enjoy
;
And again. It is known that there are people who, after installing ubuntu, is "forgotten" root password and can not access the system.
GNU / Linux is a very secure system for networking, but unlike other systems, assumes that you are intelligent and not completely protected from certain actions on the physical computer. Today we operate one of these back doors that Linux has to change the root password.
just need a LiveCD of Ubuntu. Well, the pit: 1-Start with the LiveCD
2-Open a console
3-Mount the main unit of your Linux (
here
see Section 2)
In our case, / dev/sda5 is the main unit: sudo mount / dev/sda5
4 - Make a chroot in / mnt
sudo chroot / mnt
5 - change the password as if such a thing
Passwd
6 - Finish and restart your computer.
exit sudo reboot Enjoy
;
Thursday, December 4, 2008
Coby Tf-dvd1023 10.2-inch Widescreen
Repair: Lost Grub after installing Windows
are many users who migrate from Windows to Linux platform, and Ubuntu mostly. Have long helped in ubuntu-es.org and to the huge amount of times I've had to repeat this, I decided to create an entry just for this. Yes, here I will explain in chapter and verse.
Solution: Reinstalling Grub in the MBR of the hard disk.
need: A Live CD of Ubuntu.
1 - Introduce the Ubuntu LiveCD in the drive, turn on your machine and boot from the LiveCD, let it all flow quietly until you see the classic desktop of a pristine Ubuntu.
2 - Open a console
Theory:
Before typing anything on the console as an organization must understand GNU / Linux drives and partitions.
Well how do we know which device is our record of ubuntu? Easy, the first of which is Linux file system. In this case it is / dev/sda5. In yours will be 1 or 2 or 3, it depends.
In console write: sudo mount / dev/sda5 / mnt (do not return anything)
4 - Restoring Grub
In the same console type: sudo grub-install - root-directory = / mnt / dev / sda
And everything ready, no more history, restart your computer and enjoy GNU !
are many users who migrate from Windows to Linux platform, and Ubuntu mostly. Have long helped in ubuntu-es.org and to the huge amount of times I've had to repeat this, I decided to create an entry just for this. Yes, here I will explain in chapter and verse.
The problem: We had ubuntu installed and then (either repair or planning) install Windows. It happens that Windows is very accustomed to camp alone for a hard drive, even more for your MBR, and inevitably tramples every time a facility is walking by those dollars. Things in life.
What has happened to our Ubuntu (or GNU / Linux)? Well do not be scared, because nothing happened at all, is still intact (wherever you are ...) Solution: Reinstalling Grub in the MBR of the hard disk.
need: A Live CD of Ubuntu.
1 - Introduce the Ubuntu LiveCD in the drive, turn on your machine and boot from the LiveCD, let it all flow quietly until you see the classic desktop of a pristine Ubuntu.
2 - Open a console
Theory:
Before typing anything on the console as an organization must understand GNU / Linux drives and partitions.
Write in console: sudo fdisk-l You should have something like this: (quietly, in your machine will have two or three lines, alo most)
Each unit that detects USB or SATA, is released into the devices directory "/ dev". Under the name "sd" + a letter. The letter corresponds to the number of unity, "a" for the first, "b" for the second ... etc.
addition, the above is assigned a number for each partition detected in the unit, so that the first partition on the disk will be "sda1" The second partition of first disk will be 2 (sda2) the second partition second disk will be "sdb2." I guess you imagine where the shots go.
And all these units are located files in / dev. "
3 - Identify where you installed Ubuntu:
Well how do we know which device is our record of ubuntu? Easy, the first of which is Linux file system. In this case it is / dev/sda5. In yours will be 1 or 2 or 3, it depends.
In console write: sudo mount / dev/sda5 / mnt (do not return anything) 4 - Restoring Grub
In the same console type: sudo grub-install - root-directory = / mnt / dev / sda
And everything ready, no more history, restart your computer and enjoy GNU !
Subscribe to:
Posts (Atom)