wpa_supplicant

PSK

network={
        ssid="ssid"
        #psk="passphrase"
        psk=2b1d17284c5410ee5eaae7151290e9744af2182b0eb8af20dd4ebb415928f726
}

EAP-PEAP

network={
        ssid="ssid"
        scan_ssid=1
        key_mgmt=WPA-EAP
        eap=PEAP
        phase2="auth=MSCHAPV2"
        identity="username"
        password="password"
        pairwise=CCMP
        group=CCMP
}

WEP

network={
        ssid="ssid"
        key_mgmt=NONE
        wep_key0=1A2B3C4D5E
}

Open

network={
        ssid="ssid"
        key_mgmt=NONE
}

Run wpa_supplicant with:

wpa_supplicant -B -Dwext -i{interface} -c/usr/local/etc/wpa_supplicant.conf