eFLL – A Fuzzy Library for Arduino and Embeded Systems

Fuzzy Logic is an extension of traditional Boolean logic, using linguistic variables allows to express logical values ​​intermediate between FALSE and TRUE, describing with greater efficiency the uncertainty principle in the real world.

Fuzzy Systems are practical applications that employ Fuzzy Logic in its decisions making on the basis of linguistic variables and terms, the robotics and the electronic engineering has a large utility room.

Developed by Robotic Research Group (RRG) at the State University of Piauí (UESPI-Teresina) the eFLL (Embedded Fuzzy Logic Library) library is a versatile, lightweight and efficient option to work with Fuzzy Logic in embedded systems.

Full Article HERE.

Posted in computação, IA, Programming, Softwate Livre | Leave a comment

Como instalar LibreOffice no Debian Squeeze

Por Adalgiso Rodrigues (crononsp at gmail dot com)

Pra quem não sabe o Debian Squeeze não tem por default em seus repositórios os pacotes necessários para instalação do LibreOffice.
Me deparei com uma situação em que tive de instalá-lo nessa distro.
Pois bem, baixei o instalador .tar.gz manualmente do site do Libre e, ao tentar instalá-lo com o dpkg, obtive como resultado essa saída:

Lendo listas de pacotes… Pronto
Construindo árvore de dependências
Lendo informação de estado… Pronto
libobasis3.5-pt-br já é a versão mais nova.
Você deve querer executar ‘apt-get -f install’ para corrigí-los:
Os pacotes a seguir têm dependências desencontradas:
libobasis3.5-pt-br : Depende: libobasis3.5-core01 mas não é instalável
libreoffice3.5-dict-pt : Depende: libreoffice3.5-ure mas não é instalável
Depende: libobasis3.5-core01 mas não é instalável
Depende: libobasis3.5-core02 mas não é instalável
Depende: libobasis3.5-core03 mas não é instalável
Depende: libobasis3.5-core04 mas não é instalável
Depende: libobasis3.5-core05 mas não é instalável
Depende: libobasis3.5-core06 mas não é instalável
Depende: libobasis3.5-core07 mas não é instalável
Depende: libreoffice3.5 mas não é instalável
libreoffice3.5-pt-br : Depende: libreoffice3.5 mas não é instalável
E: Dependências desencontradas. Tente ‘apt-get -f install’ sem nenhum pacote (ou especifique uma solução).

Tentei a instalação forçada com o parâmetro -f como sugeriu o sistema e nada.
A solução porém está em alguns passos básicos que irei descrever a seguir.

1 – Repositório certo

Acesse o seu sources.list usando o editor de sua preferência (nano, vi, mcedit…) e deixe-o dessa forma:

deb http://ftp.br.debian.org/debian squeeze main contrib non-free
deb http://sft.if.usp.br/debian-backports/dists/ squeeze-backports main

deb http://ftp.debian.org/debian/ squeeze-updates main
deb-src http://ftp.debian.org/debian/ squeeze-updates main

deb http://backports.debian.org/debian-backports squeeze-backports main
deb http://ftp.br.debian-backports/ squeeze-backports main contrib non-free

2 – Atualize o repositório

apt-get update

3 – Instalar o Java

Tentei instalar outras versões mas as que deram certo para mim foram essas:


ATTENTION!!! Se você já instalou outras versões, primeiro as desinstale. Se você não sabe se tem java instalado ou não sabe sua versão execute o comando no prompt:

java -version

Para desinstalar o java antigo: apt-get remove seujava ou dpkg –purge seujava

Você pode instalar facilmente os pacotes corretos via apt-get:

apt-get install openjdk-6-jdk
apt-get install sun-java6-jre sun-java6-plugin sun-java6-bin sun-java6-fonts

4 – Instale o Libre com o comando:

apt-get -t squeeze-backports install libreoffice

Lembrando que por default a instalação é em inglês, mas no site do projeto são diponibilizados pacotes de tradução para vários idiomas, inclusive o português. Você pode baixar o pacote e descompactá-lo por meio do tar:

