1) configure wireless adapter

add to /etc/network/interfaces:

auto wlan0
iface wlan0 inet static
    address 192.168.13.1
    network 192.168.13.0
    netmask 255.255.255.0
    broadcast 192.168.13.255

2) ap daemon

install hostapd:

sudo aptitude install hostapd

edit /etc/hostapd/hostapd.conf:

interface=wlan0
driver=nl80211

# AP name
ssid=MY_AP
country_code=RU
hw_mode=g
channel=1

macaddr_acl=0

wpa=3
wpa_key_mgmt=WPA-PSK
# password
wpa_passphrase=password
wpa_pairwise=TKIP CCMP

edit /etc/default/hostapd:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

start daemon:

sudo /etc/init.d/hostapd start

3) netfilter

su
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
exit

for every boot system, edit /etc/network/if-pre-up.d/wifi:

#!/bin/sh
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward
/sbin/iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE

grant execute permissions:

sudo chmod +x /etc/network/if-pre-up.d/wifi

if use ppp0:

sudo iptables -t nat -A POSTROUTING -s 192.168.13.0/24 -o ppp0 -j MASQUERADE

add line to /etc/network/if-pre-up.d/wifi:

/sbin/iptables -t nat -A POSTROUTING -s 192.168.13.0/24 -o ppp0 -j MASQUERADE

4) DNS & DHCP

install:

sudo aptitude install dnsmasq

edit /etc/dnsmasq.conf:

interface=wlan0
dhcp-range=192.168.13.10,192.168.13.50,24h

restart deamon:

sudo /etc/init.d/dnsmasq restart

5) enjoy!