From d0fb062913bcc0ad0769ee58675a0c6a2877b60a Mon Sep 17 00:00:00 2001 From: Michele Cereda Date: Sat, 25 Mar 2023 20:33:56 +0100 Subject: [PATCH] chore: improved markdown article and syntax --- knowledge base/boinc.md | 2 +- knowledge base/chezmoi.md | 2 +- knowledge base/conventional commits.md | 2 +- knowledge base/crontab.md | 2 +- knowledge base/curl.md | 2 +- ...tract attachments from multipart emails.md | 2 +- knowledge base/fstab.md | 2 +- knowledge base/git.md | 48 +++++++++---------- knowledge base/google search.md | 10 ++-- knowledge base/gpg.md | 4 +- knowledge base/markdown.md | 27 +++++++++++ knowledge base/needs-restarting.md | 2 +- knowledge base/netrc.md | 4 +- knowledge base/openssl.md | 2 +- knowledge base/rsync.md | 2 +- knowledge base/ssh.md | 4 +- knowledge base/sysstat.md | 2 +- knowledge base/template.md | 4 ++ knowledge base/terraform.md | 4 +- knowledge base/turris.md | 6 +-- knowledge base/vim.md | 2 +- 21 files changed, 83 insertions(+), 52 deletions(-) diff --git a/knowledge base/boinc.md b/knowledge base/boinc.md index 58055c2..28a70a3 100644 --- a/knowledge base/boinc.md +++ b/knowledge base/boinc.md @@ -82,7 +82,7 @@ sudo amdgpu-install At the next restart of the boinc-client, something similar to this line should appear in the client's logs: -```text +```txt Oct 09 23:09:40 hostnameHere boinc[1709]: 09-Oct-2022 23:09:40 [---] OpenCL: AMD/ATI GPU 0: gfx90c:xnack- (driver version 3452.0 (HSA1.1,LC), device ve> ``` diff --git a/knowledge base/chezmoi.md b/knowledge base/chezmoi.md index f64a4cf..3b9b416 100644 --- a/knowledge base/chezmoi.md +++ b/knowledge base/chezmoi.md @@ -70,7 +70,7 @@ $ normallookingcustomfield = "normalLookingValue" ``` - ```plaintext + ```txt map[awesomecustomfield:my Awesome custom Value chezmoi:… normallookingcustomfield:normalLookingValue] ``` diff --git a/knowledge base/conventional commits.md b/knowledge base/conventional commits.md index 067eaaa..5e2b641 100644 --- a/knowledge base/conventional commits.md +++ b/knowledge base/conventional commits.md @@ -12,7 +12,7 @@ It provides an easy set of rules for creating an explicit commit history. A commit message should be structured as follows: -```text +```txt [optional scope]: [optional body] diff --git a/knowledge base/crontab.md b/knowledge base/crontab.md index 7e4176b..fb46c36 100644 --- a/knowledge base/crontab.md +++ b/knowledge base/crontab.md @@ -20,7 +20,7 @@ crontab -r sudo crontab -r -u other_user ``` -```text +```txt # Run 'pwd' every day at 10PM. 0 22 * * * pwd diff --git a/knowledge base/curl.md b/knowledge base/curl.md index ce6ea55..511b02b 100644 --- a/knowledge base/curl.md +++ b/knowledge base/curl.md @@ -84,7 +84,7 @@ On Non-Windows hosts, `curl` uses `getpwuid` to find the user's home directory. On Windows, if curl finds no `.curlrc` file in the sequence described above, it will check for one in the same dir the curl executable is placed. -```text +```txt # ~/.curlrc # Accepts both short and long options. # Options in long format are accepted without the leading two dashes to make it diff --git a/knowledge base/extract attachments from multipart emails.md b/knowledge base/extract attachments from multipart emails.md index cee51a6..1073b4a 100644 --- a/knowledge base/extract attachments from multipart emails.md +++ b/knowledge base/extract attachments from multipart emails.md @@ -3,7 +3,7 @@ When saved as plain text, emails may be saved as S/MIME files with attachments. In such cases the text file itself contains the multipart message body of the email, so the attachments are provided as base64 streams: -```text +```txt 1 --------------060903090608060502040600 2 Content-Type: application/x-gzip; 3 name="myawesomefile.tar.gz" diff --git a/knowledge base/fstab.md b/knowledge base/fstab.md index 32d1798..c8061a2 100644 --- a/knowledge base/fstab.md +++ b/knowledge base/fstab.md @@ -2,7 +2,7 @@ ## TL;DR -```text +```txt # by label # e2label /dev/sdc1 # mount -L seagate_2tb_usb /media/usb diff --git a/knowledge base/git.md b/knowledge base/git.md index d3c7b0c..8d83115 100644 --- a/knowledge base/git.md +++ b/knowledge base/git.md @@ -1,33 +1,33 @@ # Git 1. [TL;DR](#tldr) -2. [Authentication](#authentication) -3. [Configuration](#configuration) +1. [Authentication](#authentication) +1. [Configuration](#configuration) 1. [Remotes](#remotes) 1. [Push to multiple git remotes with the one command](#push-to-multiple-git-remotes-with-the-one-command) - 2. [Aliases](#aliases) -4. [Manage changes](#manage-changes) + 1. [Aliases](#aliases) +1. [Manage changes](#manage-changes) 1. [Create a patch](#create-a-patch) - 2. [Apply a patch](#apply-a-patch) -5. [The stash stack](#the-stash-stack) -6. [Branches](#branches) + 1. [Apply a patch](#apply-a-patch) +1. [The stash stack](#the-stash-stack) +1. [Branches](#branches) 1. [Checkout an existing remote branch](#checkout-an-existing-remote-branch) - 2. [Delete a branch](#delete-a-branch) - 3. [Delete branches which have been merged or are otherwise absent from a remote.](#delete-branches-which-have-been-merged-or-are-otherwise-absent-from-a-remote) - 4. [Merge the master branch into a feature branch](#merge-the-master-branch-into-a-feature-branch) - 5. [Rebase a branch on top of another](#rebase-a-branch-on-top-of-another) -7. [Tags](#tags) -8. [Convert a normal repository to a bare one](#convert-a-normal-repository-to-a-bare-one) -9. [LFS extension](#lfs-extension) -10. [Submodules](#submodules) -11. [Remove a file from a commit](#remove-a-file-from-a-commit) -12. [Remove a file from the repository](#remove-a-file-from-the-repository) -13. [Troubleshooting](#troubleshooting) + 1. [Delete a branch](#delete-a-branch) + 1. [Delete branches which have been merged or are otherwise absent from a remote.](#delete-branches-which-have-been-merged-or-are-otherwise-absent-from-a-remote) + 1. [Merge the master branch into a feature branch](#merge-the-master-branch-into-a-feature-branch) + 1. [Rebase a branch on top of another](#rebase-a-branch-on-top-of-another) +1. [Tags](#tags) +1. [Convert a normal repository to a bare one](#convert-a-normal-repository-to-a-bare-one) +1. [LFS extension](#lfs-extension) +1. [Submodules](#submodules) +1. [Remove a file from a commit](#remove-a-file-from-a-commit) +1. [Remove a file from the repository](#remove-a-file-from-the-repository) +1. [Troubleshooting](#troubleshooting) 1. [Debug](#debug) - 2. [GPG cannot sign a commit](#gpg-cannot-sign-a-commit) - 3. [Git does not accept self-signed certificates](#git-does-not-accept-self-signed-certificates) -14. [Further readings](#further-readings) -15. [Sources](#sources) + 1. [GPG cannot sign a commit](#gpg-cannot-sign-a-commit) + 1. [Git does not accept self-signed certificates](#git-does-not-accept-self-signed-certificates) +1. [Further readings](#further-readings) +1. [Sources](#sources) ## TL;DR @@ -418,7 +418,7 @@ git remote set-url --push --add origin https://exampleuser@example.com/path/to/r git remote set-url --push --add origin https://exampleuser@example.com/path/to/repo3 ``` -```plaintext +```txt [remote "origin"] url = https://exampleuser@example.com/path/to/repo1 pushUrl = https://exampleuser@example.com/path/to/repo1 @@ -429,7 +429,7 @@ git remote set-url --push --add origin https://exampleuser@example.com/path/to/r To only pull from `repo1` but push to `repo1` and `repo2` for a specific branch `specialBranch`: -```plaintext +```txt [remote "origin"] url = ssh://git@aaa.xxx.com:7999/yyy/repo1.git fetch = +refs/heads/*:refs/remotes/origin/* diff --git a/knowledge base/google search.md b/knowledge base/google search.md index 6de367a..6b480a2 100644 --- a/knowledge base/google search.md +++ b/knowledge base/google search.md @@ -4,31 +4,31 @@ - find an **exact phrase** enclosing it in _quotation marks_ (`""`); it will give back only results that include those same words in that same order: - ```plaintext + ```txt mama "i just killed a man" ``` - **exclude a word** from a search preceding it with a _minus sign_ (`-`); it will filter out unwanted results: - ```plaintext + ```txt how to scrub -tips ``` - find results that **include all of the words in a phrase** using the _asterisk symbol_ (`*`); it will give back results that include a specific phrase but may also have other words: - ```plaintext + ```txt how to clean * from sheets ``` - get results **from a particular website only** using the `site:` operator: - ```plaintext + ```txt site:wikipedia.org obama ``` use the operator alone to determine whether Google has indexed a website: - ```plaintext + ```txt site:heyitsa.me ``` diff --git a/knowledge base/gpg.md b/knowledge base/gpg.md index e8c39c9..f62d31e 100644 --- a/knowledge base/gpg.md +++ b/knowledge base/gpg.md @@ -190,7 +190,7 @@ gpg> quit One can put comments in an armored ASCII message or key block using the `Comment` keyword for each line: -```text +```txt -----BEGIN PGP MESSAGE----- Comment: … Comment: … @@ -327,7 +327,7 @@ Run `ssh-add -L` to list your public keys and copy them over manually to the rem - `git` is instructed to sign a commit with `gpg` - `git commit` fails with the following error: - > ```plaintext + > ```txt > gpg failed to sign the data > fatal: failed to write commit object > ``` diff --git a/knowledge base/markdown.md b/knowledge base/markdown.md index c7bfa99..f09b1be 100644 --- a/knowledge base/markdown.md +++ b/knowledge base/markdown.md @@ -1,5 +1,14 @@ # Markdown +ReadMe's Markdown engine. + +## Table of contents + +1. [Troubleshooting](#troubleshooting) + 1. [Escape the backtick character](#escape-the-backtick-character) +1. [Further readings](#further-readings) +1. [Sources](#sources) + ## Troubleshooting ### Escape the backtick character @@ -11,8 +20,26 @@ Render it in an inline code block using double backticks instead of single backt Alternatively, use a code block. This will wrap everything in a `
` HTML tag.  
 To do this, either indent 4 spaces to start a code block, or use fenced code blocks if supported.
 
+## Further readings
+
+- Official [documentation]
+- [Linguist supported language syntax list]
+
 ## Sources
 
+All the references in the [further readings] section, plus the following:
+
+- [Escaping Backticks]
 - [Escaping backtick in Markdown]
 
+
+
+
+
+[documentation]: https://docs.readme.com/rdmd/docs
+
+
+
 [escaping backtick in markdown]: https://www.growingwiththeweb.com/2015/06/escaping-backtick-in-markdown.html
+[escaping backticks]: https://www.markdownguide.org/basic-syntax/#escaping-backticks
+[linguist supported language syntax list]: https://github.com/github/linguist/blob/master/lib/linguist/languages.yml
diff --git a/knowledge base/needs-restarting.md b/knowledge base/needs-restarting.md
index e704904..2875714 100644
--- a/knowledge base/needs-restarting.md	
+++ b/knowledge base/needs-restarting.md	
@@ -16,7 +16,7 @@ sudo needs-restarting -r
 sudo needs-restarting -s
 ```
 
