Archive

Archive for the ‘dica’ Category

Rodando Debian dentro do Debian (PT_BR)

= Introdução =

Mais um tutorial ensinando como criar uma máquina virtual Debian dentro do Debian.

Não testei o tutorial para Ubuntu, mas o principio é o mesmo.

Entendendo a idéia geral, você poderá testar qualquer distribuição em uma máquina virtual antes de colocar na sua máquina real. ;)

= Configurando rede =

Vamos chamar a máquina virtual de “guest” e a máquina real de “host”. Uma coisa legal de fazer é conectar o guest ao host e fazer com que o guest possa navegar na internet.

Do lado host será criada uma interface tap0, que só irá aparecer quando a máquina virtual estiver funcionando. No guest a interface de ree será eth0. A máquina virtual(guest) vai passar navegar usando a interface da máquina real(host) que está conectada a web.

WEB <============> (eth0) HOST (tap0) <=============> GUEST (eth0)

Para que isto seja possívél, será necessário fazer algumas configurações na sua máquina.

== qemu-ifup ==

Neste arquivo definimos qual vai ser o ip do host na interface tap0.

Configure o arquivo /etc/qemu-ifup , como abaixo:

#!/bin/sh
sudo -p “Password for $0:” /sbin/ifconfig $1 192.168.0.1

== network_forward.sh ==

Adicione o script network_forward.sh aos seus executáveis. Este script server para compartilhar rede com a guest.

Criar o arquivo /usr/local/bin/network_forward.sh com os comandos abaixo:

modprobe iptable_nat
modprobe ip_tables
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

= Criando seu novo sistema =

Baixe a ISO do Debian 4.0:

wget http://ftp.br.debian.org/debian-cd/current/i386/iso-cd/debian-40r1-i386-CD-1.iso

Instale qemu:

apt-get install qemu

Carregar o modulo de aceleração kqemu:

modprobe kqemu

Se o kqemu não estiver instalado, deve ter pra apt-get ou então usa o module-assistant (m-a). ;)

Crie um disco do tamanho de 2Gb:

qemu-img create debian_etch.img 2G

Agora é só dar o boot e instalar como se estivesse instalando seu computador:

sudo network_forward.sh
sudo qemu -net tap -net nic -boot d -cdrom debian-40r1-i386-CD-1.iso -hda debian_etch.img

Algumas explicações:
network_forward.sh -> vai compartilhar rede com a máquina virtual(guest)
-net tap -net nic -> server para ativar a rede no emulador
-boot d -> informa ao emulador que o boot deve ser dado pelo cdrom(debian-40r1-i386-CD-1.iso)
-cdrom debian-40r1-i386-CD-1.iso -> informa que o cdrom contem o disco de instalação do debian(debian-40r1-i386-CD-1.iso)
-hda debian_etch.img -> informa que o disco a ser usado será o arquivo debian_etch.img

Lembre de configurar a interface de rede de modo manual, sendo o IP= 192.168.0.2 netmask= 255.255.255.0 gateway= 192.168.0.1 .

Ao terminar da instalação, a máquina virtual vai reiniciar e então você terá que alterar o parametro de boot para -boot c. Deste modo o guest irá dar o boot pelo disco.

sudo qemu -net tap -net nic -boot c -cdrom debian-40r1-i386-CD-1.iso -hda debian_etch.img

Algumas explicações:
-boot c -> informa ao emulador que o boot deve ser dado pelo disco(debian_etch.img)

Caso você queria montar o disco da maquina virtual, lembre de desligar a máquina virtual. Para montar o disco do guest devemos levar em consideração o offset causado pelo grub:

mkdir mnt
sudo mount -o loop,offset=32256 debian_cd.img mnt

Boa sorte!!

Categories: debian, dica Tags:

download mp3 using franceradio

A few weeks ago I found a site that helps you to download mp3 file using their music search engine. It’s very easy. Just write the music or artist name.

http://www.franceradio.net/search.php?music=nelly

Categories: dica Tags:

OLPC primeiros passos (PT BR)



Após o Dia D aqui em Manaus recebi um email comentando sobre o problema de documentos/tutoriais sobre o OLPC em português.

Acredito que o primeiro passo para quem está afim de entrar no projeto e colaborar é aprendar a emular o XO dentro de seu desktop. Abaixo seguem os passos.

Em um terminal, baixar imagem do XO:

wget http://olpc.download.redhat.com/olpc/streams/development/LATEST/devel_ext3/olpc-redhat-stream-development-devel_ext3.img.bz2

Descompacte a image:

bzcat olpc-redhat-stream-development-ext3.img.bz2 > laptop.img

Para montar a image utilize a sequencia abaixo:

mkdir tmp_img
sudo mount -o loop,offset=31744 laptop.img tmp_img
ls tmp_img

Desmontando a imagem do XO:

sudo umount tmp_img

Instalando Qemu:

sudo apt-get install qemu

Iniciando o XO via Qemu:

qemu -soundhw es1370 -serial `tty` -hda laptop.img

Agora é só diversão.

references:
http://wiki.laptop.org/go/Emulating_the_XO/Quick_Start/Linux

http://wiki.laptop.org/go/Emulating_the_XO/Quick_Start

Categories: dica, olpc Tags:

OLPC A test boot up notes (release 406)



Hi all,

Today I was starting some testes with OLPC using the steps described below.

Install OLPC in USB Disk

” Linux

If you can devote an entire USB flash drive or hard disk for trying images out, using the images is easy.

To try out an image, simply download the appropriate .img.bz2 file, e.g.,

olpc-stream-development-42-20060714_1709-rpm-ext3.img.bz2

unzip it, and transfer it to a USB storage device via dd, e.g.,

# bunzip2 olpc-stream-development-42-20060714_1709-rpm-ext3.img.bz2
# dd if=olpc-stream-development-42-20060714_1709-rpm-ext3.img of=/dev/sdb bs=1M
# sync

Remember to:

* Make sure any old partitions from the storage device are unmounted.
* Do this as the super user / root
* Replace /dev/sdb with the device file of the USB storage device. The images do contain a partition table and boot loader, so make sure to write to the device and not a partition on the device (e.g. not /dev/sdb1)
* The USB storage device must be 1024 MB or larger. All existing data will be lost.

Now you should be able to boot the OLPC operating system off the USB storage device. “

reference: http://wiki.laptop.org/go/OS_images_for_USB_disks

During the boot you will find the problem with the VGA video. Solution below.

“Problem:External monitor reported “Video mode not supported”.

Solution: Using serial port console, change “1200×900″ to “1024×768″ in /etc/X11/xorg.conf and comment out “cp -f /dev/X11/geode-xorg.conf /etc/X11/xorg.conf” in /etc/init.d/olpc-configure for X-window to start properly on an external 1024×768 monitor/ATest board. “

Reference: http://dev.laptop.org/ticket/1753

Regards,
Alecrim.

Categories: dica, olpc Tags:

download mp3 using google

Categories: dica Tags:

HOWTO: Debian Qemu (running Debian inside Debian)

==Building Debian Images for QEMU==

Install qemu and debootstrap:

apt-get install qemu debootstrap

Create image (replace “image.raw” with image filename and with image size. Eg. 1G):

qemu-img create image.raw size

Associate image file with a loopback device:

losetup.orig -f # take note of the filename returned
losetup.orig loop_device image.raw # replace with name returned above

Create a ext2 filesystem on the image:

mke2fs loop_device

Mount the image:

mkdir -p /mnt
mount loop_device /mnt

Run debootstrap to install the Debian system :

debootstrap etch /mnt ftp://ftp.de.debian.org/debian/

Create a basic /mnt/etc/fstab on the image so the init scripts do not complain:

proc /proc proc defaults 0 0
/dev/hda / ext2 defaults,errors=remount-ro 0 1

== Compile kernel ==

Download and uncompress kernel source :

cd ~
wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.22.tar.bz2
tar -xvjf linux-2.6.22.tar.bz2

Compile kernel :

cd linux-2.6.22 # inside kernel tree
make defconfig # make default configuration
make menuconfig # add what you want to use
make # compile kernel
make modules # compile modules
make modules_install INSTALL_MOD_PATH=/mnt # install modules in filesystem

== Booting ==

Umount filesystem:

umount /mnt

Detach loopback device:

losetup -d loop_device

Done! You can run QEMU using the following command:

qemu -hda image.raw -kernel ~/linux-2.6.22/arch/i386/boot/bzImage -append “root=/dev/hda”

Wrote by:

Anderson Lizardo
Francisco Alecrim (INDT)

== Connecting host<->guest ==

Recompile the kernel with the network drivers available. I don’t remember the correct option, so active all in :

-> Device Drivers
-> Network device support (NETDEVICES [=y])
-> Ethernet (10 or 100Mbit) (NET_ETHERNET [=y])

Define ip used by host(real machine) in (/etc/qemu-ifup) :

#!/bin/sh
sudo -p “Password for $0:” /sbin/ifconfig $1 192.168.0.1

Boot up your virtual system again adding(-net tap -net nic)

sudo qemu -net tap -net nic -hda image.raw -kernel ~kernel/tree/linux-linus-2.6/arch/i386/boot/bzImage -append “root=/dev/hda”

Define the ip and route used by guest(virtual machine):

ifconfig eth0 182.168.0.2 netmask 255.255.255.0
route add default gw 192.168.0.1

Test it:

ping 192.168.0.1

Define DNS servers:

scp 192.168.0.1:/etc/resolv.conf /etc/resolv.conf

That’s it!!

Categories: debian, dica Tags:

Ubuntu / Debian : dell d600 desktop effects ( 1400 x 1050 )

Hi all,
I configured my Debian laptop(Dell Latitude D600) and helped a friend (Henry Vieira) with some tricks to configure desktop effects in his Ubuntu laptop(Dell Latitude D600). It’s a total of 2 tricks. You can find many howtos in the web, these are some tricks that took me a good time to understand and find.

First – Direct Rendering
———————————-

lspci | grep ATI

01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R250 [Mobility FireGL 9000] (rev 02)

Some drivers are not supported by ATI anymore, this video card is a case. So, you can use the open driver. It’s very simple.

sudo rmmod fglrx
sudo modprobe radeon

Replace fglrx for radeon in /etc/modules for next boot.

Change the driver in your Xorg configuration(/etc/X11/xorg.conf).

Replace :

Driver “fglrx”
for
Driver “radeon”

Restart your X server (ctrl+alt+backspace) and check if DRI is working.

glxinfo | grep direct
libGL warning: 3D driver claims to not support visual 0x4b
direct rendering: Yes

Second – problem with resolution
———————————-

Problem:


**************************************************************
* Beryl system compatibility check *
**************************************************************

Detected xserver : AIGLX

Checking Display :0.0 …

Checking for XComposite extension : passed (v0.3)
Checking for XDamage extension : passed
Checking for RandR extension : passed
Checking for XSync extension : passed

Checking Screen 0 …

Checking for GLX_SGIX_fbconfig : passed
Checking for GLX_EXT_texture_from_pixmap : passed
Checking for non power of two texture support : passed
Checking maximum texture size : failed

Root window size (1400/1050) is bigger then maximum texture size (1024×1024)

Solution :

Replace default depth in your xorg.conf :

cat /etc/X11/xorg.conf | grep DefaultDepth

#DefaultDepth 24
DefaultDepth 16

Restart your X server and it’s going to work fine.

Some additional configurations are necessary to start up compiz-fusion. I don’t remeber all, but my xorg.conf is below.