tar -zxvf nomedopacote.tar.gz

Entre no diretório gerado e execute todos os .deb dentro da pasta DEBS

cd nomedodiretorio; dpkg -iR DEBS/*

Se não ocorrer nenhum problema o Libre será carregado em português.
Outro dado interessante é que nas próximas distros (Wheezy/Sid) bastará um apt-get install libreoffice.

É isso ai pessoal. Espero ter contribuído para o conhecimento de vocês.

Posted in apt, computação, Linux | Leave a comment

IPy – A Python module for handling IPv4 and IPv6 Addresses and Networks

IPy is a Python module for handling IPv4 and IPv6 Addresses and Networks in a fashion similar to perl’s Net::IP and friends. The IP class allows a comfortable parsing and handling for most notations in use for IPv4 and IPv6 Addresses and Networks.
It enables code like this:

      >>> ip = IP('')
      >>> for x in ip:
      ...  print x
      >>> ip2 = IP('0x7f000000/30')
      >>> ip == ip2
      >>> ip.reverseNames()
      ['', '',
      '', '']
      >>> ip.reverseName()
      >>> ip.iptype()

It can detect about a dozen different ways of expressing IP addresses and networks, parse them and distinguish between IPv4 and IPv6 addresses.

      >>> IP('').version()
      >>> IP('::1').version()
      >>> print IP(0x7f000001)
      >>> print IP('0x7f000001')
      >>> print IP('')
      >>> print IP('10')
      >>> print IP('1080:0:0:0:8:800:200C:417A')
      >>> print IP('1080::8:800:200C:417A')
      >>> print IP('::1')
      >>> print IP('::')
      >>> print IP('')
      >>> print IP('')
      >>> print IP('')

      >>> IP('').strNormal(q)
      >>> IP('').strNormal(2)
      >>> IP('').strNormal(3)

Read the full article HERE.

Posted in computação, Programming, python | Leave a comment

Aptitude vs Apt-Get

Being an Ubuntu/Debian user (yes, I use and advocate both), I have fallen in love with the Advanced Packaging Tool, also known as apt. Before Ubuntu, I played in the world of RPM hell, with distros such as Red Hat itself, Mandrake (as it was called back then), and even SuSE. I would find some piece of software, try to install it, only to find that it would choke, saying that it relied on some certain dependencies. I would install the dependencies, only to find conflicting versions with newer software. Hell indeed. So when I discovered the Debian way of installing software, I wondered why no one had mentioned it to me before. It was heaven. This is the way to software, I thought.

So, as any new user to the world of apt learns, apt-get is the way to install software in your system. After working on a Debian-based system that uses apt, such as Ubuntu, you also learn the various tools:

  • apt-get: Installing and removing packages from your system, as well as updating package lists and upgrading the software itself.
  • apt-cache: Search for packages in the package list maintained by apt on the local system
  • dpkg- Used for various administrative tasks to your system, such as reconfiguring Xorg.

Those are probably the first few tools that you learn while on a Debian-based distro, if you plan on getting down and dirty at any length. But the buck doesn’t stop there. You need to memorize, and learn other tools, if you are to further administrate your system. These include:

  • apt-listbugs: See what bugs are listed on a software package before you install it.
  • apt-listchanges: Same thing as apt-listbugs, but for non-bug changes.
  • apt-rdepends: Tool for viewing dependency trees on packages.
  • deborphan- Look for orphaned dependencies on the system left from removing parent packages.
  • debfoster- Helps deborphan identify what package dependencies you no longer need on your system.
  • dselect- Curses interface for viewing, selecting and searching for packages on your system.

There’s even more: apt-cdrom, apt-config, apt-extracttemplates, apt-ftparchive, apt-key, apt-mark and apt-sortpkgs.

If any of you have noticed, that is 16 different tools that you need to become familiar with, if you are to start learning about your Debian-based distro. I don’t know about you, but doesn’t that seem a bit bass-ackwards? I mean, when I’m using OpenSSH, for example, other than scp, all of the functionality of OpenSSH is filed under one tool: ssh. So, wouldn’t you think that all the functionality of apt would be under one tool, namely just ‘apt’?

Further more, apt-get has a big problem that hasn’t really been addressed until only just recently. The problem is in removing packages. You see, apt-get does a great job of indentifying what dependencies need to be installed when you want a certain package, but it fails miserably when you want to remove that package. If dependencies were required, ‘apt-get remove’ will remove your packages, but leave orphaned dependencies on your system. Psychocats.net has a great writeup on this very phenomenon, by simply installing and removing the package kword. The solution? Aptitude.

Now, before I continue, I want to say that yes, I am aware of ‘apt-get autoremove’ finally being able to handle orphaned dependencies. This is a step in the right direction, for sure. However, apt-get, with its many other tools, is an okay way of doing things, if you like to learn 16 different tools. Aptitude, as I will show you, is one tool for them all.

Aptitude is the superior way to install, remove, upgrade, and otherwise administer packages on you system with apt. For one, since it’s inception, aptitude has been solving orphaned dependencies. Second, it has a curses interface that blows the doors off of dselect. Finally, and most importantly, it takes advantage of one tool, doing many many functions. Let’s take a look:

  • aptitude: Running it with no arguments brings up a beautiful interface to search, navigate, install, update and otherwise administer packages.
  • aptitude install: Installing software for your system, installing needed dependencies as well.
  • aptitude remove: Removing packages as well as orphaned dependencies.
  • aptitude purge: Removing packages and orphaned dependencies as well as any configuration files left behind.
  • aptitude search: Search for packages in the local apt package lists.
  • aptitude update: Update the local packages lists.
  • aptitude upgrade: Upgrade any installed packages that have been updated.
  • aptitude clean: Delete any downloaded files necessary for installing the software on your system.
  • aptitude dist-upgrade: Upgrade packages, even if it means uninstalling certain packages.
  • aptitude show: Show details about a package name.
  • aptitude autoclean: Delete only out-of-date packages, but keep current ones.
  • aptitude hold: Fix a package at it’s current version, and don’t update it

Are we starting to see a pattern here? One command with different readable options (no unnecessary flags). And that’s just the tip of the ice berg. It gets better. For example, when searching for a package using aptitude, the results are sorted alphabetically (gee, imagine that) and justified in column width format. Heck, it will even tell you which one you have installed on your system already, instead of haphazardly listing the packages in some random, unreadable format, like apt-cache.

I’ve already mentioned it, but aptitude run with no options will pull up a curses application for you to navigate your apt system. If any of you have used it, you know that it is far superior to dselect- talk about a shoddy application. Aptitude makes searching for packages, updating them, removing them, getting details and other necessary tools, easy. Spend 20 minutes inside the console, and you begin to feel like this is an application done right. Spend 20 minutes in dselect, and you’ll begin to get massive headaches, and feel lost inside Pan’s Labyrinth.

Aptitude is just superior to apt-get in every way, shape, and form. Better dependency handling. Better curses application. Better options. ONE tool. Better stdout formatting. The list goes on and on. I see constantly, on forums, IRC and email, the use of apt-get. We need to better educate our brethren and sisters about the proper use of tools, and show them the enlightened way of aptitude. I’ve been using aptitude since I first learned about it, ad will continue to do so the remainder of my Debian/Ubuntu days.

Fonte: pthree.org

Posted in Uncategorized | Leave a comment

Utilizando SysRq em Sistemas Debian pela rede por meio do sysrqd

Creio que muitos usuários leigos já se indagaram sobre a funcionalidade da tecla (Print Screen | Sysrq) em seus teclados. SysRqsignifica System Request, que são funções mapeadas em atalhos de teclado pelo Kernel.

É possível usá-las pressionando a combinação de teclas Alt + SysRq + [tecla], que permite executar comandos comuns do SysRq, tais como: sync, umount, reboot, poweroff, sak, term, etc., onde [tecla] pode ser s (sync), k (SAK), 0-9 (nível de log), b (reboot), entre outras.

sysrqd é um pequeno daemon que visa oferecer o controle do sistema com SysRq pela rede.

A grande utilidade dessas funções são em situações em que o sistema está com carga de trabalho (processamento e memória) muito alta ou até mesmo inoperante. Já sysrqd é bastante útil quando não se está na frente do servidor e seja necessário realizar alguma intervenção.

Eis uma relação das funções que o SysRq oferece:

  • r – Tira o teclado e o mouse do controle do servidor X. Isso pode ser bem viável quando o servidor; X estiver travado, pode-se mudar para um terminal e matar o X (ou ainda, verificar os logs);
  • k – Mata todos os processos que estão rodando no momento. Não é aconselhável fazer isso no terminal onde está rodando o X (tty7). A interface gráfica iria parar;
  • b – Imediatamente reinicia o sistema, sem desmontar partições ou realizar sincronização;
  • o – Desligamento via APM;
  • s – Realiza a sincronização de todo o sistema de arquivos montado, ou seja, escreve todos os dados em memória virtual para a física;
  • u – Remonta todo sistema de arquivos que foi montado para read-only;
  • t – Mostra uma lista de tarefas atuais e suas informações para o console;
  • m – Envia todas as informações atuais da memória para o terminal;
  • p – Imprimi os conteúdos atuais dos registradores e flags para o console;
  • 0-9 – Define o nível de log do console, controlando que mensagens do kernel serão impressas para no console;
  • e – Envia um SIGTERM para todos os processos fazendo com que se preparem para o shutdown ou reboot, exceto o init;
  • i – Envia um SIGTERM para todos os processos (Quem não obdeceu ao Alt + SysRq + e toma um kill -9), exceto o init;
  • l – Envia um sinal de SIGKILL para todos os processos, inclusive o init;
  • f – Executará a chamada de sistema oom_kill para matar o processo que está usando mais memória;
  • h – Usado para mostrar a ajuda. Entretanto, qualquer outra tecla não-listada acima irá exibir a ajuda.

Para habilitar as funções de SysRq, é necessário ativá-la no kernel:

  # echo "1" > /proc/sys/kernel/sysrq


Para persistir essa informação mesmo após um reinício da máquina, adiciona-se a seguinte linha ao /etc/sysctl.conf:

  kernel.sysrq = 1


Instalação do Sysrqd em Sistemas Debian

  # apt-get install sysrqd


Uso do sysrqd

A conexão com o sysrqd é protegido por senha, mas não cifrada. Configurando a senha:

  # echo "senha_do_servico"> /etc/sysrqd.secret

  # chmod 0600 /etc/sysrqd.secret


Agora, para testar, basta dar um telnet na porta 4094/tcp.

  $ telnet localhost 4094
  Trying ...
  Connected to localhost.
  Escape character is '^]'.
  sysrqd password: senha_do_servico
  sysrq> s
  sysrq> u
  sysrq> q

Fonte: http://www.dicas-l.com.br/dicas-l/20110720.php

Posted in Uncategorized | Leave a comment

How to Convert FLV Files to MPEG4 in Linux

Flash is the standard for web video today, but many people also want to watch these videos while offline. The answer is to download the FLV file. What if, however, your video player of choice or portable device can’t handle FLV files? The solution in Linux is to convert the file with ffmpeg.


  • Install ffmpeg. For example, Ubuntu uses a package management application called Synaptic, which can be opened by clicking “System,” then “Administration,” then “Synaptic Package Manager.” Open this program and search for “ffmpeg,” right-click it and click “Install.” Then choose “Apply all operations.”
    How to install programs on other distributions varies widely. Check your distribution’s website to find out how package management works, and how to install the package named “ffmpeg.”

  • Click “Applications,” “Accessories,” then choose “Terminal” to open a terminal and steer it toward the video by typing the command “cd” followed by the folder the video is in. For example, if the video is on the desktop, type “cd Desktop” and hit “Enter.” If the video is in a folder named “Videos/mpeg,” type “cd Videos/mpeg” and hit “Enter.”

  • Convert the file by typing “ffmpeg -i,” followed by the video you’re converting, followed by the wmv video you want to created. For example, in the screen shot shown here, a file named “johnhodgman.flv” is being converted to to “johnhodgman.mp4,” so the command to type is “ffmpeg -i johnhodgman.flv johnhodgman.mp4.”

    Click “Enter” to start the conversion, and an iPod-ready MPEG4 file is created.


  • Read more: How to Convert FLV Files to MPEG4 in Linux | eHow.com


    Posted in Linux, Video | Leave a comment

    Tethering iPhone on Ubuntu 11.04


    • Ubuntu 11.04
    • iPhone[bb] 3GS with iOS 4.3

    The following steps can be used to enable tethering between a platform running Ubuntu 11.04 and an iPhone. At a high level:

    1. Enable tethering on iPhone
    2. Install repository from Paul McEnery
    3. Install necessary packages
    4. Connect

    Enable Tethering[bb] on iPhone

    The use of iPhone tethering might be governed by your wireless plan. If data tethering is allowed, one should be able to turn it on using the “Settings” application.
    In the “Settings” application, choose “Personal Hotspot” from the menu, and enable it by pushing the switch to “on”.

    If one can not accomplish this step, the remainder steps from this article will be in vain.

    Install repository from Paul McEnery

    Adding package “python-software-properties” provides the command “add-apt-repository”. This command is then used to make it really easy to add a repository from PPA.

    sudo apt-get install python-software-properties
    sudo add-apt-repository ppa:pmcenery/ppa

    Install necessary packages

    Once the repository is installed, installing the packages is straight forward:

    sudo apt-get update
    sudo apt-get install gvfs ipheth-dkms ipheth-utils

    During the configuration of those packages, a kernel module must be built. In the case that the kernel headers are not installed, the following error message is printed on the screen:

    Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed.

    In this case, the proper headers must be installed. To find out which headers are required:

    uname -r

    Then, install the headers using the following command. Ensure that you replace the proper version according to what was returned previously.

    sudo apt-get install linux-headers-2.6.38-8-generic-pae

    When this command completes, the iPhone module should be built. If not, then the system can be prompted to rebuild the kernel module:

    sudo dpkg-reconfigure ipheth-dkms


    Connect the iPhone to the platform using a USB cable. When the USB device is detected, an Ethernet should be established automatically.


    Fonte: http://www.bitsbythepound.com/tethering-iphone-on-ubuntu-11-04-397.html


    Posted in apt, Geek, Linux | Leave a comment

    How to fix unmet dependencies error on Debian-like systems

    Sometimes when you download a .deb(Debian Package file) of an package that you would like to install it will give you the “dependencies not met” error. This could happen when you use dpkg, Gdebi Package Manager or apt.

    The solution to this is make sure that the version of the package you downloading is the newest version you can find. If this is the case then run this command:

    sudo apt-get -f install

    This will force apt to fix the broken dependencies.

    Fonte: http://undiff.com/2008/08/deb-dpkg-unmet-dependencies-and-how-to-fix-this/

    Posted in apt, Linux, Sysadmin | Leave a comment

    How to Switch Between GDM and KDM on Ubuntu

    If you have installed the Kubuntu desktop on top of Ubuntu or the other way around, you may want to switch from gdm to kdm, or from kdm to gdm. This is an easy thing to do.

    Open a terminal window and type in the following command:

    sudo dpkg-reconfigure gdm

    Hit enter at the OK prompt, and then you can switch between the two easily:

    Fonte: Fonte: http://www.howtogeek.com/

    Posted in Linux, Sysadmin | Leave a comment

    CrazyFlie Quadrocopter – You’ll Believe a Circuit Board Can Fly

    (via crunchgear)

    Posted in Geek | Leave a comment