-```text
+```txt
 $ sudo needs-restarting
 The following running processes use deleted files:
 
diff --git a/knowledge base/netrc.md b/knowledge base/netrc.md
index 5dfac1a..bc678aa 100644
--- a/knowledge base/netrc.md	
+++ b/knowledge base/netrc.md	
@@ -28,12 +28,12 @@ lines:
 
 The two formats below are equivalent:
 
-```text
+```txt
 machine example.com login daniel password qwerty
 machine host1.austin.century.com login fred password bluebonnet
 ```
 
-```text
+```txt
 machine example.com
 login daniel
 password qwerty
diff --git a/knowledge base/openssl.md b/knowledge base/openssl.md
index 8369aa3..d6fc692 100644
--- a/knowledge base/openssl.md	
+++ b/knowledge base/openssl.md	
@@ -89,7 +89,7 @@ cat 'server.crt' 'intermediate1.crt' 'intermediateN.crt' 'rootca.crt'
 
 An `openssl s_client -connect` attempt fails with this error message:
 
-```plaintext
+```txt
 CONNECTED(00000003)
 depth=0 C = US, CN = server.fqdn
 verify error:num=20:unable to get local issuer certificate
diff --git a/knowledge base/rsync.md b/knowledge base/rsync.md
index 6f2787e..e686191 100644
--- a/knowledge base/rsync.md	
+++ b/knowledge base/rsync.md	
@@ -34,7 +34,7 @@ rsync … --exclude={"*.DS_Store","._*"}
 rsync … --filter "merge filter.txt"
 
 # Delete files from the source after they have been transferred.
-rsync … --remove-source-files 
+rsync … --remove-source-files
 
 # Copy local files to a folder in the user's remote home over SSH on port 1234.
 # Compress the data during transfer.
diff --git a/knowledge base/ssh.md b/knowledge base/ssh.md
index 2ab4e5d..3ff4116 100644
--- a/knowledge base/ssh.md	
+++ b/knowledge base/ssh.md	
@@ -113,7 +113,7 @@ ssh-keygen -t 'ecdsa' -b '521'
 ssh-keygen -t 'ed25519' -f '.ssh/id_ed25519' -C 'test@winzoz'
 ```
 
-```plaintext
+```txt
 Generating public/private ed25519 key pair.
 Enter passphrase (empty for no passphrase):
 Enter same passphrase again:
@@ -143,7 +143,7 @@ ssh-keygen -R '192.168.1.237' -f '.ssh/known_hosts'
 ssh-keygen -R 'raspberrypi.lan' -f '.ssh/known_hosts'
 ```
 
-```plaintext
+```txt
 Host pi4.lan found: line 5
 /home/user/.ssh/known_hosts updated.
 Original contents retained as /home/user/.ssh/known_hosts.old
diff --git a/knowledge base/sysstat.md b/knowledge base/sysstat.md
index 4922b82..27a37fc 100644
--- a/knowledge base/sysstat.md	
+++ b/knowledge base/sysstat.md	
@@ -30,7 +30,7 @@ sudo sar -P ALL
 
 Example output:
 
-```text
+```txt
 Linux 5.10.17-v8+ (raspberrypi)   07/08/21   _aarch64_   (4 CPU)
 
 10:24:12     LINUX RESTART   (4 CPU)
diff --git a/knowledge base/template.md b/knowledge base/template.md
index b88eca4..01826c7 100644
--- a/knowledge base/template.md	
+++ b/knowledge base/template.md	
@@ -9,13 +9,17 @@ Intro
 1. [Sources](#sources)
 
 ## TL:DR
+
 ## Further readings
+
 ## Sources
 
 All the references in the [further readings] section, plus the following:
 
 
+
 
+
 [further readings]: #further-readings
 
 
diff --git a/knowledge base/terraform.md b/knowledge base/terraform.md
index 9fe8b00..9160172 100644
--- a/knowledge base/terraform.md	
+++ b/knowledge base/terraform.md	
@@ -136,7 +136,7 @@ variable "my_list" {
 }
 ```
 
-```text
+```txt
 Terraform will perform the following actions:
 
 # null_resource.default[0] must be replaced
@@ -191,7 +191,7 @@ Use the `-replace=resource_path` option during a `plan` or `apply`:
 terraform apply -replace=aws_instance.example
 ```
 
-```text
+```txt
 # aws_instance.example will be replaced, as requested
 -/+ resource "aws_instance" "example" {
       …
diff --git a/knowledge base/turris.md b/knowledge base/turris.md
index 290f385..e8e99c5 100644
--- a/knowledge base/turris.md	
+++ b/knowledge base/turris.md	
@@ -98,7 +98,7 @@ Should you want to see the state of individual devices during day but not to be
 
 Create a text file in the `/etc/cron.d` directory:
 
-```text
+```txt
 # File /etc/cron.d/rainbow_night.
 # Set the light intensity to the second lowest degree every day at 11 PM and set
 # it back to maximum every day at 7 AM.
@@ -182,7 +182,7 @@ Choose one of Pi-hole's [supported operating systems][pi-hole supported operatin
    vim '/etc/config/lxc-auto'
    ```
 
-   ```text
+   ```txt
    config container
        option name pi-hole
        option timeout 60
@@ -255,7 +255,7 @@ Check the module is recognized by the system like so:
 
 1. If the `grep` returned results:
 
-   ```text
+   ```txt
    [   7.823007] sfp sfp: Host maximum power 3.0W
    [   8.167128] sfp sfp: Turris  RTSFP-10G  rev A  sn 1234567890  dc 123456
    ```
diff --git a/knowledge base/vim.md b/knowledge base/vim.md
index 0ee4301..ed686d0 100644
--- a/knowledge base/vim.md	
+++ b/knowledge base/vim.md	
@@ -51,7 +51,7 @@ The modeline line needs to:
 
 Examples:
 
-```text
+```txt
 # vim: set expandtab:
 
 # -*- mode: ruby -*-