My xorg.conf:

cat /etc/X11/xorg.conf


# xorg.conf (xorg X Window System server configuration file)
#
# This file was generated by dexconf, the Debian X Configuration tool, using
# values from the debconf database.
#
# Edit this file with caution, and see the xorg.conf manual page.
# (Type “man xorg.conf” at the shell prompt.)
#
# This file is automatically updated on xserver-xorg package upgrades *only*
# if it has not been modified since the last upgrade of the xserver-xorg
# package.
#
# If you have edited this file but would like it to be automatically updated
# again, run the following command:
# sudo dpkg-reconfigure -phigh xserver-xorg

Section “ServerLayout”
Option “AIGLX” “on”
Identifier “Default Layout”

# Default screen (best)
Screen “Default Screen”

# Dual head
#Screen 0 “Screen0″ 0 0
#Screen 1 “Screen1″ LeftOf “Screen0″
#Option “Xinerama” “true”

InputDevice “Generic Keyboard”
InputDevice “Configured Mouse”
InputDevice “Synaptics Touchpad”
EndSection

### GENERIC
Section “Files”
EndSection

Section “InputDevice”
Identifier “Generic Keyboard”
Driver “kbd”
Option “CoreKeyboard”
Option “XkbRules” “xorg”
Option “XkbModel” “pc104″
Option “XkbLayout” “us”
EndSection

Section “InputDevice”
Identifier “Configured Mouse”
Driver “mouse”
Option “CorePointer”
Option “Device” “/dev/input/mice”
Option “Protocol” “ImPS/2″
Option “Emulate3Buttons” “true”
EndSection

Section “InputDevice”
Identifier “Synaptics Touchpad”
Driver “synaptics”
Option “SendCoreEvents” “true”
Option “Device” “/dev/psaux”
Option “Protocol” “auto-dev”
Option “HorizScrollDelta” “0″
EndSection

### RADEON DRIVER
Section “Device”
Identifier “ATI Technologies Inc Radeon R250 [Mobility FireGL 9000]“
Driver “radeon”
BusID “PCI:1:0:0″
Option “RenderAccel” “True”
Option “AddARGBGLXVisuals” “True”
Option “DisableGLXRootClipping” “True”
Option “XAANoOffscreenPixmaps”
### DUAL HEAD MERGEFB
#Option “MonitorLayout” “LVDS , TMDS”
#Option “CRT2Position” “RightOf”
#Option “MetaModes” “1400×1050-1280×1024″
#Option “MergedXinerama” “on”
#Option “MergedNonRectangular” “true”
#Option “MergedFB” “true”
#Option “MergedFB” “true”
#Option “MetaModes” “1400×1050-1280×1024″
#Option “MergedDPI” “100 100″
#Option “CRT2Position” “LeftOf”
#Option “DesktopSetup” “horizontal” #Enable Big Desktop
#Option “Mode2″ “1280×1024″ #Resolution for second monitor
#Option “DesktopSetup” “LVDS,AUTO” #the types of monitors that is connected LVDS = LCD, CRT, AUTO
#Option “EnablePrivateBackZ” “yes” #Enable 3d support
#Option “HSync2″ “65″ #This sets the horizontal sync for the secondary display.
#Option “VRefresh2″ “60″ #This sets the refresh rate of the secondary display.
EndSection

Section “Monitor”
Identifier “Generic Monitor”
Option “DPMS”
HorizSync 28-70
VertRefresh 43-60
EndSection

Section “Screen”
Identifier “Default Screen”
Device “ATI Technologies Inc Radeon R250 [Mobility FireGL 9000]“
Monitor “Generic Monitor”
#DefaultDepth 24
DefaultDepth 16
SubSection “Display”
Modes “1400×1050″
EndSubSection
EndSection

Section “Extensions”
Option “Composite” “Enable”
EndSection

