Skip to content

Instantly share code, notes, and snippets.

@uraimo
Last active May 23, 2018 07:21
Show Gist options
  • Save uraimo/d62e4cebb8f8eb9e0cb06d987ec9473e to your computer and use it in GitHub Desktop.
Save uraimo/d62e4cebb8f8eb9e0cb06d987ec9473e to your computer and use it in GitHub Desktop.

Last update: 5/18

C.H.I.P.

Just use nmtui.

RaspberryPis

On recent ubuntus (16.04+) with the new net interfaces mac rename thingy, disable it to get back to the old naming scheme with:

For the embedded wlan adapter (only renames the wlan0 adapter)

ln -s /dev/null /etc/udev/rules.d/80-net-name-slot.rules

For usb wlan adapters

ln -s /dev/null /etc/udev/rules.d/73-usb-net-by-mac.rules

Configure wlan0

On Ubuntu and Raspbian:

sudo apt-get install wpasupplicant
wpa_passphrase SSID PASSW > wpa.conf

If /etc/wpa_supplicant.conf or /etc/wpa_supplicant/wpa_supplicant.conf do not exist:

sudo cp wpa.conf /etc/wpa_supplicant.conf

Or append to the existing file:

sudo cat wpa.conf >> /etc/wpa_supplicant.conf

Check that the interface is working:

ifconfig wlan0 up
iwlist wlan0 scan   //both should work

Edit /etc/network/interfaces, append this or edit to make wlan0 auto and dhcp:

auto wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant.conf

Try to connect manually or restart:

sudo wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B //it should work (add -D wext for nl80211 adapters)
dhclient -r ;dhclient wlan0

Enable sshd with systemd

sudo systemctl start ssh
sudo systemctl enable ssh
sudo systemctl status ssh

If the last command gives key errors on Raspbian just delete the keys under /etc/ssh/ssh_host_* and:

sudo service ssh restart

To create new ones in one go.

Disable GUI on 16.04+ ubuntus

systemctl set-default multi-user.target --force
systemctl disable lightdm.service --force
systemctl disable graphical.target --force
systemctl disable plymouth.service --force

Fix locale

sudo locale-gen "en_US.UTF-8"
sudo dpkg-reconfigure locales
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment