Linux Pi

Updated: January 14, 2024

converting this document to nixos, then will be deleted :/


Table of Contents

NEW UBUNTU PI4 SETUP

FIRST LOGIN

CREATE STATIC IP

For Ubuntu Servers (best option)

# first disable cloud
sudo vim /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg

network: {config: disabled}

# edit netplan file
sudo vim /etc/netplan/50-cloud-init.yaml

network:
    ethernets:
        eth0:
            dhcp4: no
            addresses:
              - 10.0.18.10/24
            gateway4: 10.0.18.1
            nameservers:
              addresses: [9.9.9.9, 8.8.8.8]
            match:
                driver: bcmgenet smsc95xx lan78xx
            optional: true
            set-name: eth0
    version: 2

# make it so
sudo netplan apply

# check that it worked
ip addr show dev eth0

NOT the best option sudo vim /etc/dhcpcd.conf and add:

interface eth0
static ip_address=10.0.18.20/24
static routers=10.0.18.1
static domain_name_servers=9.9.9.9 8.8.8.8

CREATE USERS

SET TIMEZONE

ENABLE CONTAINERS

sudo vim /boot/cmdline.txt
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory

INSTALL CLI TOOLS

MAKE IT FANCY

SETUP SSH

Ideally for server machines we will only need to put pub keys on for access. Also need to set privleges for local access only.

ssh-copy-id -i ~/.ssh/id_ed25519.pub user@host

SETUP GIT

# set username
git config --global user.name "user"
# set email
git config --global user.email "email"