diff --git a/.eleventy.js b/.eleventy.js new file mode 100644 index 0000000..0589038 --- /dev/null +++ b/.eleventy.js @@ -0,0 +1,13 @@ +module.exports = (eleventyConfig) => { + eleventyConfig.addFilter("isoDate", dateObj => { + return dateObj.toISOString().substr(0, 10); + }); + + return { + pathPrefix: "/blog/", + dir: { + input: "src/main/", + output: "dist", + } + }; +}; diff --git a/.gitignore b/.gitignore index 2ca8682..e7ea1e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,117 @@ -_site/ -.sass-cache/ -.jekyll-cache/ -.jekyll-metadata +## Node +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 + +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.pnp.* diff --git a/_config.yml b/_config.yml deleted file mode 100644 index bc17499..0000000 --- a/_config.yml +++ /dev/null @@ -1,13 +0,0 @@ -title: FWDekker's blog -description: Felix W. Dekker's blog -email: felix@fwdekker.com -baseurl: -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/ diff --git a/_layouts/home.html b/_layouts/home.html deleted file mode 100644 index a6ebc28..0000000 --- a/_layouts/home.html +++ /dev/null @@ -1,17 +0,0 @@ ---- -layout: default ---- - -{% for post in site.posts %} -
-
-

{{ post.title }}

  - {% if post.date %}{{ post.date | date: "%Y-%m-%d" }}{% endif %} - {% if post.excerpt %} - {{ post.excerpt }} - -

- {% endif %} -
-
-{% endfor %} diff --git a/_posts/2016-05-20-Raspi.md b/_posts/2016-05-20-Raspi.md deleted file mode 100644 index e4db16c..0000000 --- a/_posts/2016-05-20-Raspi.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -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=` 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. diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..1a73252 Binary files /dev/null and b/package-lock.json differ diff --git a/package.json b/package.json new file mode 100644 index 0000000..01957ad --- /dev/null +++ b/package.json @@ -0,0 +1,20 @@ +{ + "name": "blog", + "version": "1.1.1", + "description": "Felix W. Dekker's personal blog.", + "author": "Felix W. Dekker", + "browser": "dist/bundle.js", + "repository": { + "type": "git", + "url": "git@git.fwdekker.com:FWDekker/blog.git" + }, + "private": true, + "scripts": { + "build": "npx @11ty/eleventy", + "build:server": "npx @11ty/eleventy --serve" + }, + "dependencies": { + "@fwdekker/template": "^0.0.13", + "@11ty/eleventy": "^0.10.0" + } +} diff --git a/src/main/_data/site.json b/src/main/_data/site.json new file mode 100644 index 0000000..cd5dfcc --- /dev/null +++ b/src/main/_data/site.json @@ -0,0 +1,11 @@ +{ + "url": "https://fwdekker.com/blog/", + "title": "FWDekker's blog", + "description": "Felix W. Dekker's blog", + "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/" +} diff --git a/_layouts/default.html b/src/main/_includes/default.njk similarity index 51% rename from _layouts/default.html rename to src/main/_includes/default.njk index b42c236..5a391f6 100644 --- a/_layouts/default.html +++ b/src/main/_includes/default.njk @@ -23,41 +23,33 @@ text-align: justify; text-justify: inter-word; } + ol { + list-style: decimal outside; + } -
- -
-
-

{{ site.title }}

- {% if page.title %} -

{{ page.title }}

  - {% if page.date %}{{ page.date | date: "%Y-%m-%d" }}{% endif %} - {% endif %} -
-
- - - +
+ +
- {{ content }} + {% if title %} +

{{ site.title }}

+ {% else %} +

{{ site.title }}

+ {% endif %} + + {% if title %} +

{{ title }}

  + {% if date %}{{ date | isoDate }}{% endif %} + {% endif %}
+
- - - {% if site.author or site.license or site.git %} - - {% endif %} -
+ +
+ {{ content | safe }} +
+
diff --git a/src/main/_includes/home.njk b/src/main/_includes/home.njk new file mode 100644 index 0000000..29849a1 --- /dev/null +++ b/src/main/_includes/home.njk @@ -0,0 +1,17 @@ +--- +layout: default +--- + +{% for post in collections.all %} +
+
+ {% if post %} +

{{ post.data.title }}

  + {% if post.data.date %}{{ post.data.date | isoDate }}{% endif %} + {% if post.data.excerpt %} +

{{ post.data.excerpt }}

+ {% endif %} + {% endif %} +
+
+{% endfor %} diff --git a/_layouts/post.html b/src/main/_includes/post.njk similarity index 74% rename from _layouts/post.html rename to src/main/_includes/post.njk index 45c3470..81b66bf 100644 --- a/_layouts/post.html +++ b/src/main/_includes/post.njk @@ -4,6 +4,6 @@ layout: default
- {{ content }} + {{ content | safe }}
diff --git a/src/main/_posts/2017-03-01-raspi.md b/src/main/_posts/2017-03-01-raspi.md new file mode 100644 index 0000000..87a1b2e --- /dev/null +++ b/src/main/_posts/2017-03-01-raspi.md @@ -0,0 +1,117 @@ +--- +title: Mount a Raspi with Ubuntu +layout: post +date: 2017-03-01 +permalink: mount-a-raspi-with-ubuntu/ +excerpt: How to connect to your Raspberry Pi over an Ethernet cable. +--- + +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. + +0. 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 + +1. 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 during 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 + +2. 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 + +3. 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 Auto-mounting +I would recommend trying out the instructions in Section 2 before the instructions in this section. +Some 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 auto-mounting 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=` + 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. diff --git a/index.md b/src/main/index.md similarity index 100% rename from index.md rename to src/main/index.md