Sunday 2 September 2007

TVAnts on Ubuntu

TVAnts is a peer to peer program that allows you to share live streams instead of files.
Although these streams can contain any sort of media they are mostly used for watching live football matches and other events on PCs.


TVAnts pages:

www.tvants-ppstream.com
Official TVAnts page is written in chinese: tvants.com


Installing TVAnts:

Download TVAnts setup program: ( I have obtained this address from official TVAnts page.)
$wget http://88.191.73.231/~cali/tvants/TvantsSetup.exe

We need wine to run TVAnts setup program because it is a microsoft windows executable:
$sudo aptitude install wine       # if you have not already installed wine program.
$wine "TvantsSetup.exe"

It will install itself, and then we will be able to exec the program:
$wine ~/.wine/drive_c/Program\ Files/TVAnts/Tvants.exe
or
$wine 'C:\Program Files\TVAnts\Tvants.exe'


Watching TV:

You will need at least one server at server tab.
e.g: list.tvants.com

At search tab you will be able to search for hundreds of channels.
Select some and add them to channel tab.

NOTE: Do not worry about error messages related to windows media player, we will use mplayer.

You can watch the channel you have selected runing in the console:
$mplayer -framedrop mms://localhost:16900/1
Last "1" means first channel from your selected channels list.
NOTE: Whenever you add a new channel this number increases in one, even if you delete previous unused channels.


NOTE: TVAnts is a peer to peer system so you should open 16800 port on your box to share streams you are watching with other users.

NOTE: You can also watch the tv streams using vlc instead of mplayer.

Tuesday 21 August 2007

GRID Computing

It looks fascinating!

Introduction to grid computing (IBM papers)

Sunday 19 August 2007

BOINC Distributed Computing Projects

Donating spare CPU cycles to distributed computing projects.



Most of time your cpu load is well below under 100%.

You can check how many resources are you using right now, going to menu:
System --> Administration --> System Monitor

What about if this spare resources all over the world would be used by projects like curing diseases,
discover extraterrestrial inteligence, predice climate changes... ?

That is actually possible, here you have a list of projects you can participate:
http://boinc.berkeley.edu/projects.php


These are all distributed computing projects, based on BOINC platform.


Let's try this thing for real. First step will be installing BOINC:

BOINC - Debian and Ubuntu installation

$sudo aptitude update

$sudo aptitude install boinc-client boinc-manager

execute graphic boinc manager:
$boincmgr

you only have to follow wizard instructions.

NOTE: To join a project:
menu bar Tools -> Attach to project

NOTE: You will need konqueror browser to navigate the web from boincmgr.


Some info about interesting BOINC projects:

Roseta@home project: http://boinc.bakerlab.org/rosetta/

Rosetta@home needs your help to determine the 3-dimensional shapes of proteins in research that may ultimately lead to finding cures for some major human diseases. By running the Rosetta program on your computer while you don't need it you will help us speed up and extend our research in ways we couldn't possibly attempt without your help. You will also be helping our efforts at designing new proteins to fight diseases such as HIV, Malaria, Cancer, and Alzheimer's (See our Disease Related Research for more information). Please join us in our efforts! Rosetta@home is not for profit.


Climateprediction.net: http://climateprediction.net

Climateprediction.net is the largest experiment to try and produce a forecast of the climate in the 21st century. To do this, we need people around the world to give us time on their computers - time when they have their computers switched on, but are not using them to their full capacity.
[read more about the experiment]

Sunday 12 August 2007

Zattoo on Ubuntu Feisty

Zattoo is a program that allows us to see streaming TV channels over Internet.

It is unfortunately closed source.


Let's go to official Zattoo web page: zattoo.com

Check on your language flag to see what channels are available to see at your zone.


Register to obtain zattoo program: http://zattoo.com/register

After registering, select linux and download zattoo deb file:
e.g: zattoo-2.2.10.6523-i386.deb

Now install the deb file:
$sudo dpkg -i zattoo-2.2.10.6523-i386.deb

I get dependency problems:
zattoo needs libgtkglext1 and libxul0d but those are not installed.

We install those required packages:
$sudo aptitude install libgtkglext1 libxul0d

Once dependencies are solved zattoo package configures automatically.
If that does not happen, then exec:
$sudo dpkg --configure zattoo

Download and install the Adobe Flash plugin from http://www.adobe.com if you have not it on your system yet.

run:
$zattoo_player

introduce your zattoo login (used when registering) and enjoy!

NOTE: To obtain new zattoo versions when they will be available, go to zattoo page, click on login word near country flags, and introduce your email and password.

NOTE: If you wanna know on which ports zattoo is listening, exec this command:
$sudo netstat -l -p -e | grep -i zattoo

Monday 30 July 2007

Backup your system using TAR

My system is a Debian Sid one (This article was first tested in an Ubuntu Feisty system)
Anyway this article is also useful in most other linux distros.

Tar tool allows us to make backups or even restore them, while our system is running.


It is a good idea becoming root to be able to access every file on the system, or at least you should use sudo command:

$sudo tar cvzpf /home/Backup.tgz --same-owner --exclude=/home/Backup.tgz --exclude=/home/error.log --exclude=/proc/* --exclude=/media/* --exclude=/dev/* --exclude=/mnt/* --exclude=/sys/* --exclude=/tmp/* / 2>/home/error.log


Tar options and arguments


c creates a tar backup
v activates verbose mode
z will compress data using gzip format
p preserves file permissions
f sends output to a file instead of standard output.

After f option it is necessary to write the file name where backup will be stored.
i.e: tar cvzpf /home/Backup.tgz is correct, but
tar cvzfp /home/Backup.tgz is wrong.

/home/Backup.tgz is our backup file name.

--same-owner preserve file ownership, it is not necessary because, being root, is a default option.



Excluding files from Backup


--exclude option gives us the possibility of excluding files and directories from backup.

--exclude=/home/Backup.tgz --exclude=/home/error.log Prevent Backup file and error log file to be stored.


--exclude=/proc/* --exclude=/dev/* --exclude=/sys/*

These are virtual directories so will not be stored.

NOTE: Difference between --exclude=/proc/* and --exclude=/proc is that first option would store a void proc directory, and second one would store nothing.

--exclude=/tmp/*

/tmp is a temporary directory, and is deleted on every boot, so will not be backed up either.


--exclude=/mnt/* --exclude=/media/*

If you want to save your main system only, and not what you have mounted on it, you should exclude these directories.


WHICH DIRECTORIES TO EXCLUDE?

Wednesday 25 July 2007

Errors and Solutions

Solutions to common linux related errors appear frequently along this blog.
Unfortunately it is very difficult to track them from main page.

This blog entry shows a list of common errors and corresponding articles where solutions are explained.

Wednesday 18 July 2007

Installing Qemu on a Ubunty Feisty System

That simply command will install qemu emulator:
$sudo aptitude install qemu

Right now, qemu works as an emulator, that is, emulates every guest system instruction on the host system.
Emulating is a slow working mode, but if qemu runs on a x86 platform, it is possible to execute guest code directly as host code so speed will improve. (That is called virtualization)


INSTALLING KQEMU MODULE

To use virtualization mode in qemu, we have to install kqemu.

#aptitude install kqemu-common
That package has some documentation and a configuration file, but is not really kqemu module

$sudo aptitude install kqemu-source # Installs kqemu module sources


Compiling sources:

NOTE: You will need libc6-dev package to be able to compile kqemu sources.
If you haven't it: $sudo aptitude install libc6-dev

$sudo su # Becoming root

#cd /usr/src
# tar xvfj kqemu.tar.bz2
#cd modules/kqemu
# ./configure
#make
#make install


kqemu module is now installed!!

Gonna load kqemu module:
#modprobe kqemu

and then run qemu:
#qemu -m 256 -cdrom .....

Appears an error:
"Could not open '/dev/kqemu' - QEMU acceleration layer not activated"

This bug occurs because qemu searchs for a module which major number equals zero and kqemu-common has set it to 250.

To solve that:
#rmmod kqemu
#gedit /etc/modprobe.d/kqemu


and change 250 by 0

again:
#modprobe kqemu
#qemu -m 256 -cdrom .......



SETTING THE NETWORK IN QEMU

If you dont specify network options when invoking qemu, then defaults apply.

This default options are: -net nic -net user
-net nic : emulates a NE2000 network interface card.
-net user: use the user mode network stack which requires no administrator priviledge to run.

That should be enough to have network working in your virtual machine but with some limitations:
* Pings are not available.
* By default User mode network stack allow us to navigate and connect to our host system, but not to act as a server.

User mode network stack has a built in dhcp server that will provide us an ip address.

If everything has gone fine you can open a browser and surf on the internet.

If you cannot connect to internet, open a console and type:
$ifconfig

check if virtual nic has its associated ip address and if not, exec this command:
$sudo dhclient eth0 # eth0 is your virtual nic

try your browser again.


NOTE: Another way to configure the network in qemu consists in using a tap device and a network software bridge, instead of using user mode network stack.

Saturday 7 July 2007

Apt, Aptitude and Dpkg Reference

Apt, Aptitude and Dpkg are Debian package managing tools. Let's see a small reference about them:

# apt-get install foo ....................... Installs foo package
# apt-get remove foo ........................ Removes foo package
# apt-get remove --purge foo ................ Removes foo package and its configuration files.
# apt-get update ............................ Updates package database.
# apt-get -f install......................... Installs and removes packages in order to fix dependency problems.
# apt-get clean ............................. Deletes all .deb packages from local repository.
# apt-get upgrade ........................... Upgrades all packages to its newer versions.
# apt-get dist-upgrade ...................... Upgrades packages but also deals with dependency problems caused by new packages.
$ apt-get source foo ........................ Downloads foo package source files.
# apt-get -t unstable foo ................... Installs foo package searching for foo package and its dependencies at unstable version.
# apt-get foo/unstable ...................... Installs foo package from unstable version, but searchs for dependencies without overriding priorities at /etc/apt/preferences file.
# apt-get build-dep foo ..................... Installs all necessary packages to satisfy the build dependencies for foo source package.

$ apt-cache show foo ........................ Gives a long info description about foo package.
$ apt-cache search foo ...................... Searchs for packages that match "foo" pattern.

# apt-file update ........................... Resynchronize the package contents from their sources (/etc/apt/sources.list)
$ apt-file search foo ....................... Lists all packages containing files that match foo pattern. Searchs also in not installed packages.

# aptitude install foo ...................... Installs foo package
# aptitude remove foo ....................... Removes foo package
# aptitude remove --purge foo ............... Removes foo package and its configuration files.
$ aptitude search foo ....................... Searchs for packages that match "foo" pattern
# aptitude update ........................... Updates package database.
# aptitude upgrade .......................... Upgrades packages to its newer versions.
# aptitude safe-upgrade ..................... Same as aptitude upgrade.
# aptitude full-upgrade ..................... Upgrades packages to its newer versions, taking care about dependencies. Sames as dist-upgrade.
# aptitude hold foo ......................... Marks foo package so it will not be removed or upgraded when executing safe-upgrade or full-upgrade
# aptitude unhold foo ....................... Turn off the hold on foo package.
$ aptitude show foo ......................... Gives a long info description about foo package.
# aptitude clean ............................ Removes all previously downloaded .deb files from the package cache directory.
$ aptitude download foo ..................... Downloads foo package to current directory.
#aptitude build-deps foo .................... Installs all binary dependencies needed to build foo source package.

# dpkg -i foo ............................... Installs foo package
# dpkg -i --force-depends foo ............... Converts all dependency errors into warnings and installs foo package.
# dpkg -r foo ............................... Removes foo package
# dpkg --purge foo .......................... Removes foo package and its configuration files too.
$ dpkg -l *foo* ............................. Lists packages containing "foo" pattern.
$ dpkg -L foo ............................... Lists files pertaining to foo package.
# dpkg-reconfigure -plow foo ................ Reconfigures previously installed "foo" package, asking all configuration questions.
# dpkg --configure -a ........................... Configures all packages that have been unpacked but not yet configured.
$ dpkg --search foo ......................... Lists packages containing files matching foo pattern. Only searchs on installed packages.
$ dpkg -c foo.deb ........................... List files contained in foo.deb package.
$ dpkg -I foo.deb ........................... Shows info about foo.deb package.

$ dpkg-query -S foo ......................... Searchs for a filename from installed packages listed in the local dpkg database.

$ dpkg-buildpackage -us ..................... Builds debian package from its source code.


More info at:
The Debian package management tools.
APT Howto.
Debian package management.

How to create an Ubuntu UsbLive with persistence

First step is downloading Ubuntu Dapper iso file:

NOTE: Newer versions(Feisty and Gutsy), by now, july 2007, have a bug that prevents to use persistence feature.

You can navigate to Ubuntu download page and select Ubuntu 6.06 LTS Desktop edition (alias Dapper),

or simply enter at console command line:
$wget http://releases.ubuntu.com/dapper/ubuntu-6.06.1-desktop-i386.iso


I recommend a usb pendrive with a capacity higher than 1 Gigabyte, because you will need at least 700 megabytes to copy dapper iso file on it.
In my case I use a 2G pendrive.


Connect the usb pendrive so it be detected.

$dmesg command will show something like:

[ 2697.454838] usb-storage: device found at 4
...
[ 2704.387453] SCSI device sdh: 4029440 512-byte hdwr sectors (2063 MB)


$fdisk -l also shows the new device.

If you still dont find it, you can seek for it at $cat /proc/bus/usb/devices output.


On my system the new device appears as /dev/sdh, in this tutorial, to be more general, I will write it as /dev/sdX.


Next step will be partitionating our usb pendrive: (choose the program you prefer: fdisk, cfdisk, gparted ...)

#fdisk /dev/sdX

(for help on this step read $man fdisk)


I partitionate the device into two partitions sdX1 and sdX2, both sized one gigabyte, and make bootable the first one, showing this result with fdisk:

DeviceActiveBeginningEndBlocksIdSystem
/dev/sdX1*1493978081bW95 FAT32
/dev/sdX24941015103564883Linux





Umount both partitions if they are mounted and then format them with:

#mkfs.vfat -F 32 -n usb /dev/sdX1
#mkfs.ext3 -L casper-rw -b 4096 /dev/sdX2

NOTE: casper-rw label is important, do not change it.


Mount dapper iso file in your harddisk:
#mkdir dapper_directory
#mount -o loop ubuntu-6.06.1-desktop-i386.iso dapper_directory



Copy iso files to first usb pendrive partition:
#mount /dev/sdX1 /media/foo
#cd dapper_directory
#cp -dpR . /media/foo



Installing grub bootloader:

#grub-install --root-directory=/media/foo /dev/sdX

this does not install menu.lst file so we will create it manually:
$sudo gedit /media/foo/boot/grub/menu.lst


Howto change isolinux.cfg entries (/media/foo/isolinux/isolinux.cfg) into menu.lst format:

E.g: isolinux.cfg entry

LABEL live
menu label ^Start or install Ubuntu
kernel /casper/vmlinuz
append boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash --


changes into: (menu.lst entry)

title Start or install Ubuntu
root (hd0,0)
<---------------- this is necessary to identify usb device at boot. kernel /casper/vmlinuz boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram rw quiet splash
initrd /casper/initrd.gz
boot


NOTE: If you have problems creating menu.lst file, copy the one that appears at the end of this article.

Now you have written a correct menu.lst file at /media/foo/boot/grub directory exec again:
#grub-install --root-directory=/media/foo /dev/sdX

NOTE: If grub gives this error message "/dev/sdX does not have any corresponding BIOS drive"
execute this command:
#grub-install --root-directory=/media/foo --recheck /dev/sdX


NOTE: to be able to run your usb pendrive from qemu you have to trick the emulator giving a usb dapper iso as a cdrom device e.g:
#qemu -hda /dev/sdX -cdrom ubuntu-6.06.1-desktop-i386.iso -boot c


If you want to restart your computer to probe your creation, run:
#eject /dev/sdX

NOTE: eject /dev/sdX umounts sdX partitions and deletes /dev/sdX, /dev/sdX1,... devices

Restart and boot from your usb pendrive.


Have fun!!


APPENDIX: Example of menu.lst file

NOTE: persistent tag at first kernel line enables persistence mode in our usb pendrive.

timeout         10

color cyan/blue white/blue


title           Start Ubuntu in Persistent mode
root            (hd0,0)
kernel          /casper/vmlinuz boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram rw persistent
initrd          /casper/initrd.gz
boot

title           Live - Start or install Ubuntu
root            (hd0,0)
kernel          /casper/vmlinuz boot=casper initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram rw
initrd          /casper/initrd.gz
boot

title           Start Ubuntu in safe graphics mode
root            (hd0,0)
kernel          /casper/vmlinuz boot=casper xforcevesa initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram rw
initrd          /casper/initrd.gz
boot

title           Check CD for defects
root            (hd0,0)
kernel          /casper/vmlinuz boot=casper integrity-check initrd=/casper/initrd.gz ramdisk_size=1048576 root=/dev/ram rw
initrd          /casper/initrd.gz
boot

title           Memory test
root            (hd0,0)
kernel          /install/mt86plus
boot



This article is based on this excelent spanish one extracted from Daniel Perella's Blog.

Tuesday 26 June 2007

Xen

Xen is a virtual machine monitor (VMM) for x86-compatible computers. Xen can securely execute multiple virtual machines, each running its own OS, on a single physical system with close-to-native performance.

Xen Wiki

Xen (Wikipedia)

Xen FAQ

howto-install-windows-xp-vista-on-xen

A brief introduction to xen-tools (debian-administration.org)

Installing Xen 3.0 upon Debian Sarge

Gentoo Linux Distribution

Gentoo official page

Gentoo Linux Distribution (Wikipedia)

Gentoo Linux operating system is designed to be modular, portable, easy to maintain, flexible, and optimized for the user's machine. All tools and utilities are built from source code. For convenience, however, several large software packages are also available as precompiled binaries for various architectures via the Portage system.

It is a distro oriented to developers and network professionals. Gentoo at distrowatch

Gentoo Wiki

Packages Online Database.


INSTALLING

Downloading Gentoo

Installing Gentoo Handbook

Linux Gazette article about installing Gentoo


LIVE CD

HowTo build a LiveCD from scratch (Gentoo-Wiki)


IRC CHANNEL

#gentoo at irc.gnu.org


OTHER INTERESTING LINKS

Embedded Gentoo

Gentoo Development Guide

Tuesday 19 June 2007

File types and Debian packages

This article describes some file types (their extensions) and programs and debian or ubuntu packages to visualize those file types.

File ExtensionProgramDebian/Ubuntu packageFile Description
.chmxchmxchmMicrosoft help files
.djvudjviewdjview / djvulibre-pluginDjvu file format for documents (alternative to pdf)
.rarunrarunrarRar compressed file format
.flvmplayermplayerFlash video file format
.pdfxpdfxpdfPortable Document Format
.docabiwordabiwordMicrosoft Word document format
.gzgzipgzipCompressed file using Lempel-Ziv coding (LZ77) algorithm
.bz2bzip2bzip2Compressed file using Huffman coding and Burrows-Wheeler compression algorithm
.avimplayermplayerAudio Video Interleave File

Audio Video Interleave File'

Sunday 17 June 2007

Bash tips

http://builder.com.com/5100-6372_14-5827311.html

Customizing the bash command prompt




COMMAND REFERENCE

Linux Command Reference Index

Another command Reference

O'Reilly Command Reference

GNU/Linux Command Line Tools Sumary

Learning the Shell Tutorial





Changing X resolution

$xrandr #shows all available resolutions
i.e:
SZ: Pixels Physical Refresh
*0 1024 x 768 ( 271mm x 203mm ) *61
1 800 x 600 ( 271mm x 203mm ) 73
2 640 x 480 ( 271mm x 203mm ) 73


now, to switch to 800x600 resolution we can exec:

$xrandr -s 1

or

$xrandr --size 800x600

wait for 5 secs and voila! resolution changed!

NOTE: another way to change resolution is pressing ctrl+alt++ or ctrl+alt+- keys

NOTE: this command is very useful to change qemu X-windows resolution when it is bigger than your screen.




Listing file sizes in human readable form:

ls -l # shows file sizes, usually in bytes.

if you want to list them in a more readable way type:

ls -lh

NOTE: this "h" switch option also works with other commands like df, du, etc.




Obtaining an ISO file from a CDRom

You need to now what device your cdrom drive is associated to: (In this example will be /dev/sdX)

exec this command:
dd if=/dev/sdX of=cdrom_image.iso bs=1000000

that makes a byte by byte copy from /dev/sdX device (our cdrom) to cdrom_image.iso file in 1000000 bytes size chunks.

NOTE: Change bs argument to suit your needs. That value has effect on the speed the copy is performed.

Tuesday 12 June 2007

Resizing partitions with GParted

GParted stands for Gnome Partition Editor

GParted is an industrial-strength package for creating, destroying, resizing, moving, checking and copying partitions, and the filesystems on them. This is useful for creating space for new operating systems, reorganizing disk usage, copying data residing on hard disks and mirroring one partition with another (disk imaging).


Supported Filesystems

Before using GParted we should check if it supports the filesystems we want to deal with:
Filesystems supported

More info about filesystems from Wikipedia.


Getting GParted

GParted is distributed within three ways, as source code, as live cd or as live usb.

I choose to download and use the live cdrom one: GParted Live CD.

So I download and burn it to a writable cd, and then boot my computer from this cdrom.


NOTE: When booting GParted live cd, my tft screen ends black. To solve that, press ctrl+alt+del. Then at console mode exec #Forcevideo and select a supported vesa video mode for the tft.

Sunday 10 June 2007

Installing Qemu on Windows Vista

Qemu introduction from Wikipedia

QEMU emulates a full computer system, including a processor and various peripherals. It can be used to provide virtual hosting of several virtual computers on a single computer.

Accelerator
Qemu author, Fabrice Bellard, also wrote a Linux kernel module (with preliminary ports to FreeBSD and Windows) named KQEMU or QEMU Accelerator, which notably speeds up i386 emulation on i386 platforms. This is accomplished by running user mode code directly on the host computer's CPU, and using processor and peripheral emulation only for kernel mode and real mode code. KQEMU also supports a kernel emulation mode in which portions of kernel mode code run on the host's CPU


Qemu official page:
http://fabrice.bellard.free.fr/qemu/

Qemu ported to Windows:
http://www.h7.dion.ne.jp/~qemu-win/

First we download a zip package:
qemu-0.9.0-windows.zip

Next unzip archives to a folder.

There are some clues at file README-en.txt, and a html manual at qemu-doc.html.


Qemu is now ready to be run:
so exec qemu-win.bat and a small linux test image "linux.img" is emulated.

NOTE: When a mouse cursor is missing, type Ctrl and Alt key together. Please use Alt
and Tab on WindowsMe.


NOTE: To exit from Linux, press Ctrl-Alt-2 keys together then you will see (qemu) prompt.

Then type quit: (qemu) quit


Running Qemu:

I have downloaded a Ubuntu iso cdrom image: ubuntu-7.04-desktop-i386.iso


First I exec C:\Windows\System32\cmd.exe to open a comand line window, and then:
>cd <qemu-directory-path>
>qemu -L . -m 512 -cdrom ubuntu-7.04-desktop-i386.iso

Argument options have the following meanings:
OptionValueExplanation
-Lbios pathin our example actual directory "."
-mavailable memoryDefault is 128 meg, I set it to 512
-cdromiso cdrom image pathIso image to emulate a cdrom


Qemu gives this warning:
Could not open '\\.\kqemu' - QEMU acceleration layer not activated

To avoid this message, install qemu accelerator, which will improve qemu speed:
(NOTE: uninstall any previous version accelerator you have before installing this one)
Qemu accelerator Kqemu-1.3.0pre11


NETWORK SET UP FOR QEMU ON WINDOWS VISTA

Right now we don't have network available. We check at this doc for some clues: HowToNetwork-en.html


I have decided to use a TAP (virtual ethernet network interface) to have full internet access: TapWin32-en.html

First we need a VPN driver for windows: OpenVPN driver download page.
Download and install this program: openvpn-2.0.9-install.exe

Once installed go to Programs menu and then
-> OpenVPN -> Add a new TAP-Win32 virtual ethernet adapter

If all has gone fine, a tap device will appear at:

Control panel -> Network and Sharing Center -> Manage networks

Remember the TAP interface name because it will be passed as an argument to qemu, i.e. in my computer is "Local area connection 2"


Now we have to establish a NETWORK SOFTWARE BRIDGE in windows vista.

Network bridge (Wikipedia)

A network bridge connects multiple network segments at the data link layer (layer 2) of the OSI model.
In our case the bridge will interconnect a real network interface with our TAP interface at data link layer, so both interfaces will share same IP address.

Howto set up a network bridge at windows xp and vista: Win XP network bridge set up.

Select both interfaces pressing ctrl key, and right click the mouse.
Select "Bridge connections" at the pop up menu and wait till network bridge will be completed.

After bridge completion gonna set up its network configuration:
right click at bridge icon -> properties -> Internet protocol version 4

If you have a dhcp server you can set bridge interface to automatically get its IP address.

I use a static network configuration at my LAN.

(change values to suit your network.)
IP 192.168.0.5
netmask 255.255.255.0
gateway 192.168.0.129

DNS1 194.179.1.100
DNS2 194.179.1.101


To check the network at console window we can make some pings:
ping 192.168.0.5
ping 192.168.0.129 (checking gateway)



Time of truth arrives, we launch qemu:
qemu -L . -m 512 -cdrom ubuntu-7.04-desktop-i386.iso -net nic -net tap,ifname="Local area connection 2"


at ubuntu guest system I configure the network with a free IP address on my LAN:
IP 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.129
DNS 194.179...


pings work:
ping 192.168.0.10
ping 192.168.0.5
ping 192.168.0.129 (checking the gateway)


If you have Internet access through your LAN, you can now open a browser and surf on the Internet from inside your qemu guest system. :-)


More info about bridging:
hnw_bridge_install
hnw_understanding_bridge


OTHER INTERESTING LINKS

Qemu HowTo Floppy Cdrom

Friday 8 June 2007

Debian GNU/Linux Distribution

Debian GNU/Linux is an complete Operating System based on the Linux kernel(there are also other platforms available).

It is developed in an open way by volunteers all over the world.

Debian (from Wikipedia)


DEBIAN DISTRIBUTION PHILOSOPHY AND GOALS

These documents describe Debian philosophy.

Debian Manifiesto
Debian Social Contract - Describes Debian Goals.
Debian Free Software Guidelines - Requirements software has to accomplish to be accepted as Debian Free Software.



Debian currently provides over 26000 software packages, and targets eleven hardware architectures.

Ubuntu distro and others like Damn Small Linux, Knoppix, Xandros, etc are Debian based distributions.


DEVELOPMENT PROCEDURE

Debian has three main branches: unstable (sid), testing and stable.

The stable one is suited for server environments. Packages at this version are frozen, and there are only security updates. (Debian Security Faq)

Usually newer software package versions are added to the unstable branch. If no serious bugs are found, after some time, the package migrate to testing branch (its dependencies also have to be in the testing branch).

Stable branch regularly receive security updates. Using Debian Sid (unstable) means that you have the latest package versions at the cost of stability and security.


Debian repositories are separated into several categories:

  • main
  • contains the main Debian repository.

  • contrib
  • contains software deployed under a free license but with non-free dependencies.

  • non-free
  • software that does not adhere to Debian free software guidelines.




DEBIAN PACKAGE MANAGEMENT SYSTEM

APT (Advanced Packaging Tool) is the Debian Package Management System. It is a user interface to some libraries that deal with software installation.

It comprises a set of tools. e.g: apt-get, apt-cache, apt-cdrom, ...

APT tracks dependency problems, performing installation and removing of packages in the most suitable order. When you install a package APT automatically installs all required dependencies. APT allows installing packages via network.

Apt, Aptitude, Dpkg Reference Article.



DEBIAN PACKAGE DEVELOPMENT

Documentation about creating and maintaining Debian packages.

Developer manuals

Debian New Mantainers' Guide


OTHER DEBIAN RELATED LINKS

Debian Wiki

Debian Reference (debian.org)

Debian FAQ

Getting support for Debian GNU/Linux.

Debian package list

Debian Forums

Debian Administration


IRC

#debian irc channel at irc.gnu.org server.

Sunday 20 May 2007

Comparison of Linux distributions

Wikipedia: Comparison of Linux distributions.


Each Distro has a package managing system, and uses a package format, i.e:

deb for Debian,
rpm for Fedora(Red Hat),
tgz for Slackware,


Package management tools:

Debian: apt, aptitude

Fedora: rpm, yum

OpenSuse: rpm, zipper

Mandrake: rpm, urpm

Gentoo: emerge


Some distros act as base for other derived distros:

Debian (base) -> Ubuntu

Fedora (base) -> Centos


Some distros are backed by an enterprise:

Ubuntu by Canonical Ltd.

Fedora by Red Hat


Most distros distribute binary packages, but Gentoo distribute source code files which you compile in your system.


Linux from Scratch is a guide to build your own GNU/Linux based system.

Saturday 19 May 2007

LiveDistro List

Easiest way to begin with Linux based systems is using a Live CD or Live USB distribution.

LiveDistro is a generic term for an operating system distribution that is executed upon boot, without previous installation on a hard drive. In fact, a hard drive is not needed at all.

What in other distros would be stored in hard disk, is stored in RAM memory. That cuts down on the RAM available to applications, reducing performance somewhat. (Is recommended a minimum of 256 MB RAM)

For a list of LiveDistros you can search at:


I have tested Ubuntu and Knoppix.


Other insteresting links:

Linux Live Scripts How to build your own LiveDistro.
HOWTO build a LiveCD from scratch (gentoo-wiki).