Start by downloading the latest Raspbian from: raspberrypi.org.
Copy the image to the SD-card:
dd bs=4M if=2017-07-05-raspbian-jessie.img of=/dev/sdX conv=fsync
Mount the SD-card and add the wireless configuration file named wpa_supplicant.conf
to the root of the boot partition:
# Network 1
network={
ssid="SSID1"
psk="password1"
key_mgmt=WPA-PSK
}
# Network 2
network={
ssid="SSID2"
psk="password2"
key_mgmt=WPA-PSK
}
Enable SSH on boot by touching the ssh
file in the root of the boot partition:
touch ssh