SSH:
Create a empty file in the root of boot partition named "ssh"
(no extension).
touch /mnt/boot/ssh
WIFI:
Create a file in the root of boot partition named "wpa_supplicant.conf" with the following content
country=CZ
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="NETWORK-NAME"
psk="NETWORK-PASSWORD"
}