Archive for June, 2007

Which Programming Language Are You?

Thursday, June 28th, 2007

I’m prolog. And you?

Which Programming Language are You?

Dia D : Debian Day Manaus (18 ago 2007)

Thursday, June 28th, 2007

Hi all,
Soon I’ll do a presentation about Debian and OLPC on a event in Manaus(Debian Day). My presentations is going to be about debian and olpc.

I’ll be there!!!

Debian Day web site: http://www.gudam.org/

project images: debian_olpc indt_olpc

Thursday, June 28th, 2007

Hi all,
Based on some other images, I created a simple image relating debian and olpc. The other(below) relates olpc and indt.

conheça presidente figueiredo / know presidente figueiredo

Monday, June 25th, 2007

portuguese version:
Olá todos,
Recomendo a todos que desejam passear pelo Amazonas que conheça a terra das cachoeiras, Presidente Figueiredo. Cerca de 1 hora de carro de Manaus para Figueiredo e belissimas cachoerias a sua espera.

PS: Logo deve postar um mapa e mais algumas fotos.

english version:
Hi folks,
I really recommend all that want to come to Amazonas to visit the city of waterfalls, Presidente Figueiredo. Just 1 hour by car from Manaus, amazing waterfalls are waiting for you.

PS: As soon as possible I’ll post a map and more pictures.

synergy (gdm and gnome) automatically

Thursday, June 21st, 2007

Hi all,

Imagine the mouse of your laptop going to the monitor of desktop as a magic.

Probably many of you know about a great application called synergy, it ables you to use 1 keyboard and mouse with many machines. I use a desktop and an laptop in my job and just use the keyboard and mouse of my laptop to control both. It’s much easy and fast. I’m using debian and to install it is very simple.

apt-get install synergy

My configuration file is :

alecrim@alecrim ~ $ cat /etc/synergy.conf
section: screens
senna:
alecrim:
end
section: links
senna:
right = alecrim
alecrim:
left = senna
end

Start the server in the control side.

synergys -c /etc/synergy.conf

And the client in the side controlled.

synergyc $SERVER_IP

Now, you can control both using just keyboard and mouse of control side(in my case, machine alecrim).

You don’t need to start you all the time put gdm init(/etc/gdm/Init/Default), before “exit 0″ the command to start synergy client.


synergyc 172.18.216.170

exit 0

And the in gnome startup applications put synergyc(in controlled side) and synergys(in control side). ;)

Easy and fast.

;)

debian banshee and avawi-daemon problem

Friday, June 15th, 2007

Hi all,
I was with the same problem that other guy from ubuntu.

per@pers:~$ sudo /etc/init.d/avahi-daemon start
* Starting Avahi mDNS/DNS-SD Daemon: avahi-daemon
* avahi-daemon disabled because there is a unicast .local domain

And solved it with:

sudo rm /var/run/avahi-daemon/disabled-for-unicast-local
sudo /etc/init.d/avahi-daemon start

Easy and fast. Now you can you banshee-daap to share the music.

sudo apt-get install banshee-daap

Feel free !!!

Funny maemo code - part 1

Monday, June 11th, 2007

Hi all,
Sometimes a I find funny code and some are very funny. Look this comment in maemo code.


chdir(”/”);

/* Protect us from the oom monster. */
rise_oom_defense(getpid());
}

/* Protect our special childs from the oom monster. */
if (prog->prio < 0)
rise_oom_defense(getpid());

;)

debian dell d600 ipw2100

Friday, June 8th, 2007

Hi all,
In my job, I use a laptop dell d600, with a mini pci wireless card Intel LAN 2100.

02:03.0 Network controller: Intel Corporation PRO/Wireless LAN 2100 3B Mini PCI Adapter (rev 04)

The default debian kernel support this hardware, but you need some additional files(firmware) to wlan work right. These files doesn’t came with default debian kernel, so you can easily use your wlan doing the steps below.

Problem:
dmesg
Output:

ipw2100: Detected Intel PRO/Wireless 2100 Network Connection
ipw2100: eth1: Firmware ‘ipw2100-1.3.fw’ not available or load failed.
ipw2100: eth1: ipw2100_get_firmware failed: -2
ipw2100: eth1: Failed to power on the adapter.
ipw2100: eth1: Failed to start the firmware.
ipw2100Error calling register_netdev.
ACPI: PCI interrupt for device 0000:02:03.0 disabled
ipw2100: probe of 0000:02:03.0 failed with error -5


