Wednesday, April 17, 2019

Raspberry Pi setup

A few notes on how I set up Raspberry Pi devices.

Static IP

My home router won't allocate addresses above 100 (I have set it up not to do so), so it is safe to use static IP addresses above that.  I keep a master list of allocated static addresses in /etc/hosts on my desktop (Linux) PC to avoid conflict with other addresses (doesn't do anything to avoid conflicts apart from having a master list in one place!). For example, a new Pi Zero W which I have called "pish" (it originally had a Pimoroni LED shim attached).

192.168.1.108 pish
 
Log in to pish and edit /etc/dhcpcd.conf to add the lines below, and reboot.


interface wlan0
static ip_address=192.168.1.108/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1
 
Assuming ssh is enabled on pish, on the desktop machine to allow login without password:

ssh-copy-id pi@pish

Shell

Add this line to .bashrc
 
export PATH=~/bin:$PATH
Create a ~/bin folder, and add this script to it in a file called update - allows quick system updates just by typing update at the command prompt.
#!/usr/bin/env bash

sudo apt update
sudo apt dist-upgrade
sudo apt autoremove
Create .inputrc and add this line to it (allows tab completion of file names ignoring upper and lower case variants).
set completion-ignore-case on

Editing

gvim (my preferred editor) gives a warning unless these packages are installed:

sudo apt install libcanberra-gtk*-module

No comments:

Post a Comment