sudo nano /etc/network/interfaces
auto lo iface lo inet loopback iface eth0 inet dhcp allow-hotplug wlan0 auto wlan0 iface wlan0 inet static address 10.0.0.## network 10.0.0.0 netmask 255.255.255.0 gateway 10.0.0.1 wpa-ssid "network" wpa-psk "password"
Some Ralink chips will power down after some time. This can be annoying - it terminates your SSH connections and such.
sudo nano /etc/modprobe.d/8192cu.conf
# Disable power management options 8192cu rtw_power_mgnt=0 rtw_enusbss=0
crontab -e
*/1 * * * * ping -c 1 192.168.0.254
sudo reboot