moved over the last blogs, also changed the styling of lists

This commit is contained in:
Rick van Lieshout 2022-09-25 23:25:23 +02:00
parent 9059befae3
commit 619758c175
16 changed files with 309 additions and 9 deletions

View File

@ -10,7 +10,6 @@ This is the repository for my personal blog/website [rickvanlieshout.com](https:
- migrate resume - migrate resume
- migrate projects - migrate projects
- migrate blogs
<!-- optional stuff --> <!-- optional stuff -->

View File

@ -0,0 +1,32 @@
---
title: "My brand new blog"
date: "2014-09-05"
template: "post"
category: "blog"
tags:
- "blog"
description: "Starting a new blog... again... without wordpress but in English ;)"
disqusId: "1"
---
Hey all and welcome to my new blog!
A couple of questions pop-up right away I'm sure. So let's get those out of the way right now!
## English?!? Is this a joke?
Nope, I have decided to blog in English for a couple of reasons.
- It will be easier for me to write articles.
- I get to share my posts with a couple of non-Dutch friends.
## Why did you start over **again**?
Yeah, I know.... This is like the fourth time I start over isn't it? Well let me give you some reasons for switching:
- Control. I now have full control over how the page looks and performs.
- No more Wordpress!!! Many of you will know I have a love/hate relationship with Wordpress. But in the end, the hate won over the love. I am just fed up with the entire system and its problems.
- Because I wanted to convert to English. And why not convert platform at the same time?
## So what can we expect?
I'll be doing a lot more technical blogs. (up next: raspberry pi cluster) I also plan on doing some code examples and general rambling. So pretty much the same as any other blog.

View File

@ -0,0 +1,43 @@
---
title: "Raspberry pi cluster Step 1: Shopping"
date: "2014-09-05"
template: "post"
category: "Homelab"
tags:
- "raspberry"
- "cluster"
- "pi"
description: "Ordering the parts for a nice little pi cluster"
disqusId: "2"
---
## So, A raspberry pi cluster. What is it and what does it do?
Well, a raspberry pi is a small $35 dollar Linux computer with an SD card as a hard drive and an USB cable as it's power source. While they are only $35, they perform really well!
A cluster is basically a group of computers that work together to run a very intensive program. Say for example you needed to calculate 1000 things with a single raspberry pi and every calculation takes 1 second. That would be 1000 seconds! Now if you add a second raspberry pi and you have them share the load they will be twice as fast! Imagine running 4 of them, that would cut it down to 250 seconds! Well that's exactly what I plan on doing
## What software are you going to use?
I am going to use [raspbian](http://www.raspbian.org/) for the OS and I will be using python (and [mpi4py](http://mpi4py.scipy.org/)) to program the cluster.
## What did you need and how much did it cost
Below you will find a list of items you would need if you were to build a 4 pi cluster from scratch. Prices are in Euro's because that's what I pay with (I know, crazy right?)
- 4 raspberry pis ( €131.80 )
- 4 ethernet cables ( €3.40 )
- 4 USB power cables ( €7.20 )
- 4 sd cards ( €12.72 )
- 4 raspberry pi cases ( €11.72 )
- An Ethernet hub ( €10.95 )
- An USB hub ( €2.64 )
This all adds up to ( €180.43 which is $233.76 according to [google](https://www.google.nl/search?site=&source=hp&q=180.43+euro+to+dollar&oq=180.43+euro+to+dollar&gs_l=hp.3..33i21l2.879.5191.0.5287.28.24.3.1.1.0.157.1273.22j1.23.0....0...1c.1.53.hp..9.19.917.0.jex09uDmbow))
I ordered **some** of the stuff from a shop in china called "[banggood](http://banggood.com)". Since they deliver all around the world I will add the links to those items below.
- The raspberry pi cases can be found [here](http://www.banggood.com/Transparent-Box-Case-Shell-For-Raspberry-Pi-512MB-Version-p-923015.html)
- The 8gb SD cards can be found [here](http://www.banggood.com/8GB-SD-HC-SDHC-Flash-Secure-Digital-Memory-Card-Camera-p-938458.html)
- The USB hub can be found [here](http://www.banggood.com/Wholesale-Laptop-PC-New-Black-4-Port-Tap-USB-2_0-High-Speed-Hub-ON-Or-OFF-Sharing-Switch-p-45306.html)
- The USB power cables can be found [here](http://www.banggood.com/Retractable-Micro-USB-Data-Sync-Charger-Cable-For-Cellphones-p-90245.html)

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 605 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 KiB

View File

@ -0,0 +1,40 @@
---
title: "Raspberry pi cluster Step 2: Assembling the hardware"
date: "2014-09-10"
template: "post"
category: "Homelab"
tags:
- "raspberry"
- "cluster"
- "pi"
description: "Assembling all the parts and creating a cute little cluster"
disqusId: "3"
---
So today I finally received the required parts to finish up my Raspberry pi cluster and I was **extremely** excited! To share this excitement with you lot here's a picture of all the parts I'll be using:
![picture of all the parts spread on the mat](./media/pi_overview_full.JPG "all the bits!")
I began by building the Raspberry pi "tower", sadly I forgot to take a picture with the DSLR so I only have this one cell image to show you guys:
![2 raspberry pis stacked in their cases](./media/sneakpeek2.jpg "rising up!")
On the picture above you can clearly see how the "tower" is being assembled.
I'm basically using the stand-offs that come included to mount the pi to the bottom plates and then instead of attaching a top plate I attach a bottom plate again. I did have to customize the plates a bit to prevent the pi's from overheating (because there now is pretty much no room between a pi and the top plate).
After mounting all 4, the "tower" now looks like this: (oh, I also added SD cards)
![a picture of the front, back and side of the tower of pis](./media/pi_sides_prev.jpg "Assembled tower of pis")
Then I attempted to glue the tower to my switch.... Some complications came up though. First I glued my knife to my finger and then my finger to another finger. Once I had successfully managed to glue the tower onto the switch I needed something to apply pressure to let the glue dry. Since I didn't have anything heavy handy I had to improvise. And so I did, in true nerd style:
![a mini laptop on top of the cluster to keep some pressure on it](./media//improvising.jpg "balancing a weight.... a netbook")
Yes, those are 2 packs of cards (which weren't heavy enough) and an old netbook.
I went to have dinner while I let the glue dry and when I returned everything was all glued firmly into place.
After adding the cables and the usb switch I am left with my beautiful raspberry pi cluster:
![front and back of the cluster, all cabled up](./media/pi_front_back_prev.jpg "looking great!")
In my next blog post, I will cover how to install raspbian on a raspberry pi in general and how I plan on cloning the install across all pi's

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

View File

@ -0,0 +1,80 @@
---
title: "Raspberry pi cluster Step 3: Installing the OS"
date: "2014-09-14"
template: "post"
category: "Homelab"
tags:
- "raspberry"
- "cluster"
- "pi"
description: "Installing the raspberry pi OS (Raspbian) and prepping for a cluster"
disqusId: "4"
---
Installing an OS for a Raspberry pi is quite different from installing an OS on any other computer. We will have to write an "image" to the SD card rather than actually "installing" anything. Don't worry if you're confused just now, even I don't know what I'm rambling on about at times!
### Linux
First off, if you want to use Windows, skip this bit by clicking [here.](#windows)
First we will have to download the .img from the Raspbian website, we can do so by clicking [here](http://downloads.raspberrypi.org/raspbian_latest). After downloading the image we can use a kernel application known as "dd" to write the file to our SD card. We will first need to find out which /dev/ the SD card is currently using. To do this we can use the following command:
```bash
lsblk
```
This will show us a list of all the connected volumes. You should be able to determine which of the entries is your SD card by looking at the size of each entry. If you are not able to determine which one you need based on the size of the entry however, you can try removing the sd card and re-running the command. The entry that disappears is the SD card.
As you can see below, /dev/sde is my SD card
```bash
NAME MAJ:MIN RM SIZE
sda 8:0 0 119.2G
├─sda1 8:1 0 243M
├─sda2 8:2 0 7.5G
└─sda3 8:3 0 111.6G
sdb 8:16 0 111.8G
└─sdb1 8:17 0 111.8G
sdc 8:32 0 111.8G
├─sdc1 8:33 0 350M
└─sdc2 8:34 0 111.5G
sde 8:64 1 7.5G
└─sde1 8:65 1 7.5G
```
Now that we know both the input path (the downloaded iso's location) and the output path (the /dev/sd\* device) we can assemble our dd command as follows:
```bash
dd if=/path/to/iso of=/path/to/sd/card
```
When you execute the dd command the terminal will appear "busy" for the duration of the write. You can either wait patiently until it's done or check up on its status by entering the command:
```bash
sudo kill -USR1 `pidof dd`
```
### Windows
If you ended up here you have chosen to use the much inferior Windows to get Linux on your Raspberry pi's. Don't worry though, you can still install the, much superior, Linux images to your SD cards.
The very first thing we have to do is download the Raspbian image, which we can do by clicking [here](http://downloads.raspberrypi.org/raspbian_latest). After downloading the image we will have to download some software to write the image to the SD card. The tool we are going to use is called win32DiskImager, and can be downloaded free of charge [right here.](http://downloads.sourceforge.net/project/win32diskimager/Archive/Win32DiskImager-0.9.5-install.exe?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fwin32diskimager%2F&ts=1410459796&use_mirror=cznic)
After the tool has been downloaded (and installed) we have to start it by double clicking on the .exe file, which will leave us staring at the following tool:
![Picture of win32diskimager with numbers on the input fields](./media/windows.jpg "win32diskimage")
Using the image above as a reference:
1. This is where you have to specify the image location (you can hit the blue box to select a location)
2. Here you will have to specify which device you want to write to.
After keying in the right values you can hit "write" and wait for the "install" to finish.
## First boot
Once you boot up the pi you will get a settings screen, you can go through it if you wish. (change password and so on) If you want to start the GUI you can type:
```bash
startx
```

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

View File

@ -0,0 +1,102 @@
---
title: "Raspberry pi cluster Step 4: Setting up the master node"
date: "2014-09-17"
template: "post"
category: "Homelab"
tags:
- "raspberry"
- "cluster"
- "pi"
description: "We're going to set up the master node. The master node will be the one that gives work orders to the slaves."
disqusId: "5"
---
After installing raspbian to the sd card it's time to plug in that SD card and fire up the Raspberry pi. If everything went well you should end up with a screen similar to mine:
![ncurses based interface that starts after boot that allows you to configure several Raspberry pi settings](./media/pi1-prev.jpg "raspi-config boot screen")
The first thing you should do is select the "Expand Filesystem" option, this will make sure the OS can access the entire SD card. After doing that you might want to change the user password (user = pi). The last thing you want to do is hidden in the "Advanced options", after going there you should see:
![ncurses based interface with the menu options of the 'expand filesystem' option](./media/pi2-prev.jpg "expand filesystem menu options")
In here, select the "A2 Hostname" option and rename it to something better. (I appended a 0, indicating this would be the master pi)
After doing all this hit finish, reboot the pi, and log back into the shell. (default user = pi pass= raspberry) The first thing we are going to do is update the pi, in case any updates have come out since the image was uploaded to raspbian.net. We can update the pi by running the following commands:
```bash
sudo apt-get update && sudo apt-get upgrade
```
After updating the pi we need to give the pi a static ip address (so we can find it later). We can do this by following a couple of steps:
1. sudo nano /etc/network/interfaces
2. replace `iface eth0 inet dhcp` with `iface eth0 inet static`
3. Directly underneath add the following lines: (remember to change info if required)
```bash
address 192.168.1.11
netmask 255.255.255.0
network 192.168.1.1
broadcast 192.168.1.255
gateway 192.168.1.1
```
4. Hit ctrl + x to close nano and hit y to save the changes.
5. reboot the pi
After that we have to install some required software, we can do so with the following command:
```bash
sudo apt-get install gfortran
```
After installing some of the required software we still have to install "mpich3", do so by running the following commands:
```bash
mkdir /home/pi/mpich3
cd mpich3
wget http://www.mpich.org/static/downloads/3.0.4/mpich-3.0.4.tar.gz
tar xzf mpich-3.0.4.tar.gz
sudo mkdir -p /home/rpimpi/mpich3-install
sudo mkdir -p /home/pi/mpich_build
cd /home/pi/mpich_build
sudo /home/pi/mpich3/mpich-3.0.4/configure -prefix=/home/rpimpi/mpich3-install
sudo make && sudo make install
```
After installing mpich3 we need to edit a file. Execute the following command:
```bash
sudo nano /home/pi/.profile
```
Scroll down all the way and add the following text:
```bash
PATH="$PATH:/home/rpimpi/mpich3-install/bin"
```
After adding that line hit ctrl + x and save your work. Then either restart the shell or reboot the pi.
After you have rebooted the pi you have to create a so-called "machine file", we will store this file in the folder "mpi_scripts" in our home directory. To do this execute the following commands:
```bash
mkdir ~/mpi_scripts
cd ~/mpi_scripts
echo `/sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}'` > machinefile
```
The last command creates the machinefile and populates it with the ip of this (master) node automatically. With all of this setup we can do our first real test with the mpi commands, so try out the following command:
```bash
mpiexec -f machinefile -n 1 hostname
```
The -f is the filename parameter (so you would type the machinefile path behind that).
The -n is the number of nodes we want to use (we are working from 1 now). And finally "hostname" is the command.
if all went well you should now see the hostname of the raspberry pi (for me: raspberrypi0). After this we are done setting up the master (for now) and can begin copying the SD card. To shutdown the pi you can execute the following command:
```bash
sudo shutdown -h now
```

View File

@ -8,10 +8,10 @@
@media print { @media print {
.hideInPrintView { .hideInPrintView {
display:none; display: none;
} }
.showInPrintView { .showInPrintView {
display: initial; display: initial;
} }
} }

View File

@ -125,6 +125,15 @@ p {
@include margin-bottom(1); @include margin-bottom(1);
} }
ol,
ul {
padding-left: 5rem;
p {
margin: 0 !important;
}
}
blockquote { blockquote {
border-color: #d9d9d9; border-color: #d9d9d9;
border-style: solid; border-style: solid;
@ -168,11 +177,6 @@ figcaption {
text-align: center; text-align: center;
} }
ol,
ul {
padding-left: 5rem;
}
table { table {
// border: 1px solid $color-base; // border: 1px solid $color-base;
@ -210,4 +214,4 @@ table {
.float-left { .float-left {
float: left; float: left;
} }
} }