Blog do Peter


  • Bad Buzz
    I used to love the Gmail service. It used to be clean, fast and it was always there, just working. Some weeks ago I noticed that it started to be drastically slow for some simple tasks.

    My internet link is perfect, my dns server is also perfect. So I was thinking that there was something wrong with Gmail.

    My guess is that the new feature with dubious utility, Buzz, is the reason of the slowness.

    Google, could you please give me back my fast, clean and reliable Gmail?


  • Getting source files from Debian Backports
    # For Debian Etch

    echo "deb-src http://www.backports.org/debian etch-backports main contrib non-free" >> /etc/apt/sources.list

    aptitude update

    apt-get source


  • O que é o Google Wave?


    Está sentindo?

    Sabe aqueles dias em que o mundo muda? Sabe aqueles eventos importantes que mudam a vida de todos?

    Se eu estivesse vivendo 100 anos atrás, eu estaria me sentindo super empolagado depois de ver um novo meio de comunicação funcionando. Ontem antes de dormir eu ví um rádio. Transmitir voz por ondas eletromagnéticas seria muito revolucionário 100 anos atrás mas hoje o rádio faz parte da vida de todos no planeta de forma direta ou não.

    Você está vivendo no passado.

    Meu pai diz que a história é igual um gato. A maior parte do tempo o gato fica dormindo e nada relevante acontece. Mas as vezes o gato acorda, muda de posição e volta a dormir. O gato da história abriu os olhos preguiçosamente e está pensando em se levantar a qualquer momento.

    Está sentindo?

    Você como um ser digital, tem que se esforçar para manter sua vida online organizada. Em um site você mantém seus albuns de foto, em outro seus vídeos, em outro seu E-mail, em outro seus relacionamentos, em outro seu blog, em outro sua página pessoal, tem serviços de mensagens instantâneas e a lista continua crescendo. Alguns destes sites oferecem possibilidades moderadas de colaboração. Seu blog provavelmente permite que os usuários comentem seus posts. Seu site de fotos provavelmente permite que outros comentem suas fotos. Talvez as pessoas que deixam comentários no seu blog sejam as mesmas que deixam comentários nas suas fotos.

    Aproveitando este cenário, responda a minha pergunta: Como você responde a um posto anônimo feito no seu blog de forma que apenas a pessoa que deixou o comentário receba a resposta? Isso, vou repetir: Como você responde a um posto anônimo no seu blog de forma que apenas a pessoa que deixou o comentário receba a resposta?

    Está sentindo?

    O que importa é que toda a sua vida online é desconexa e a colaboração entre pessoas e pedaços da sua vida digital é muito complicada e nem sempre possível.

    O E-mail é uma das formas mais populares de comunicação. Porém ele foi inventado há mais de 40 anos. O mundo 40 anos atrás era muito diferente. 40 anos o mundo era tão lento que as pessoas não precisavam do Google. Como seria o E-mail se ele fosse inventado hoje? Isso é o que o Google Wave quer oferecer. É um novo paradigma.

    A primeira grande diferença do Google wave é que ele é totalmente orientado para ser ao vivo. Tudo acontece a medida que você digita. Letrinha por letrinha. A noção de "digitar" e "enviar" foi substituída por um fluxo de dados, algo como conversar em que você escuta as frases sendo formadas a medida que as pessoas falam. Você pode conversar com um amigo que fala Chinês e o chat é traduzido a medida que você digita, letrinha por letrinha nas duas direções. É uma interface bem natural.

    A segunda é que ele oferece uma plataforma para colaboração limitada apenas pela sua imaginação. Através de robôs e extensões feitos usando as APIs do Google Wave você pode interagir com todos os usuários de todas os sites que você mantém e também pode publicar conteúdo ao vivo a medida que ele ganha vida por meio da interação entre você, amigos e leitores do seu blog.

    A terceira é que assim como o E-mail, o Google Wave é um padrão aberto. Então você vai poder ter o seu servidor de Wave em casa e no serviço que trocarão Waves entre si, com o servidor do Google e com todos os outros espalhados pelo mundo.

    Acordei em um mundo diferente do que o mundo que eu fui dormir ontem.



  • Como entrar em contato com o Mercadolivre
    O Mercadolivre é um bom local para se vender de tudo. Porém o serviço de atendimento é desrespeitoso. É impossível falar com eles e isso é assim de propósito.

    Achei um formulário de contato no site. O endereço é:
    http://www.mercadolivre.com.br/jm/ml.faqs.portalFaqs.FaqsController?axn=frmContact&faqId=6031&categId=PDEN

    Vale a pena ligar para o 0800-8911897 só pra criar algum transtorno. É o telefone de uma empresa que presta serviço de cobrança para o MercadoLivre. Eles devem receber ligações de pessoas iradas porque nem o nome eles dizem. Veja o meu roteiro para pertubá-los. Sendo muito educado e polido, fale com a voz mais macia que você tiver:
    1 - Ligue o 0800-8911897
    2 - Pergunte o nome do atendente
    3 - Pergunte o nome da empresa
    4 - Pergunte como entrar em contato com o Mercadolivre. O atendente vai te dizer que tem um formulário no site.
    5 - Peça ajuda ao atendente. Diga que você já encontrou o formulário mas que não há forma de entrar em contato. O atendente vai te dar alguma ajuda.
    6 - Pergunte como a empresa do atendente entra em contato com o Mercadolivre.
    7 - Peça uma sugestão sobre o que você deve fazer para entrar em contato com o Mercadolivre.

    Se umas 500 pessoas seguirem este roteiro todos os dias, talvez alguma coisa mude.


  • Other way of creating initrd for Debian
    I'm working on installing Debian 4 on Z series mainframe and It was required to add preseed.cfg to initrd in order to allow unathenticated packages.

    The original method I knew to create initrd did not work, so I used the above script.

    To convert from downloaded initramfs to "working" initrd image I use the following script:
    ---------------------
    #!/bin/sh
    rm -f initrd initrd.gz
    dd if=/dev/zero of=initrd bs=10000000 count=1
    /sbin/mke2fs -F -m0 initrd
    mount -t ext2 -o loop initrd /mnt
    gzip -dc initrd.img |(cd /mnt ; cpio -i )
    umount /mnt
    gzip -9 initrd
    ---------------------

    Script source: https://bugzilla.redhat.com/show_bug.cgi?id=146237#c1


  • Eu gosto da GVT
    Tenho um link de dados muito bom. Contratei o plano de 10Mbps da GVT. São 10Mbps para download e 1Mbps para upload. Para alcançar a velocidade contratada, a GVT configura o modem ADSL com Downstream Rate de 12797 Kbps e Upstream Rate de 1159 Kbps.

    Faço downloads a 1,3 MB/s (10 Mbps = 1,25MB/s). Fazer o download da ISO do Ubunto 8.10 levou menos de 10 minutos.

    Eu monitoro a disponibilidade do serviço de ADSL. Em um ano e meio o link ADSL nunca caiu por problemas na GVT e houve problemas de rota apenas duas vezes. Isso é muito bom.

    Minha experiência com a GVT é muito boa. Quando contratei o serviço de ADSL, decidi configurar o modem duas horas da madrugada. Eu não sabia os parâmetros e liguei para o 10325. O técnico que me atendeu sabia o que estava dizendo e me tratou muito bem.

    Hoje tive outra experiência legal. Eu estava fora de casa e precisei acessar meu servidor caseiro. Meu modem ADSL tem um cliente embutido para o dyndns. Hoje o IP do modem havia sido alterado e o dyndns não captou a mudança. Eu liguei para o atendimento GVT e pedi encarecidamente que o técnico fizesse um "reset" da minha linha ADSL para que o dyndns fosse atualizado. Levei mais tempo "escolhendo a opção desejada" na central da GVT do que para ter o problema resolvido. No total levei menos de 5 minutos para resolver meu problema.

    Se ter um link rápido com a Internet, ter um link confiável e ter atendimento telefônico eficiente e respeitoso são características importantes para você, contrate o serviço de banda larga GVT.


  • Instalar servidor Sunray Server Software no Linux
    Eu gastei muitas semanas tentando instalar o servidor Sunray Server Software no Linux.

    Eu NÃO consegui fazer o servidor funcionar no Centos 5.3 x86_64. Talvez o problema esteja relacionado com o pacote do GDM mas não funcioanou.

    Funcionou bem com a versão i386 do Centos.

    Veja o guia passo a passo:

    1 - Instalar o Centos 5.3 i386
    1.1 - Se seu servidor possuir mais do que 3GB de RAM, rode como root: yum -y install kernel-PAE

    2 - Rode como root:
    yum -y update
    reboot

    3 - Download:
    srss_4.1_linux.zip de http://www.sun.com/software/sunray/getit.jsp
    jre-6u13-linux-i586-rpm.bin de http://www.java.com
    apache-tomcat-5.5.27.tar.gz de http://tomcat.apache.org/

    4 - rode como root:
    yum install glib dhcp openldap-clients openldap tftp-server libXp openmotif22 openssl compat-libstdc++-33 libusb-devel compat-openldap
    yum groupinstall "Development Tools"
    yum install kernel-devel

    5 - rode como root:
    cd /usr/lib
    ln -sf libldap-2.3.so.0.2.31 libldap.so.199
    ln -sf libgdbm.so.2.0.0 libgdbm.so.3
    ln -sf liblber-2.3.so.0.2.31 liblber.so.199

    6 - instale o jre que você fez o download. Rode como root:
    sh jre-6u13-linux-i586-rpm.bin

    7 - instale o tomcat que você fez o download. Rode como root:
    cd /opt
    tar xvzf apache-tomcat-5.5.27.tar.gz
    ln -sf apache-tomcat-5.5.27 apache-tomcat

    8 - Adicione o tomcat como um serviço. copie o código abaixo e cole em /etc/init.d/tomcat

    #!/bin/sh
    #
    # Tomcat Server
    #
    # chkconfig: 345 96 30
    # description: Java servlet container

    JAVA_HOME=/usr/java/latest/

    PATH=${JAVA_HOME}/bin:${PATH}

    TOMCAT_START=/opt/apache-tomcat/bin/startup.sh

    TOMCAT_STOP=/opt/apache-tomcat/bin/shutdown.sh

    export JAVA_HOME PATH

    start()
    {
    if [ -x ${TOMCAT_START} ]; then
    echo "Starting tomcat server..."
    ${TOMCAT_START} &
    else
    echo "Cannot start tomcat server"
    fi
    }

    stop()
    {
    if [ -x ${TOMCAT_STOP} ]; then
    echo "Stopping tomcat server..."
    ${TOMCAT_STOP} &
    else
    echo "Cannot stop tomcat server"
    fi
    }

    restart()
    {
    stop
    sleep 10
    start
    }

    status()
    {
    echo "No status available for tomcat server"
    }

    case "$1" in
    'start')
    start
    ;;
    'stop')
    stop
    ;;
    'restart')
    restart
    ;;
    'status')
    status
    ;;
    *)
    echo "Please supply an argument [start|stop|restart]"
    esac

    9 - Para completar a instalação do tomcat não esqueça de:
    chmod +x /etc/init.d/tomcat
    chkconfig tomcat on
    service tomcat start

    10 - Descompacte o Sunray Server Software que você fez o download:
    unzip srss_4.1_linux.zip
    cd srss_4.1
    ./utinstall
    reboot

    11 - O primeiro passo de configuração do Sunray Server Software:
    cd /opt/SUNWut/sbin
    ./utconfig
    reboot

    12 - O segundo passo de configuração do Sunray Server Software:
    Este é o único passo complicado. O utadm usa uma lógica que eu não entendi sobre o /etc/hosts. Só consegui fazer ele funcionar editando o /etc/hosts antes de rodar o utadm.

    A dica é adicionar uma entrada no /etc/hosts com o ip real da sua placa de rede e comentar a linha que começa com 127.0.0.1. Veja o exemplo abaixo:

    Antes de editar:
    vi /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost #Comment this line
    ::1 localhost6.localdomain6 localhost6

    Depois de editar:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    #127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6
    10.0.0.115 localhost localhost.localdomain

    Agora execute como root:

    cd /opt/SUNWut/sbin
    ./utadm -a eth0

    E desfaça as alterações que VOCÊ FEZ no /etc/hosts. Não remova a linha que o utadm adicionou. Veja como seu /etc/hosts deve ficar após você desfazer as alterações:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6
    #10.0.0.115 localhost localhost.localdomain
    192.168.128.1 localhost-eth0.localdomain # SUNRAY ADD - DO NOT MODIFY

    Agora execute como root:
    reboot

    Divirta-se!


  • Installing Sunray II server software on Centos 5.3
    I spent many weeks trying to install Sunray server software on Linux.

    I was NOT able to make it work with Centos 5.3 x86_64. Maybe this is related somehow to GDM package but it did not work.

    It worked when using i386 version of Centos.

    See the step by step guide.

    1 - Install Centos 5.3 i386
    1.1 - If you have more than 3GB of installed RAM, run as root: yum -y install kernel-PAE

    2 - Run as root:
    yum -y update
    reboot

    3 - Download:
    srss_4.1_linux.zip from http://www.sun.com/software/sunray/getit.jsp
    jre-6u13-linux-i586-rpm.bin from http://www.java.com
    apache-tomcat-5.5.27.tar.gz from http://tomcat.apache.org/

    4 - run as root:
    yum install glib dhcp openldap-clients openldap tftp-server libXp openmotif22 openssl compat-libstdc++-33 libusb-devel compat-openldap
    yum groupinstall "Development Tools"
    yum install kernel-devel

    5 - run as root:
    cd /usr/lib
    ln -sf libldap-2.3.so.0.2.31 libldap.so.199
    ln -sf libgdbm.so.2.0.0 libgdbm.so.3
    ln -sf liblber-2.3.so.0.2.31 liblber.so.199

    6 - install jre that you have downloaded. Run as root:
    sh jre-6u13-linux-i586-rpm.bin

    7 - install tomcat that you have downloaded. Run as root:
    cd /opt
    tar xvzf apache-tomcat-5.5.27.tar.gz
    ln -sf apache-tomcat-5.5.27 apache-tomcat

    8 - Add tomcat as a service. copy and past above code to /etc/init.d/tomcat

    #!/bin/sh
    #
    # Tomcat Server
    #
    # chkconfig: 345 96 30
    # description: Java servlet container

    JAVA_HOME=/usr/java/latest/

    PATH=${JAVA_HOME}/bin:${PATH}

    TOMCAT_START=/opt/apache-tomcat/bin/startup.sh

    TOMCAT_STOP=/opt/apache-tomcat/bin/shutdown.sh

    export JAVA_HOME PATH

    start()
    {
    if [ -x ${TOMCAT_START} ]; then
    echo "Starting tomcat server..."
    ${TOMCAT_START} &
    else
    echo "Cannot start tomcat server"
    fi
    }

    stop()
    {
    if [ -x ${TOMCAT_STOP} ]; then
    echo "Stopping tomcat server..."
    ${TOMCAT_STOP} &
    else
    echo "Cannot stop tomcat server"
    fi
    }

    restart()
    {
    stop
    sleep 10
    start
    }

    status()
    {
    echo "No status available for tomcat server"
    }

    case "$1" in
    'start')
    start
    ;;
    'stop')
    stop
    ;;
    'restart')
    restart
    ;;
    'status')
    status
    ;;
    *)
    echo "Please supply an argument [start|stop|restart]"
    esac

    9 - To complete tomcat installation, do not forget to:
    chmod +x /etc/init.d/tomcat
    chkconfig tomcat on
    service tomcat start

    10 - Unzip the Sunray Server Software that you have downloaded:
    unzip srss_4.1_linux.zip
    cd srss_4.1
    ./utinstall
    reboot

    11 - First Sunray Server Software configuration step:
    cd /opt/SUNWut/sbin
    ./utconfig
    reboot

    12 - Second Sunray Server Software configuration step:
    This is the only dificult step. The utadm uses a logic that I haven't understood about /etc/hosts. The only way to make it works on my scenario is to edit /etc/hosts before running utadm.

    The trick is to add an entry to /etc/hosts that contain the real ip address of your server and to comment the 127.0.0.1 entry. See the example above:

    Before editing:
    vi /etc/hosts
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost #Comment this line
    ::1 localhost6.localdomain6 localhost6

    After editing:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    #127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6
    10.0.0.115 localhost localhost.localdomain

    Now just run as root:

    cd /opt/SUNWut/sbin
    ./utadm -a eth0

    And undo the changes YOU MADE on /etc/hosts. Do not remove the line added by utadm. See how it should look like after you undo your changes:
    # Do not remove the following line, or various programs
    # that require network functionality will fail.
    127.0.0.1 localhost.localdomain localhost
    ::1 localhost6.localdomain6 localhost6
    #10.0.0.115 localhost localhost.localdomain
    192.168.128.1 localhost-eth0.localdomain # SUNRAY ADD - DO NOT MODIFY

    Now run as root: reboot

    And enjoy it.


  • Download Centos DVD iso
    Looking for a place to download Centos DVD iso without bittorrent?

    Check: http://mirror.switch.ch/ftp/mirror/centos/

    Click on the desired version, then on isos, and choose the arch.

    For example version 5.3 dvd isos are at:
    http://mirror.switch.ch/ftp/mirror/centos/5.3/isos/i386/CentOS-5.3-i386-bin-DVD.iso
    http://mirror.switch.ch/ftp/mirror/centos/5.3/isos/x86_64/CentOS-5.3-x86_64-bin-DVD.iso


  • HD Upgrade with Ubuntu
    I was at São Paulo when my notebook locked with bad block messages on screen...

    I tried to stay calm, and it worked.

    Next boot, all my data were there. But I would not wait for the next hang to see if I would loose data next time.

    I went to "Boulevard Shopping" at Avenida Paulista and spend R$ 200,00 in a new 320GB HD + USB case.

    I installed the new HD on the USB case and booted with Fedora rescue environment. Yes, this is correct. Anaconda is the best rescue environment. Download it from, it is less than 200MB: http://fedora.c3sl.ufpr.br/linux/releases/10/Fedora/i386/iso/Fedora-10-i386-netinst.iso

    With fdisk, I created one partition for SWAP and other for the data on the new disk.

    Then mkfs.ext3 on the data partition.

    Mount old data partition on /source.

    Mount new data partition on /target.

    Copy the data from old to new disc with cp -a /soruce/* /target.

    Am I crazy? No! :)

    Now there are still two tasks to be done.

    1 - Install grub on the HD:
    #This will enable you to use /dev directory when you chroot to /target
    mount -o bind /dev /target/dev

    chroot /target

    grub-install /dev/sda

    2 - Update UUID
    # UUID is a safer way to refer to a disk. There is no persistent association between a physical disk and /dev/sda. But all partitions has its own UUID. See more about UUID at: http://en.wikipedia.org/wiki/Universally_Unique_Identifier

    # First you need to find out UUID of your root / partition and SWAP
    tune2fs -l /dev/sda2 |grep UUID #will print UUID of /dev/sda2 if it is ext2/3/4 partition
    mkswap /dev/sda1 #will format and print UUID of your swap partition

    #Now you have to edit two files

    vi /etc/fstab #Yes! I like vi! :)
    #Replace both / UUID and SWAP UUID for the new ones.

    vi vi /boot/grub/menu.lst

    Edit only two lines:
    # kopt=root=UUID=08459d45-314e-4288-af13-c6c8819cb604 ro

    and:

    # groot=08459d45-314e-4288-af13-c6c8819cb604

    Note that both lines are commented. KEEP IT COMMENTED. Just change the UUID for the UUID of your root / partition. Those lines are commented because it is used by update-grub not by grub itself.

    now run:
    update-grub

    exit # to leave chroot

    halt

    Then I swapped the HDs from the case to the notebook and from the notebook to the case. And all worked very well.

    I took a bit more than 2 hours to migrate 140GB of data between the HDs in an Hotel room. :)


  • 30 days with my N95
    I still like my cell phone very much but there are problems.

    1 - Battery life is good for the phone and bad for 3G. Yesterday the phone died after 3.5 hours of use as 3G modem. I left the phone charging over night and started using it as 3G modem 4 pm.

    2 - So BIG. By technology point of view, it is hard to believe that there are so many things inside that small box. There are many transmitters, receivers, processors, memories, keyboards, jacks, speakers... WOW! But it does not fit perfectly on my jeans pocket.

    3 - As it is big, it is very hard to remove it from my pocket without opening the slice.

    4 - Not always the OK/Continue button is on the same side. Some times the OK swap from left to right. This is not good. I want that ok always on same side and always cancel on same side.

    5 - Popup messages grab key presses. This is not comfortable. "Keypad unlocked" popup takes more time than needed and while it is on screen, I lost the first key pressed. Same for others popups.

    6 - This can be my mistake but looks impossible to forward one phone number stored in contacts over SMS. I had to write the phone number in a paper and enter it again to be able to send it over SMS.

    7 - I can't disable screen saver and keep the back light on when using Google Maps. I think I need to upgrade the firmware.

    8 - When on calendar, why that icon always showing a big and red 30, does not indicate today? When I was new to the phone that big red 30 confused me.

    9 - Someone called me. I can see on the log that John called me. How to see from witch phone number I John called me? I have to go to contacts, look for the caller phone to discover caller phone number. Boring!

    10 - This can be me again but: How can the 3G/Wifi switch be more automatic? Is there a way of setting priorities for different connections? It is good to be able to choose what connection will you use but where is the automatic way of doing that?

    11 - Not very stable. Sometimes the phone reset. It happened when using it as 3G modem and when trying to see photos. In 45 days it has reseted 4 times. Not too bad.

    BUT...

    Even with that issues, the N95 8GB is a good phone. The camera is great. Has good focus and the sensitivity for light is good. Also the videos made with the camera are very good. The sound quality of the speakers is amazing.

    I want smaller N95 with more battery. Is N85 what I'm looking for?


  • Stopping ssh atack
    I was tired of knowing that someone was trying to login my home server 24 hours / day.

    Using fedora:
    #yum install denyhosts
    #chkconfig denyhosts on

    Denyhosts checks for failed attemps of login and edit hosts.deny file. Simple and efficient.


  • Installing Moodle on Centos 5
    I assume that both apache(http) and mysql(database) are on the same server. This is not needed.

    1 - Go to moodle.org and download latest moodle*.tgz.
    cd /tmp
    wget http://download.moodle.org/stable19/moodle-weekly-19.tgz #Do not use this link. Get latest file from http://www.moodle.org/

    2 - As root:
    yum install php php-mysql httpd mysqlclient10 mysql-server php-gd php-mbstring php-xmlrpc

    3 - If your mysql installation is fresh, you will need to assign a root password to it.

    service mysqld start

    /usr/bin/mysqladmin -u root password 'newpassword'

    may assign newpassword as the new mysql root password. Replace newpassword to a safer password.

    4 - Start services and be sure that it will be started automatically.
    service httpd start
    service mysqld start
    chkconfig httpd on
    chkconfig mysqld on

    5 - Create a user moodle with a good password that has all privileges on the table moodle. I suggest that you download and install PhpMyAdmin to do it. Try the latest 2.xx.x.x version as it will work on Centos 5. To use PhpMyAdmin, you will need to create a file named config.inc.php inside PhpMyAdmin instalation folder (/var/www/html/phpmyadmin) with mysql information like root password defined on step 3.

    config.inc.php example:

    <?
    $i = 1;
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = 'newpassword';
    ?>

    After configure PhpMyAdmin, open your favorite browser, point to PhpMyAdmin installation path and:

    Privileges -> Add a new user -> Fill the form -> Click on "Create database with same name and grant all privileges" -> Go

    Be sure to protect the access to your PhpMyAdmin as it will probably grant root access to anyone that knows its URL. It is a good idea to remove the entire directory after all is working as it is very easy to install it back. Password protect the directory may be good idea too.

    6 - Extract files from moodle*.tgz at /var/www/html/moodle.
    mkdir /var/www/html/moodle
    cd /var/www/html/moodle
    tar xvzf /tmp/moodle-weekly-19.tgz

    7 - Start your favorite browser and point to your server /moodle directory. Follow installation instructions.


  • 24 hours with my N95
    Yesterday I went to buy a new cell phone. I had G1 and Iphone in mind. The store did not have the G1 and the Iphone was very expensive. But both Nokia E51 and N95 were available at low price.

    E51 was my goal due its reduced size but N95 looks more stylish, has 5.0 megapixel camera with Carl Zeiss lens, has GPS, has 8GB of storage and larger screen than E 51.

    I decided for N95.

    I moved from Motorola K1 to Nokia N95. I'm using the N95 for 24 hours now.

    Let me tell you what are my impressions:

    Good impressions (in order of discover):
    1 - Big and clear display. The display is great.
    2 - Great camera. The image quality is very good. Looks like that I can use the phone as camera when I go travel next time.
    3 - Text prediction from Nokia makes it possible to use numeric keyboard to enter data. For its size, the N95 keyboard is very good for SMS and doing fast google searches.
    4 - The top keyboard for multimedia. That's a great idea to be able to slice the display both to top and down. It was really surprising to me to find that buttons there.
    5 - WiFi. That's a great feature. The Wifi signal is very good and the configuration interface is very simple.
    6 - Integration with Internet. I'm surprised about how the internet worked very well. I was able to see any page I wanted. You tube videos plays very well. The navigation on web pages without mouse and without touch screen is very well made. The web browser is not proof of concept, it is a great and handy tool.
    7 - Fast processors. The video playback and web page scroll is very fast. There is more computing power available than needed to the basic features.
    8 - Connectivity. GPS, GSM, 3G, Bluetooth, IRDA, USB, AV output to plug the phone on the TV, P1 audio output for standard earphone. It connects to everything...
    9 - High quality and loud sound for ringing tones. N95 has great speakers for playing the ringing tones.
    10 - Voip! Thats the second greater feature of this phone. This is one of my dreams that are now true. This phone has integrated SIP client that enables me to connect to my SIP server. The interface is great and it really works. I've tested when connected to the wifi and with 3G. Wifi is better but 3G also works. Very, very good! I loved to be able to use VOIP out of the box.
    11 - 3G modem for my Linux box. This is the greatest feature of this phone to me. I've configured the N95 to ask me about the USB behavior when I connect the N95 to the PC. If I choose "PC Suite", then Linux will recognize the N95 as USB ACM device. This made everything easy! Just say to gnome PPP that the device is /dev/ttyACM0 and dial. Very, very, very good!
    12 - Auto rotation is cool. I liked it.
    13 - Time management looks very useful. I have some todos and meetings on Monday. Lets see how good is it. I need to find out how to synchronize with my Desktop.

    Bad impressions:
    1 - Big. My old K1 fits well on any pocket. The N95 needs more space than the K1.
    2 - Camera needs 2-4 seconds to take a picture after press the button. This is bad when doing shots of moving things but is not a real problem for regular shots.
    3 - I've pressed the take picture button accidentally two times when I was talking on the phone. Is there a way to disable that button during a call?
    4 - Sound quality for talking. I'm not sure if is it some kind of configuration but the sound quality is not crystal clear when calling others using GSM. I cant hear clearly and the other side also can't hear me perfectly.

    After 24 hours I can say that this is the greatest phone I ever had. Lets see how the big size will annoy me, I think that there will be no problem.


  • HD upgrade with software RAID on Fedora 9
    My home server had two 80GB hard drives using software raid level 1. This is very small amount of data for me.

    When I decided to upgrade the HDs to two 1TB hard drives, I was thinking that I would spend 2 hours to upgrade it.

    First I removed the old disks and installed the new ones. Then a fresh new Fedora 9 install. And after that I installed the 4 disks and booted the DVD on recovery mode.

    The Fedora recovery environment tries to mount your root filesystem automatically. This is good because I do not remember how to mount raid arrays by hand.

    The problem is that Anaconda found two raid arrays that were by default at /dev/md0.

    Very funny. After answer yes to Anaconda mount my root filesystem, it asks in a menu if my root partition is located at md0 or at md0.

    Using Anaconda I was able to mount only one array at a time. But I need to copy files between arrays, and I need to have them mounted at same time.

    The only solution I found was to answer no to Anaconda when it asks to mount my root filesystem. One day later:

    mdadm --examine --scan >> /etc/mdadm.conf
    vi /etc/mdadm.conf ( There were 2 ARRAY /dev/md0. I've renamed the second one to ARRAY /dev/md1 )
    mdadm --assemble /dev/md0
    mdadm --assemble /dev/md1

    Then it is just
    mkdir /mnt/0;mount /dev/md0 /mnt/0
    mkdir /mnt/1;mount /dev/md1 /mnt/1

    As the size of the arrays are very different "df -h" showed me where the old array and where the new array are mounted.


  • checking for changes on websites every 10 seconds
    url="http://www.google.com/";a=`wget -q $url -O - |md5sum|cut -d "-" -f 1`;while (true);do b=`wget -q $url -O - |md5sum|cut -d "-" -f 1`;if [ $a != $b ];then echo CHANGED;fi;sleep 10;done


  • sacnning web servers on local network
    for i in $(seq 1 254); do wget -T 1 -t 1 --spider 192.168.0.$i -O - >/dev/null 2>/dev/null;if [ $? == 0 ];then echo 192.168.0.$i - ok;fi;done


  • installing vlc on fedora 8
    rpm -ivh http://rpm.livna.org/livna-release-8.rpm
    rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-livna
    yum -y update
    yum -y install vlc


  • Nvidia official Linux driver archive
    http://www.nvidia.com/object/linux_display_archive.html


  • sources.list 1.0 for Linux Educacional 2.0
    # sources.list 1.0 for Linux Educacional 2.0
    # peter@thinnet.com.br

    # Debian repository for packages
    deb http://ftp.us.debian.org/debian etch main contrib non-free

    # Debian offical repository for updates
    deb http://security.debian.org/ etch/updates main contrib

    # Unoffical repository for newer version files like kernel
    deb http://www.backports.org/debian etch-backports main contrib non-free

    # Unofficial debian packages
    deb http://ftp.debian-unofficial.org/debian etch main contrib non-free restricted

    # Unoffical multimedia packages like w32codecs and libdvd
    deb http://www.debian-multimedia.org etch main


  • tar over ssh
    #to split tar input and output into two different machines over ssh:

    cd /source_dir
    tar cf - . |ssh user@remote_server "cd /destination_dir;tar xfv -"


  • Remove one character from filenames
    #Remove % from filenames
    for i in `ls |grep "%"`; do a=`echo $i|cut -d % -f 1`;b=`echo $i|cut -d % -f 2`; mv $i $a$b;done

    # More elagant way of doing the same thing
    for i in `ls |grep %`; do mv `echo $i` `echo $i |sed 's/[0-9]\%[0-9][ab]//'`; done


  • creating standard apt-get repository directory tree
    #moves all .deb in current folder to its correct place
    #zenity_2.14.3-1_i386.deb will be moved to ./z/zenity/zenity_2.14.3-1_i386.deb

    for file in `ls *.deb`;do a=`echo $file |cut -b 1`;b=`echo $file |cut -d "_" -f 1`;c=`echo ./$a/$b`;mkdir -p $c;mv $file $c;done


  • finding duplicates files and removing it
    # fdupes need to be installed
    # linuxeducacional20 is the folder where the files will be removed. This must mach the directory name where you want that the files be removed.

    for i in `fdupes -qr . |grep linuxeducacional20`;do rm -rf $i;done


  • Removing empty directories
    for i in `find . -empty -type d`; do rm -rf $i;done