Section “ServerFlags”
Option “AIGLX” “on”
EndSection

Section “DRI”
Mode 0666
EndSection

### ATI DRIVER
#Section “Device”
# Identifier “ATI Technologies Inc Radeon R250 [Mobility FireGL 9000]“
# Driver “ati”
# Option “AGPMode” “8″
# Option “AccelMethod” “EXA” #only “XAA” is supported for some of the cards with “experimental” 3d acceleration
# Option “ColorTiling” “on”
## Option “EnablePageFlip” “true” #only works with accelmethod “XAA”
# Option “AccelDFS” “true” #seemed to speed things up using EXA acceleration
# Option “TripleBuffer” “true” #This *might* help if you use something like Beryl and have slow video playback.
# Option “DynamicClocks” “on” #This is for laptop users, it saves energy when in battery mode.
# BusID “PCI:1:0:0″
#EndSection

### DUAL HEAD XINERAMA
Section “Monitor”
Identifier “Monitor0″
Option “DPMS” “true”
HorizSync 28-70
VertRefresh 43-60
EndSection

Section “Monitor”
Identifier “Monitor1″
Option “DPMS” “true”
HorizSync 28-70
VertRefresh 43-60
EndSection

Section “Device”
Identifier “ati0″
#Driver “ati”
#Option “MonitorLayout” “LVDS, CRT”
Screen 0
BusID “PCI:1:0:0″
Driver “radeon”
BusID “PCI:1:0:0″
Option “RenderAccel” “True”
Option “AddARGBGLXVisuals” “True”
Option “DisableGLXRootClipping” “True”
Option “XAANoOffscreenPixmaps”
EndSection

Section “Device”
Identifier “ati1″
#Driver “ati”
Option “MonitorLayout” “LVDS, CRT”
Screen 1
BusID “PCI:1:0:0″
Driver “radeon”
BusID “PCI:1:0:0″
Option “RenderAccel” “True”
Option “AddARGBGLXVisuals” “True”
Option “DisableGLXRootClipping” “True”
Option “XAANoOffscreenPixmaps”
EndSection

Section “Screen”
Identifier “Screen0″
Device “ati0″
Monitor “Monitor0″
DefaultDepth 24
SubSection “Display”
Depth 24
Modes “1400×1050″ “1280×1024″ “1024×768″ “800×600″ “640×480″
EndSubSection
EndSection

Section “Screen”
Identifier “Screen1″
Device “ati1″
Monitor “Monitor1″
DefaultDepth 24
SubSection “Display”
Depth 24
#Modes “1400×1050″ “1280×1024″ “1024×768″ “800×600″ “640×480″
Modes “1280×1024″ “1024×768″ “800×600″ “640×480″
EndSubSection
EndSection

:)

I recommend you to test compiz-fusion instead of beryl.

Important links:
https://help.ubuntu.com/community/RadeonDriver
http://www.howtoforge.com/ubuntu_feisty_beryl_ati_radeon

Thanks Henry!!!

Categories: debian, dica Tags:

HOWTO: minimo debian olpc

Hi all,
A few months ago I posted about some tests with Minimo and OLPC. Now,a tutorial about Minimo on Debian OLPC is available.

Feel free!!!!

Categories: debian, dica, olpc Tags:

debian: nautilus browser mode


Hi all,
I simple proble that came with debian is nautilus configuration. The default configuration does not come with browser mode visualization. You can easily define it executing the steps below.

Open configuration editor:
Applications –> System Tools –> Configuration Editor

Defining default configuration:

apps –> nautilus –> preferences –> always_use_browser

Categories: debian, dica Tags:

debian: desktop configuraton

Hi all,
Yesterday I found a great configuration to my desktop.

GTK2 Theme: MacOS-X Aqua

Icons: Nuvola

Wallpaper: Aqua Tux

I removed the default icons as you can see on my last post.

Great success !!!

Categories: debian, dica Tags: