Tuesday, June 12, 2007

Configuração de Acesso 802.1x/PEAP para Linux (e-U da FEUP)

Configuração de Acesso 802.1x/PEAP para Linux (testado na e-U de FEUP)

O exemplo de configuração apresentado representa os passos necessários para a configuração do método de autenticação 802.1x/PEAP para o sistema operativo Linux. Este método de autenticação é utilizado na rede wireless do IPLeiria identificada com o SSID "e-U".

0) Atenção: Sistemas Testados

Portátil NEC P520 com Ubuntu 6.10

A placa de rede utilizada foi uma Intel ProWireless 2100


Portátil HP DV6175EA com Kubuntu 6.10 versão 64 bits

A placa de rede utilizada foi uma Intel ProWireless 3985.


1) Instalação do cliente wpasupplicant

Para usar este método de autenticação em Linux, é necessário instalar o cliente wpasupplicant. No caso do ubuntu, basta efectuar o comando:

apt-get install wpasupplicant


2) Download do Certificado

Comece por efectuar o download do certificado com o comando:

wget http://www.fe.up.pt/si/web_gessi_docs.download_file?p_name=F474906633/FEUP-ROOT-CA-2005.pem

Copie o certificado para a directoria /etc/cert/ (em principio é preciso criar a directoria)

NOTA: Este certificado está num formato adequado para a utilização com o wpa supplicant, sendo por isso diferente do já disponibilizado para as configurações em Windows. No caso de já possuir esse certificado em formato .cer, poderá convertê-lo utilizando o comando:

openssl x509 -in FEUP-ROOT-CA-2005.cer -inform d -out FEUP-ROOT-CA-2005.pem


3) Criar o ficheiro de configuração do WPA Suppplicant
Crie o ficheiro /etc/wpa_supplicant.conf e coloque as seguintes configurações:

Nota: no howto do IPL em vez de /etc/wpa_supplicant.conf tinha /etc/wpa_supplicant/pa_supplicant.conf
mas o script IPLwifi.sh (abaixo) ia buscar o /etc/wpa_supplicant.conf e não funcionava.

--------------------------------------------------------------------------------

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1 #se a placa n suportar testar com ap_scan=0 e ap_scan=2
fast_reauth=1

network={
ssid="e-U"
scan_ssid=1 # only needed if your access point uses a hidden ssid
key_mgmt=IEEE8021X
eap=PEAP
identity="o_teu_login@fe.up.pt"
password="a_tua_password"
ca_cert="/etc/cert/FEUP-ROOT-CA-2005.pem"
phase2="auth=MSCHAPV2"
}

--------------------------------------------------------------------------------
NOTA: Alterar os campos "o_teu_login" e "a_tua_password" com os teus dados.


4) Funcionamento

Se a sua placa estiver instalada correctamente, apenas é necessário utilizar o script para iniciar a ligação à rede e-U. Poderá efectuar o download deste script com o comando:

wget http://wireless.ipleiria.pt/configuracao/IPLwifi.sh

Terá de dar permissões de execução ao ficheiro com o comando:

chmod +x IPLwifi.sh

O script terá de ser executado como root com o comando:

sudo ./IPLwifi.sh start | stop | restart


NOTA: Edite o script e altere a váriável interface (geralmente eth1) de acordo com as configurações existentes no seu computador.


Baseado em: http://wireless.ipleiria.pt/configuracao/peaplinux

Tuesday, June 5, 2007

Adaptação Joysticks de Video Games (Consolas) pro PC

Aqui ficam os links para a fazer adaptadores para os gamepads(joysticks) das consolas abaixo referidas de forma a funcionarem no PC:

Joystick de Mega Drive

http://www.clubedohardware.com.br/artigos/759/1

Joystick de Playstation

http://www.clubedohardware.com.br/artigos/759/2

Joystick de Super Nintendo

http://www.clubedohardware.com.br/artigos/759/3

Joystick de Nintendo 64

http://www.clubedohardware.com.br/artigos/759/4

Thursday, May 31, 2007

Pic Programmer With Only Resistors, Capacitor and Diodes - RCD

I found this page with a pic programmer that is very simple and cheap. It's built off only Resistors, Capacitors and Diodes, and suports lots of o PICs, check it out at:

http://feng3.cool.ne.jp/en/rcd.html

Wednesday, May 30, 2007

Instaling Java in Mozilla Firefox on Linux

First you need to download the Java Runtime Environment (JRE) or the Java Development Kit (JDK) and install it.


The JRE is what you need to run java programs on your computer, but it doesn't allow you to develop in java, This is probably the more suited solution for you if you are not a developer, because is smaller the de JDK.

If you are a developer download the JDK (if you already don't have it already) which includes the JRE and adds the tools for developing.

To download you can go to:

http://java.sun.com/javase/downloads/index.jsp


Basically what we need to do is put a symbolic link for the plugin in the jre of either the JDK or the JRE, in Mozilla Firefox

-----------------------------------------------------------------------------------------------------
For JDK you must execute in the shell something like this:

# ln -s /path_to_jdk/jdkx.x.x_xx/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so

where you should replace "path_to_jdk" with the path to you JDK and replace "jdkx.x.x_xx" with the version of your JDK

----------------------------------------------------------------------------------------------------
For JRE you must execute in the shell something like this:

# ln -s /path_to_jre/jrex.x.x_xx/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so

where you should replace "path_to_jdk" with the path to you JDK and replace "jrex.x.x_xx" with the version of your JDK


And that's it, you can now see pages that use java components.

Thursday, May 24, 2007

Linux (Ubuntu) Network Install

Introduction

Some days ago I had to install Ubuntu Breezy – a GNU/Linux flavour based on Debian and powered by apt-get – on four machines and I had only one CD-Rom available. And doing some fast calculations you can find out that it’s faster to install through a 100Mbps LAN (~12.5 Mb/s highest peek) than using a normal 52x CD-Rom.

Initially, the idea was to load the boot sector directly from the onboard network card. Unfortunately, I wasn’t able to do so (it skipped network boot as if it didn’t detect anything) and I decided to stick with that sometimes useful floppy disk and include a small boot sector that had the drivers included.

Ready to start?

Setting up the server

First off, you'll need a server where your clients will be connecting. That server must have a small FTP, HTTP and DHCP server and, obviously, an Ubuntu installation CD available. The DHCP allows your clients to connect to your network and the HTTP/FTP server will deliver installation files and package repositories.

Our FTP server will be tftpd-hpa. On Ubuntu/Debian this is a matter of

CODE:
  1. root@server$ apt-get install package-name

and that’s it, everything gets installed and set up. Let’s install everything at once:

CODE:
  1. root@server$ apt-get install tftpd-hpa apache2 dhcp3-server

Now it’s time to copy the content of the Ubuntu cd. Just do

CODE:
  1. root@server:/var/lib/tftpboot$ mkdir ubuntu
  2. root@server:/var/lib/tftpboot$ mount -o loop /var/lib/tftpboot/ubuntu-5.10-install-i386.iso /var/lib/tftpboot/ubuntu

In order to get an ISO of your installation CD, you can do (astonish yourself)

CODE:
  1. root@server$ cat /dev/hdb > ubuntu-5.10-install-i386.iso

where hdb is your CD-Rom device. It can be anything else other than hdb so you’d better figure out with dmesg (root@server # dmesg) or doing whatever suits you.

Make a symlink from apache's root to the mounted ISO

CODE:
  1. root@server:/var/www # ln -s /var/lib/tftpboot/ubuntu/

configure the DHCP server according to your network:

CODE:
  1. root@server:~ # cat /etc/dhcp3/dhcpd.conf
  2. ping-check = 1;
  3. filename = "ubuntu/install/netboot/pxelinux.0";
  4. subnet 192.168.1.0
  5. netmask 255.255.255.0 {
  6. range 192.168.1.10 192.168.1.254;
  7. }
CODE:
  1. root@server:~ # /etc/init.d/dhcp3-server restart
  2. Stopping DHCP server: dhcpd3.
  3. Starting DHCP server: dhcpd3.

And now run the clients. If you were able to see the Ubuntu boot prompt, that’s it. Now you just have to carry on with the installation. Otherwise, if you didn’t see anything and the boot continued as usual – just like happened to me – then keep reading this tutorial.The alternative is, like I said before, using a boot disk with the drivers. Etherboot has what we’re looking for. Download the latest version and read the README file. Then you just have to find out which network card you have and follow the very quick instructions.


taken from: http://mywheel.net/blog/index.php/ubuntu-network-install/

For other distros it's probably the same except for the packages download, here we used apt-get for downloading the needed packages, in other distros you may have some other way of downloading the packages like yum or you can always can go the internet and search for it.

Friday, May 18, 2007

Save a partition directly to a compressed file

To save a partion directly to a compressed file in linux is very easy regardless of the filesytem, you can save for example a NTFS (Windows NT File System) whith this.

To save the partition and later restore it, we are going to use three programs the first is 'dd' the which is used to make exact copies of partitions and restore them and the others are 'bzip2' which is used to compress and 'bunzip' to uncompress.

In order to save a partition to a compress a partition to a compress file, just do:


# dd if=/dev/hda2 bs=10M | bzip2 > /.../hda2_save.bz2


Where '/.../' must be replaced with the path to the dir where you want your partition compress save to be.

Has you can see above 'dd' has no 'of' (output file) so it's output will be the standart output (the shell), wich we redirect with '|' (pipe) to 'bzip2' standart input (which if not redirected is the keyboard), buzip2 will continuously compress the stream of data coming from 'dd', and that's it.




In order to save a partition to a compress a partition to a compress file, just do


# bunzip2 /.../hda2_save.bz2 --stdout | dd of=/dev/hda2


Where '/.../' must be replaced with the path to the dir where you want your partition compress save is.

Has you can see above 'bunzip2' has the option '--stdout' wich means that it will uncompress the file to the standart output (the shell) wich we redirect with '|' (pipe) to 'dd' standart input (which if not redirected is the keyboard).

Thursday, May 10, 2007

Instalar drivers da Nvidia em Ubuntu Feisty

A instalação foi realizada no meu notebook. A placa de vídeo aqui é uma NVIDIA GeForce 6150 256MB

Faça uma cópia de segurança do aquivo xorg.conf antes de iniciar a instalação.

$ sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf_bkp

1- Removendo pacotes antigos

$ sudo apt-get --purge remove nvidia-glx nvidia-settings nvidia-kernel-common

2- Instalando pacotes necessários

Certifique-se de ter habilitado os repositórios universe e multiverse

$ sudo apt-get install linux-restricted-modules-$(uname -r) build-essential xserver-xorg-dev

3- Baixe o driver aqui!

Esse é o ultimo release do driver

Mais informações sobre o driver aqui!

www.nvidia.com

4- Edite o arquivo linux-restricted-modules-common

$ sudo gedit /etc/default/linux-restricted-modules-common

Altere a linha DISABLED_MODULES=”"

Para DISABLED_MODULES=”nv”

5- Entrando em modo texto

Precione as teclas Ctrl + Alt + F1 e efetue o login. Não se assuste esse é o lado negro da força.

Após logado no modo texto vamos parar o gdm.

6 - Parando o gdm

$ sudo /etc/init.d/gdm stop

7- Executando o driver

Entre no diretório em que o foi salvo o aquivo .run

Transforme o aquivo em executável e em seguida execute o aquivo .run

$ sudo chmod +x NVIDIA-Linux-x86-1.0-9755-pkg1.run

A instalação e bem tranquila e só responder Ok em quase todas as perguntas. Só responda não na pergunta em que ele diz não ter um kernel compilado no sistema, se você aceitaria fazer o download desse kernel no site da nvidia.

$ sudo sh ./NVIDIA-Linux-x86-1.0-9755-pkg1.run

8 - Reinicie o sitema

$ sudo shutdown -r now

Pronto driver instalado!

9- Verificando a instalação

O primeiro sintoma que ocorreu no pc após a instalação do driver foi uma tela preta com o logo da nvidia antes de iniciar o gdm.

No menu Aplicações->Ferramentas do Sistema aparecerá a opção NVIDIA X Server Settings.

No terminal digite:

$ glxinfo | grep direct

Deve retornar

$ direct rendering: yes


retirado de: http://dfthiagodf.wordpress.com/2007/03/27/instalando-driver-nvidia-no-ubuntu-feisty/