Quick description of how to do it:
cat /etc/wpa_supplicant/wpa_supplicant.conf
network={
ssid="name_of_a_wireless_network"
key_mgmt=WPA-PSK
psk="password_to_a_wireless_network"
}
next step:
cat /etc/network/interfaces
#if your wireless card is wlan0, otherwise change to the right wireless card.
allow-hotplug wlan0
iface wlan0 inet static
address your_ip
netmask your_mask
gateway your_gateway
dns-nameservers your_dns
pre-up wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant/wpa_supplicant.conf -B
post-down killall -q wpa_supplicant
Why that ? because it works on all linux distributions.