Skip to content

Instantly share code, notes, and snippets.

@0x4248
Created April 28, 2024 14:50
Show Gist options
  • Save 0x4248/6d6cb115d444c0d10f599c8e22fe104b to your computer and use it in GitHub Desktop.
Save 0x4248/6d6cb115d444c0d10f599c8e22fe104b to your computer and use it in GitHub Desktop.
This goes trough how I set up my raspberry pi

How I set up my raspberry pi

First I downloaded the latest version of Raspbian lite from the Raspberry Pi Imager. I then flashed the image to a microSD card using the Raspberry Pi Imager.

I then inserted the microSD card into the Raspberry Pi and powered it on. I connected to the Raspberry Pi using SSH in VS Code which installs the VS Code server on the Raspberry Pi. I then install all of my extensions I would use on my local machine.

Important notes

Trough out this guide I will be using callouts to highlight important information.

Note

This is a note.

Tip

This is a tip.

Warning

This is a warning.

Warning

CHECK: This is a check. Make sure to do what is listed to avoid issues.

Installing software

Devtools installer

Devtools installer is a program that I made that allows you to select what software you want to install on your linux machine.

Installing the devtools installer

First you will need to have git installed on your machine. You can install git by running the following command:

sudo apt update && sudo apt install git -y

Then you can clone the devtools installer repository by running the following command:

git clone https://www.github.com/0x4248/devtools_installer ~/devtools_installer

Tip

If you dont want to git clone all of the history of the repository you can use the --depth 1 flag.

git clone --depth 1 https://www.github.com/0x4248/devtools_installer ~/devtools_installer

You should now have the devtools installer repository on your machine.

Warning

CHECK if running

ls -l ~/devtools_installer/

returns a similar output to:

total 84
drwxr-xr-x 2 pi pi  4096 Apr 28 14:32 bin
-rwxr-xr-x 1 pi pi  5218 Apr 28 14:32 CODE_OF_CONDUCT.md
drwxr-xr-x 2 pi pi  4096 Apr 28 14:32 conf
-rw-r--r-- 1 pi pi  5034 Apr 28 14:32 config
-rwxr-xr-x 1 pi pi  1564 Apr 28 14:32 CONTRIBUTING.md
drwxr-xr-x 2 pi pi  4096 Apr 28 14:32 doc
-rwxr-xr-x 1 pi pi 35149 Apr 28 14:32 LICENCE
-rw-r--r-- 1 pi pi   539 Apr 28 14:32 README.md
-rw-r--r-- 1 pi pi  1114 Apr 28 14:32 run.sh
-rwxr-xr-x 1 pi pi   117 Apr 28 14:32 SECURITY.md
drwxr-xr-x 2 pi pi  4096 Apr 28 14:32 src

If it does not return a similar output then you may have cloned the repository incorrectly or the repository may be corrupt. Please try cloning the repository again.

Warning

CHECK if running

ls ~/devtools_installer/bin | grep "kconfig"

returns a file named kconfiglib-XX.X.X.tar.gz where XX.X.X is the version number.

Installing dependencies

Now that you have the devtools installer repository on your machine change directory into the repository by running the following command:

cd ~/devtools_installer

First we need to install the dependencies:

sudo apt update
sudo apt install -y python3 python3-pip

Then install the required python package:

pip3 install bin/kconfiglib-14.1.0.tar.gz --break-system-packages

Warning

CHECK if menuconfig works by running:

menuconfig

If the command is not found you need to add the following line to your ~/.bashrc file:

export PATH=$PATH:~/.local/bin

Then close and reopen your terminal.

Running the devtools installer

Now run the devtools installer by running the following command:

menuconfig config

This will open a menu where you can select what software you want to install on your machine. It is in submenus so you can navigate through the menus by using the arrow keys and the enter key. The keyboard shortucts are displayed at the bottom of the screen. The default selection is to install most of the development tools that I use. It should look something like this:

menuconfig

Once your done go back to the main menu and press esc and y to save your configuration.

Warning

CHECK if running the following command:

ls .config

returns a file named .config.

Now you can run the following command to install the software you selected:

sudo python3 src/main.py

This will now install the packages you selected. Now wait for it to instal, its going to take some time.

Installing docker

To install docker run the following command:

sudo apt update
sudo apt install -y docker.io

Then you can start the docker service by running:

sudo systemctl enable docker
sudo systemctl start docker

Warning

CHECK if running the following command:

sudo docker run hello-world

returns a message saying Hello from Docker!.

Removing docker from the sudo group

To remove docker from the sudo group run the following command:

sudo usermod -aG docker $USER

If you still get:

docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

Then you need to restart your machine.

All done

You should now have all the software you need installed on your machine. If you have any issues please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment