Add basic blog setup

This commit is contained in:
Florine W. Dekker 2019-06-28 21:59:36 +02:00
parent c0722c3efc
commit c2d47e9c0a
Signed by: FWDekker
GPG Key ID: B1B567AF58D6EE0F
6 changed files with 209 additions and 0 deletions

13
_config.yml Normal file
View File

@ -0,0 +1,13 @@
title: FWDekker's blog
description: Felix W. Dekker's blog
email: felix@fwdekker.com
baseurl: test/_site/
url: https://blog.fwdekker.com/
author: Felix W. Dekker
author_home: https://fwdekker.com/
license_name: MIT License
license_url: https://git.fwdekker.com/FWDekker/blog/src/branch/master/LICENSE
svn_name: git
svn_url: https://git.fwdekker.com/FWDekker/blog/

63
_layouts/default.html Normal file
View File

@ -0,0 +1,63 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="author" content="{{ site.author }}" />
<meta name="application-name" content="{{ site.title }}" />
<meta name="description" content="{{ site.description }}" />
<meta name="theme-color" content="#0033cc" />
<title>{% if page.title %}{{ page.title }}{% else %}Blog{% endif %} | FWDekker</title>
<link rel="shortcut icon" type="image/png" href="https://fwdekker.com/favicon.png"/>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300italic,700,700italic"
crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
integrity="sha256-l85OmPOjvil/SOvVt3HnSSjzF1TUMyT9eV0c2BzEGzU=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.3.0/milligram.min.css"
integrity="sha256-Ro/wP8uUi8LR71kwIdilf78atpu8bTEwrK5ZotZo+Zc=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://static.fwdekker.com/css/milligram-common.css" crossorigin="anonymous" />
<style>
p {
text-align: justify;
text-justify: inter-word;
}
</style>
</head>
<body>
<main class="wrapper">
<!-- Header -->
<header class="header">
<section class="container">
<h1><a href="{{ site.url }}{{ site.baseurl }}">{{ site.title }}</a></h1>
{% if page.title %}
<h2 style="display: inline;">{{ page.title }}</h2>&nbsp;
{% if page.date %}<u>{{ page.date | date: "%Y-%m-%d" }}</u>{% endif %}
{% endif %}
</section>
</header>
<!-- Contents -->
<section class="container">
{{ content }}
</section>
<!-- Footer -->
{% if site.author or site.license or site.git %}
<footer class="footer">
<section class="container">
{% if site.author %}Made by {% if site.author_home %}<a href="{{ site.author_home }}">{% endif %}{{ site.author }}{% if site.author_home %}</a>{% endif %}.{% endif %}
{% if site.license_name %}Licensed under the
{% if site.license_url %}<a href="{{ site.license_url }}">{% endif %}{{ site.license_name }}{% if site.license_url %}</a>{% endif %}.{% endif %}
{% if site.svn_name %}Source code available on {% if site.svn_url %}<a href="{{ site.svn_url }}">{% endif %}{{ site.svn_name }}{% if site.svn_url %}</a>{% endif %}.{% endif %}
</section>
</footer>
{% endif %}
</main>
</body>
</html>

17
_layouts/home.html Normal file
View File

@ -0,0 +1,17 @@
---
layout: default
---
{% for post in site.posts %}
<div class="row">
<div class="column">
<h2 style="display: inline;"><a href="{{ post.url | relative_url }}">{{ post.title }}</a></h2>&nbsp;
{% if post.date %}<u>{{ post.date | date: "%Y-%m-%d" }}</u>{% endif %}
{% if post.excerpt %}
{{ post.excerpt }}
<p><a href="{{ post.url | relative_url }}"><button class="button-outline">read more</button></a></p>
{% endif %}
</div>
</div>
{% endfor %}

9
_layouts/post.html Normal file
View File

@ -0,0 +1,9 @@
---
layout: default
---
<div class="row">
<div class="column">
{{ content }}
</div>
</div>

102
_posts/2016-05-20-Raspi.md Normal file
View File