Solution:

Download the last firmware at:
http://ipw2100.sourceforge.net/firmware.php

Uncompress the tarball file.
tar -xvzf ipw2100-fw-1.3.tgz

It’s going to generate:
LICENSE
ipw2100-1.3.fw
ipw2100-1.3-i.fw
ipw2100-1.3-p.fw

Create a directory with to store the firmware files.
sudo mkdir -p /usr/lib/hotplug/firmware/
sudo cp ipw2100-* /usr/lib/hotplug/firmware/.

Reload the kernel module with related with wlan.
sudo rmmod ipw2100
sudo modprobe ipw2100

Your procedure is correct if you found the message below when you execute dmesg.

ipw2100: Intel(R) PRO/Wireless 2100 Network Driver, 1.2.2
ipw2100: Copyright(c) 2003-2006 Intel Corporation
PCI: Enabling device 0000:02:03.0 (0110 -> 0112)
ACPI: PCI Interrupt 0000:02:03.0[A] -> Link [LNKB] -> GSI 5 (level, low) -> IRQ 5
ipw2100: Detected Intel PRO/Wireless 2100 Network Connection

Install wireless tools to check wlan interfaces.

sudo apt-get install wireless-tools

Checking the wlan interfaces.
iwconfig

Output:

lo no wireless extensions.

eth0 no wireless extensions.

sit0 no wireless extensions.

eth1 IEEE 802.11b ESSID:”WANO” Nickname:”ipw2100″
Mode:Managed Frequency:2.412 GHz Access Point: 00:13:60:17:3D:60
Bit Rate=1 Mb/s Tx-Power:16 dBm
Retry min limit:7 RTS thr:off Fragment thr:off
Power Management:off
Link Quality=81/100 Signal level=-77 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:2737 Missed beacon:4

References:
http://jrblevin.freeshell.org/linux/ipw2100/
http://ipw2100.sourceforge.net/firmware.php

Funny kernel code - part 1

Friday, June 8th, 2007

include/linux/jiffies.h

/*
* The following defines establish the engineering parameters of the PLL
* model. The HZ variable establishes the timer interrupt frequency, 100 Hz
* for the SunOS kernel, 256 Hz for the Ultrix kernel and 1024 Hz for the
* OSF/1 kernel. The SHIFT_HZ define expresses the same value as the
* nearest power of two in order to avoid hardware multiply operations.
*/
#if HZ >= 12 && HZ < 24
# define SHIFT_HZ 4
#elif HZ >= 24 && HZ < 48
# define SHIFT_HZ 5
#elif HZ >= 48 && HZ < 96
# define SHIFT_HZ 6
#elif HZ >= 96 && HZ < 192
# define SHIFT_HZ 7
#elif HZ >= 192 && HZ < 384
# define SHIFT_HZ 8
#elif HZ >= 384 && HZ < 768
# define SHIFT_HZ 9
#elif HZ >= 768 && HZ < 1536
# define SHIFT_HZ 10
#else
# error You lose.
#endif

script rename files removing space

Saturday, June 2nd, 2007

Hi all,
Yesterday I received many files from a friend with many space in the name(like Windows stupid users). I hate it and I found a great script that correct it. It’s published in http://www.pigstye.net/articles/2006/09/18/perl-script-to-remove-spaces-from-file-dir-names

script:

#!/usr/bin/perl -w# nospace /this/dir /that/dir /those/too

use File::Find;use strict;die "usage: nospace dir[s]\n" unless @ARGV;

my %ext;

find(\&remspaces, @ARGV);

sub remspaces {return if ($_ eq '.');return if ($_ eq '..');(my $new = $_) =~ tr/a-zA-Z0-9_.-/_/c;my $duplicate = ($new ne $_ and -e $new);my $try = $new;

$ext{"$File::Find::dir/$try"}++ if $duplicate;

while (my $count = $ext{"$File::Find::dir/$new"}++) {(my $with_num = $new) =~ s/(?=\.|$)/_$count/;$new = $with_num, last if not -e $with_num;}

$ext{"$File::Find::dir/$try"}-- if $duplicate;

rename $_ => $newor warn "can't rename $_ to $new: $!";}

That’s it!!!!