<commit_before># Add a wireless network to Raspberry Pi

sudo nano  /etc/network/interfaces

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wpa-essid SSID_Name
wpa-psk XXXXX
dns-nameservers 8.8.8.8 192.168.1.1

# Install PuTTY

# Install nmap: https://nmap.org/download.html

nmap -sn 192.168.3.*

Download and install Apple Bonjour: https://support.apple.com/kb/DL999?viewlocale=en_US&locale=en_US

# Connect Raspberry Pi to Ubuntu:
sudo apt-get install dnsmasq

# Wifi device not ready error:
sudo apt-get install rfkill
-- OR --
# Download rfkill from: https://www.kernel.org/pub/software/network/rfkill/
tar -xzf archive-name.tar.gz
cd archive-name
./configure
make
sudo make install

rfkill unblock all
sudo nano /var/lib/NetworkManager/NetworkManager.state
** change any options from false to true to re-enable networking:
sudo reboot
rfkill list

# Install SSH Server in Ubuntu:
sudo apt-get install openssh-server
sudo service ssh status
sudo nano /etc/ssh/sshd_config
sudo service ssh restart
-- OR --
sudo service ssh start
sudo systemctl enable ssh

# Install Screen
sudo apt-get install screen

#Get IP address:
hostname -I

# Fix broken package manager that returns held back packages:
sudo dpkg --configure -a
sudo apt install **list**<commit_msg>SSH access and firewall configuration<commit_after># Add a wireless network to Raspberry Pi

sudo nano  /etc/network/interfaces

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
address 192.168.1.150
netmask 255.255.255.0
gateway 192.168.1.1
wpa-essid SSID_Name
wpa-psk XXXXX
dns-nameservers 8.8.8.8 192.168.1.1

# Install PuTTY

# Install nmap: https://nmap.org/download.html

nmap -sn 192.168.3.*

Download and install Apple Bonjour: https://support.apple.com/kb/DL999?viewlocale=en_US&locale=en_US

# Connect Raspberry Pi to Ubuntu:
sudo apt-get install dnsmasq

# Wifi device not ready error:
sudo apt-get install rfkill
-- OR --
# Download rfkill from: https://www.kernel.org/pub/software/network/rfkill/
tar -xzf archive-name.tar.gz
cd archive-name
./configure
make
sudo make install

rfkill unblock all
sudo nano /var/lib/NetworkManager/NetworkManager.state
** change any options from false to true to re-enable networking:
sudo reboot
rfkill list

# Install SSH Server in Ubuntu:
sudo apt-get install openssh-server
sudo service ssh status
sudo nano /etc/ssh/sshd_config
sudo service ssh restart
-- OR --
sudo service ssh start
sudo systemctl enable ssh

# Install Screen
sudo apt-get install screen

#Get IP address:
hostname -I

# Fix broken package manager that returns held back packages:
sudo dpkg --configure -a
sudo apt install **list**

# Enable ports for SSH:
sudo ufw enable
sudo ufw allow 22
sudo ufw allow ssh

# SSH config:
# https://ubuntuforums.org/showthread.php?t=1558871
sudo grep Port /etc/ssh/sshd_config
{'fraction_non_alphanumeric': 0.0842832469775475, 'fraction_numerical': 0.03903281519861831, 'mean_word_length': 4.080701754385965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 7, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3020763', 'n_tokens_mistral': 1101, 'n_tokens_neox': 949, 'n_words': 345}