Raspberry PI - building a build server for tech NoSaM - Part 0

vaughan mason - 2021-05-15

So now that we have choosen the tech we need to speak about setting it up. So I will be using a Raspberry PI to host Jekyll and will be utilising it like a build server, you can think of the Raspberry PI as Virtual Machine running Linux in a cloud provider. So theoritically anything I do in the Raspberry Pi I can do on a VM.

Raspberry Pi - Setting it up

So you need a Raspberry PI, I’m running a Raspberry Pi 3 Model B Rev 1.2

rasppi3

Get one

Use the following script to get hardware information on your Pi, getting ahead of myself.

1
 cat /proc/cpuinfo

So you need an imager to load the Operating System(OS) onto the SD card that is used by the Pi, I used the Raspberry Pi Imager. Be sure to get the latest version as it comes with some great features and saves a lot of set up time. As you can see here you can now set up the hostname, ssh, change the default password, configure wifi. All of this saves you a ton of set up time later on (To be honest, I used an old version of the imager and then was kicking myself after reading all this information).

Once you have done this you should be able to plug in you SD card into the Pi, give it some power and you are ready to go connected to your network.

Raspberry Pi - Let’s Secure it

As you will have a device that may or may not be communicating outside your network, depending on your usage. You need to secure it. That’s where NetworkChuck comes in and this great YouTube video on 5 Steps to Secure Linux, as I mentioned earlier your Raspberry Pi runs Linux you can follow all of these steps. The 3 steps that I enabled are

  1. Limited User Access
  2. Passwords are for suckers
  3. Lockdown Logins (harden SSH)

Password are for suckers

Create a authentication key pair. Some additional information can be found here

1
2
mkdir ~/.ssh
chmod 700 ~/.ssh
1
2
ssh-keygen -b 2048

1
ssh-copy-id -i <key> <user>@<server>

NetworkChuck has a lot of great videos and is a must if you want to learn a little bit more about security and networking.

Raspberry Pi - Start working on the Pi

So as I mentioned in a future past post I will be using Visual Studio Code IDE to write the blog post and to interact with the raspberry pi. One of the reason was because of the support of remote development on the raspberry pi, you are able to edit files directly (like I’m doing for this file), you can access the terminal to run commands and a bonus you can you can use SSH key-based authenication. Here is an article about remote development with a raspberry pi and vs code, Coding on Raspberry Pi remotely with Visual Studio Code

If you want to run VS Code on the raspberry pi, you can do that as well: Visual Studio Code comes to Raspberry Pi

Just to be clear I’m fully aware of all the noise associated with VS Code and Raspberry Pi, I just don’t care as I am happy to use the IDE.

More information on VS Code Remote Development

And we are ready to write some blog posts and edit some code

One thing I am going to do in a few months, is that I’m going to get myself one of these Raspberry Pi 4 Model B 8GB and then use it as a development machine.

raspberrypi

This page was last updated at 2021-07-13

If you don't agree with the content on this page, please click here