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/

Monday, May 7, 2007

Seeing and changing your DNS servers

To see which dns server that as been assingned to your by dhcp or inputed manualy, just do:

cat /etc/resolv.conf

To alter (and also see) your dns servers you can always edit /etc/resolv.conf using a text editor like vi or gedit or any other for vi do the following:

# vi /etc/resolv.conf

for gedit the following:

# gedit /etc/resolv.conf

Starting, Stoping and Restarting Services in Linux

To start, stop and restart a service in ubuntu (probaly in all other distros), you go to /etc/init.d, there you have the scripts to all the services (ex: dhcp, newtworking, ...).

For example if you want to stop the dhcp service you just need to do :

# sudo /etc/init.d/dhcp stop

to start it again do:

# sudo /etc/init.d/dhcp start

to restart it do:

# sudo /etc/init.d/dhcp restart

For the other services you just change "dhcp" to the name service script in /etc/init.d.
As you migth already noticed, you can see which services you have by seeing which scripts exist in /etc/init.d.