@ -0,0 +1,102 @@
---
layout: post
title: Mount a Raspi with Ubuntu
---
This post describes how to connect to your Raspberry Pi using the SSHFS (SSH File System) protocol over an Ethernet cable. This will allow you to edit files on the Raspberry Pi from a text editor in Ubuntu.
All instructions are to be executed from your computer, not from your Raspi, unless noted otherwise.
Section 1 describes the required one-time configuration. Section 2 describes how to mount the Raspi for the current session. Section 3 describes how to automount the Raspi.
----------
## 1 Installation
This section describes the instructions to be performed before trying to connect to your Raspi. You will only have to follow these instructions once.
0. Make sure SSH is enabled on your Raspi. If it isn't, follow [this guide](https://www.raspberrypi.org/documentation/remote-access/ssh/).
1. Install the necessary packages.
$ sudo apt update && sudo apt upgrade
$ sudo apt install network-manager nmap sshfs
2. Configure the packages.
1. Open the file `/etc/fuse.conf` with `sudo` in your editor of choice.
2. Remove the `#` in the line `#user_allow_other`.
3. Create a directory in which you will later mount the Raspi.
$ sudo mkdir /mnt/raspi
4. Connect to your Raspi.
1. Plug the Ethernet cable into your Raspi and into your computer.
2. Open the program **Network Connections**.
3. Find the Wired connection for your Raspi. Click **Edit**.
4. Go to the tab **IPv4 Settings**. Set the **Method** to **Shared to other computers**.
5. Save your changes, and close Network Connections.
5. Reboot your computer.
----------
## 2 Connecting
These are the instructions for connecting to your Raspi. You will have to repeat these instructions after each reboot, unless you follow the instructions in section 3.
Note that only those blocks that begin with `$` are expected input. Example output will be given directly after it in a separate code block.
1. Find the broadcast address of the Ethernet connection.
$ /sbin/ifconfig enp0s25 | grep "Bcast" | awk -F: '{print $3}' | awk '{print $1}'
<!-- -->
10.42.0.255/24
2. Use the broadcast address to find the IP address of the Raspi. Add the `/24` part to the IP address, even if it was not returned in the previous step. The last IP address displayed in the output is the address of your Raspi.
$ nmap -n -sP 10.42.0.255/24
<!-- -->
Starting Nmap 7.01 ( https://nmap.org ) at 2017-03-01 21:42 CET Nmap scan report for 10.42.0.1
Host is up (0.00036s latency).
Nmap scan report for 10.42.0.140
Host is up (0.0010s latency).
Nmap done: 256 IP addresses (2 hosts up) scanned in 2.41 seconds
3. Mount the Raspi with SSHFS. Replace the IP address in the command with the one you found in the previous step.
$ sshfs -o allow_other,default_permissions pi@10.42.0.140:/ /mnt/raspi
4. Enjoy!
### Disconnecting
To unmount the Raspi:
$ umount /mnt/raspi
If you are unable to unmount because you receive errors on input/output errors, try:
$ sudo umount -l /mnt/raspi
----------
## 3 Automounting
I would recommend trying out the instructions in section 2 before the instructions in this section. Some of the information you will gather in section 2 is necessary in this section.
Because it is possible that the IP address of the Raspi changes, you may need to reconfigure the automounting at some point.
0. Log in as root: `sudo -i`.
1. If you do not have a key pair yet, generate one. You can generate it wherever you want. If you don't know if you have a key pair, enter this command anyway and it will warn you that you have on already.
$ ssh-keygen -t rsa
2. Copy the public key of the Raspi to the key pair. Replace the IP in the command with the one you found in part 2.
$ ssh-copy-id pi@10.42.0.140
3. Verify that you do not need to enter your password when you use `ssh pi@10.42.0.140`.
4. Open the file `/etc/fstab` in your editor of choice.
5. Add the following to the bottom of the file (this is **one** line):
pi@10.42.0.140:/ /mnt/raspi fuse.sshfs allow_other,_netdev
If you decided in step 1 not to save the key pair in the default location, add `,IdentityFile=<file to key pair>` at the end of the line.
7. Reboot your computer to verify that this works as intended. Note that using `sudo mount -a` is **not** the same as rebooting.

5
index.md Normal file
View File

@ -0,0 +1,5 @@
---
layout: home
---
...