0
0
Raspberry Piprogramming~10 mins

Headless deployment setup in Raspberry Pi - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable SSH on Raspberry Pi for headless setup.

Raspberry Pi
sudo systemctl [1] ssh
Drag options to blanks, or click blank then click option'
Aenable
Bdisable
Cstop
Drestart
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'disable' instead of 'enable' disables SSH access.
Using 'stop' or 'restart' only affects current session, not startup.
2fill in blank
medium

Complete the command to create an empty file named 'ssh' in the boot directory to enable SSH on first boot.

Raspberry Pi
touch /boot/[1]
Drag options to blanks, or click blank then click option'
Awpa_supplicant.conf
Bconfig.txt
Ccmdline.txt
Dssh
Attempts:
3 left
💡 Hint
Common Mistakes
Creating 'config.txt' or 'cmdline.txt' does not enable SSH.
Using 'wpa_supplicant.conf' is for Wi-Fi setup, not SSH.
3fill in blank
hard

Fix the error in the command to add Wi-Fi credentials to the Raspberry Pi's wpa_supplicant.conf file.

Raspberry Pi
sudo nano /etc/wpa_supplicant/[1]
Drag options to blanks, or click blank then click option'
Anetwork.conf
Binterfaces
Cwpa_supplicant.conf
Dwlan0.conf
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'network.conf' or 'interfaces' are incorrect for this purpose.
Editing 'wlan0.conf' is not standard for Raspberry Pi Wi-Fi setup.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps each device name to its IP address if the device is active.

Raspberry Pi
active_devices = {device: info[1] for device, info in devices.items() if info['status'] [2] 'active'}
Drag options to blanks, or click blank then click option'
A['ip']
B==
C!=
D.get('ip')
Attempts:
3 left
💡 Hint
Common Mistakes
Using '!=' instead of '==' reverses the condition.
Using '.get('ip')' is valid but not the expected syntax here.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps uppercase device names to their IPs if the IP is not empty.

Raspberry Pi
filtered = { [1]: [2] for [3], info in devices.items() if info['ip'] != '' }
Drag options to blanks, or click blank then click option'
Adevice.upper()
Binfo['ip']
Cdevice
Dinfo
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'info' as key or value incorrectly.
Using 'device' instead of 'device.upper()' for keys.