From 052470509f27b92a6cff8cafdb6ffeb74d234439 Mon Sep 17 00:00:00 2001 From: paul-loedige <59517210+ploedige@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:38:07 +0100 Subject: [PATCH] added old posts from ghost --- archetypes/default.md | 1 + .../URLs-in-latex-with-proper-linebreaks.md | 13 ++++ content/knowledge-base/automatic-updates.md | 23 +++++++ .../basic-doom-emacs-commands.md | 63 +++++++++++++++++++ .../create-windows-usb-on-linux.md | 9 +++ .../extract-images-from-pdf-on-linux.md | 12 ++++ .../finding-package-files-with-apt-files.md | 9 +++ .../german-quotations-in-latex.md | 11 ++++ content/knowledge-base/regex-basics.md | 58 +++++++++++++++++ content/knowledge-base/ssh-basics.md | 27 ++++++++ content/knowledge-base/teamviewer-on-arch.md | 13 ++++ .../tkinter-in-a-conda-environment.md | 17 +++++ .../using-3Dconnexion-mice-on-arch-linux.md | 25 ++++++++ content/knowledge-base/wireguard-keepalive.md | 12 ++++ hugo.toml | 11 +++- 15 files changed, 301 insertions(+), 3 deletions(-) create mode 100644 content/knowledge-base/URLs-in-latex-with-proper-linebreaks.md create mode 100644 content/knowledge-base/automatic-updates.md create mode 100644 content/knowledge-base/basic-doom-emacs-commands.md create mode 100644 content/knowledge-base/create-windows-usb-on-linux.md create mode 100644 content/knowledge-base/extract-images-from-pdf-on-linux.md create mode 100644 content/knowledge-base/finding-package-files-with-apt-files.md create mode 100644 content/knowledge-base/german-quotations-in-latex.md create mode 100644 content/knowledge-base/regex-basics.md create mode 100644 content/knowledge-base/ssh-basics.md create mode 100644 content/knowledge-base/teamviewer-on-arch.md create mode 100644 content/knowledge-base/tkinter-in-a-conda-environment.md create mode 100644 content/knowledge-base/using-3Dconnexion-mice-on-arch-linux.md create mode 100644 content/knowledge-base/wireguard-keepalive.md diff --git a/archetypes/default.md b/archetypes/default.md index 25b6752..fb2c88b 100644 --- a/archetypes/default.md +++ b/archetypes/default.md @@ -2,4 +2,5 @@ date = '{{ .Date }}' draft = true title = '{{ replace .File.ContentBaseName "-" " " | title }}' +type='post' +++ diff --git a/content/knowledge-base/URLs-in-latex-with-proper-linebreaks.md b/content/knowledge-base/URLs-in-latex-with-proper-linebreaks.md new file mode 100644 index 0000000..5934b0f --- /dev/null +++ b/content/knowledge-base/URLs-in-latex-with-proper-linebreaks.md @@ -0,0 +1,13 @@ ++++ +date = '2023-02-01T15:31:59' +draft = false +title = 'URLs in Latex With Proper Linebreaks' +type = 'post' +tags = ['LaTeX'] ++++ + +## Problem +While the [hyperref](https://www.ctan.org/pkg/hyperref) package provides the `\\url{}` command it doesn't handle line breaks well. + +## Solution +Use the package [xurl](https://www.ctan.org/pkg/xurl). \ No newline at end of file diff --git a/content/knowledge-base/automatic-updates.md b/content/knowledge-base/automatic-updates.md new file mode 100644 index 0000000..9fed809 --- /dev/null +++ b/content/knowledge-base/automatic-updates.md @@ -0,0 +1,23 @@ ++++ +date = '2022-09-04T15:40:21' +draft = false +title = 'Automatic Updates' +type = 'post' +tags = ['Linux', 'Debian'] ++++ +Installing security updates is very important. Especially on a server that is not accessed on a daily basis. +This tutorial covers the basics for setting up unattended-upgrades on any Debian-based Linux distribution. +## Update the system +``` +sudo apt update && sudo apt upgrade +``` +## Install unattended-upgrades +``` +apt install unattended-upgrades +``` +``` +dpkg-reconfigure unattended-upgrades +``` + +## Further Information + \ No newline at end of file diff --git a/content/knowledge-base/basic-doom-emacs-commands.md b/content/knowledge-base/basic-doom-emacs-commands.md new file mode 100644 index 0000000..daa9b42 --- /dev/null +++ b/content/knowledge-base/basic-doom-emacs-commands.md @@ -0,0 +1,63 @@ ++++ +date = '2022-11-07T13:42:02' +draft = false +title = 'Basic Doom Emacs Commands' +type = 'post' +tags = ['Emacs'] ++++ + +This is basically just a collection of various commands I discovered while learning to use Doom Emacs. +All Sources will be listed at the bottom of this page. + +Also. This side does not provide a lot of explanation regarding the function of the commands. +It is just intended as a cheat sheet. +Updates/ Changes **will** be added to this post. + +# Navigation +## Workspaces +- switch between workspaces: '**SPC TAB .**' +- load workspace: '**SPC TAB l**' +- create new workspace: '**SPC TAB n**' +- rename workspace: '**SPC TAB r**' +- save workspace: '**SPC TAB s**' +- select project for workspace: '**SPC p p**' +### File Switching inside Workspaces +- switch to file within current project: '**SPC SPC**' + - '**SPC .**' provides the save functionality but can also search outside the current project +- switch to buffer within current project: '**SPC ,**' +- switch to a buffer outside the current project: '**SPC b B**' +- load recently viewed file: '**SPC fr**' + +## Finding Text +- search all files in the current project: '**SPC sp**' +- search inside the current buffer: '**/**' (normal Vim navigation) +### Moving to Text +- jump to line (faster then relative line numbers): '**gsj**' +- '**s**' and two chars to jump to the nearest match + - '**S**' to jump backwards + - '**,**' or '**;**' to cycle through the matches (forwards/ backwards) + +**NOTE:** this navigation can be combined with (almost) all of the standard Vim commands (e.g. '**vs\\**' visualizes all the text to the nearest match for \\) + +## Source Code +- go to definition: '**gd**' +- list references: '**gD**' +### Fancy Delete +**NOTE:** all these commands should also work for 'change' ('**c**') +- delete inside the same indent (e.g. *function* of if statement): '**dii**' +- delete inside the same indent + line above (e.g. *complete* if statement in python): '**dik**' +- delete inside the same indent + line above and below (e.g. *complete* if statement in java): '**dij**' + +## Compilation Errors +- next and previous flycheck error: '**\\]e**' and '**\\[e**' +- list current errors: '**SPC c x**' + +# Miscellaneous +- compile: '**SPC p c**' +- open [Magit](https://magit.vc/): '**SPC gg**' +- comment/ uncomment a line: '**gcc**' + +# Sources +- https://github.com/doomemacs/doomemacs/ +- https://noelwelsh.com/posts/doom-emacs/ +- https://medium.com/@aria_39488/the-niceties-of-evil-in-doom-emacs-cabb46a9446b \ No newline at end of file diff --git a/content/knowledge-base/create-windows-usb-on-linux.md b/content/knowledge-base/create-windows-usb-on-linux.md new file mode 100644 index 0000000..eec50d1 --- /dev/null +++ b/content/knowledge-base/create-windows-usb-on-linux.md @@ -0,0 +1,9 @@ ++++ +date = '2022-09-04T15:51:15' +draft = false +title = 'Create Windows USB on Linux' +type = 'post' +tags = ['Linux'] ++++ + +# "USE [WOEUSB](https://github.com/WoeUSB/WoeUSB)" \ No newline at end of file diff --git a/content/knowledge-base/extract-images-from-pdf-on-linux.md b/content/knowledge-base/extract-images-from-pdf-on-linux.md new file mode 100644 index 0000000..875cb4c --- /dev/null +++ b/content/knowledge-base/extract-images-from-pdf-on-linux.md @@ -0,0 +1,12 @@ ++++ +date = '2022-09-04T16:04:09' +draft = false +title = 'Extract Images From PDF on Linux' +type = 'post' +tags = ['Linux'] ++++ + +By using the `pdfimages` command included in most Linux distributions it is easy to extract all pictures included in a PDF document. +Instructions on how to use the command can be found [here](https://www.xpdfreader.com/pdfimages-man.html). + +**Note:** the target directory for the extracted images must be created before executing the command, else it will just throw errors. \ No newline at end of file diff --git a/content/knowledge-base/finding-package-files-with-apt-files.md b/content/knowledge-base/finding-package-files-with-apt-files.md new file mode 100644 index 0000000..22c9b7d --- /dev/null +++ b/content/knowledge-base/finding-package-files-with-apt-files.md @@ -0,0 +1,9 @@ ++++ +date = '2022-09-04T15:59:30' +draft = false +title = 'Finding Package Files With Apt Files' +type = 'post' +tags = ['Linux','Debian'] ++++ + +To find the files/directories related to a package on a Debian-based system, use the [apt-file](https://wiki.debian.org/apt-file) package. \ No newline at end of file diff --git a/content/knowledge-base/german-quotations-in-latex.md b/content/knowledge-base/german-quotations-in-latex.md new file mode 100644 index 0000000..3e82d28 --- /dev/null +++ b/content/knowledge-base/german-quotations-in-latex.md @@ -0,0 +1,11 @@ ++++ +date = '2022-09-04T15:52:50' +draft = false +title = 'German Quotations in LaTeX' +type = 'post' +tags = ['LaTeX'] ++++ + +In short: do **not** use any fancy macros and shit that can break other configurations. +Just use the shorthands provided by the ```babel``` package. +For a list of all the babel shorthands see https://ctan.math.washington.edu/tex-archive/macros/latex/contrib/babel-contrib/german/ngermanb.pdf \ No newline at end of file diff --git a/content/knowledge-base/regex-basics.md b/content/knowledge-base/regex-basics.md new file mode 100644 index 0000000..33d44bb --- /dev/null +++ b/content/knowledge-base/regex-basics.md @@ -0,0 +1,58 @@ ++++ +date = '2022-09-04T15:43:06' +draft = false +title = 'Regex Basics' +type = 'post' +tags = ['Misc'] ++++ +[just text:](#just-text) matches any string with the given text inside it +[^](#^) matches string that starts with the given text +[$](#$) matches string that ends with the given text +[*](#*) zero or more +[+](#+) one or more +[?](#?) zero or one +[{n}](#{n}) `n` occurrences +[a|b or [ab]](#OR-operator) a or b +[\\d](#\\d) matches a digit +[\\w](#\\w) matches a word character (alphanumeric plus underscore) +[\\s](#\\s) matches a whitespace character +[.](#.) matches any character + +## Anchors +### just text +`abc` matches any string that has the text _abc_ in it +### ^ +`^abc` matches any string that starts with _abc_ +### $ +`abc$` matches any string that ends with _abc_ +### exact match +`^abc$` matches only the exact string _abc_ + +## Quantifiers +### * +`abc*` matches any string containing _ab_ followed by any number of _c_ s +### + +`abc+` matches any string containing _ab_ followed by at least one _c_ +### ? +`abc?` matches any string containing _ab_ followed by at the most one _c_ +### {n} +`abc{2}` matches any string containing _ab_ followed by two _c_ s +`abc{2,}` matches any string containing _ab_ followed by two __or more__ _c_ s +`abc{2,5}` matches any string containing _ab_ followed by between two and five _c_ s + +## OR operator +`a|b` _a_ or _b_ +`[abc]` _a_ or _b_ or _c_ + +## Character classes +### \d +`\d` matches any character in a string that is a digit +`\D` matches any character that __isn't__ a digit +### \w +`\w` matches any character in a string that is a word character +`\W` matches any character that __isn't__ a word character +### \s +`\s` matches any whitespace character in a string +`\S` matches any __non__-whitespace character +### . +`.` matches any character in a string \ No newline at end of file diff --git a/content/knowledge-base/ssh-basics.md b/content/knowledge-base/ssh-basics.md new file mode 100644 index 0000000..49d4f4a --- /dev/null +++ b/content/knowledge-base/ssh-basics.md @@ -0,0 +1,27 @@ ++++ +date = '2022-09-04T15:39:45' +draft = false +title = 'SSH Basics' +type='post' +tags = ['Misc'] ++++ + +## Generate Keypair +```bash +ssh-keygen +``` + +## Remote Login with Key +```bash +ssh-copy-id @ +``` + +### Disable Access via Password +modify `/etc/ssh/sshd_config` so that it includes +``` +PasswordAuthentication no +``` +#### enable changes +``` +systemctl restart ssh +``` \ No newline at end of file diff --git a/content/knowledge-base/teamviewer-on-arch.md b/content/knowledge-base/teamviewer-on-arch.md new file mode 100644 index 0000000..6920414 --- /dev/null +++ b/content/knowledge-base/teamviewer-on-arch.md @@ -0,0 +1,13 @@ ++++ +date = '2022-09-04T15:55:29' +draft = false +title = 'Teamviewer on Arch Linux' +type = 'post' +tags = ['Arch Linux', 'Linux', 'Misc'] ++++ + +1. install teamviewer from the AUR +2. every time you want to run TeamViewer GUI the deamon needs to be running. +This only works with a Display Manager (e.g. LightDM) and systemd. +```sudo systemctl start teamviewerd``` +3. run the TeamViewer GUI \ No newline at end of file diff --git a/content/knowledge-base/tkinter-in-a-conda-environment.md b/content/knowledge-base/tkinter-in-a-conda-environment.md new file mode 100644 index 0000000..fabb753 --- /dev/null +++ b/content/knowledge-base/tkinter-in-a-conda-environment.md @@ -0,0 +1,17 @@ ++++ +date = '2024-12-03T14:35:27+01:00' +draft = false +title = 'Tkinter in a Conda Environment' +type = 'post' +tags = ['Conda'] ++++ + +The default tk built shipped with conda does not have freetype support. + +## Workaround +The workaround proposed in [this](https://github.com/conda-forge/tk-feedstock/pull/40#issuecomment-1803067221) Github issue is: +``` +conda install -c conda-forge tk=*=xft_* +``` + +**Note:** in zsh the * need to be escaped \ No newline at end of file diff --git a/content/knowledge-base/using-3Dconnexion-mice-on-arch-linux.md b/content/knowledge-base/using-3Dconnexion-mice-on-arch-linux.md new file mode 100644 index 0000000..62d572d --- /dev/null +++ b/content/knowledge-base/using-3Dconnexion-mice-on-arch-linux.md @@ -0,0 +1,25 @@ ++++ +date = '2022-09-15T23:04:00' +draft = false +title = 'Using 3Dconnexion Mice on Arch Linux' +type = 'post' +tags = ['Arch Linux', 'Misc'] ++++ + +1. Check if the mouse is recognized by the system + ```bash + grep 3Dconnexion /proc/bus/input/devices + ``` +1. Install open source drivers [libspnav](https://archlinux.org/packages/extra/x86_64/libspnav/) and [spacenavd](https://aur.archlinux.org/packages/spacenavd)from the AUR (propriatary drivers are very old) + +1. test the setup by running the daemon manually (test programs like [FreeCAD](https://www.freecad.org/) might need to be restarted) + ```bash + spacenavd -v -d + ``` +1. the daemon is provided in the form of `spacenavd.service` by the [spacenavd](https://aur.archlinux.org/packages/spacenavd) package and can be started or enabled with [systemctl](https://wiki.archlinux.org/title/Systemctl) + +## configuration via GUI +to view and modify the button mappings as well as the general configuration install the [spnavcfg](https://aur.archlinux.org/packages/spnavcfg) package from the AUR + +## Notes +This "Tutorial" is just an abbreviated version of the [3D Mouse Arch Wiki Page](https://wiki.archlinux.org/title/3D_Mouse) \ No newline at end of file diff --git a/content/knowledge-base/wireguard-keepalive.md b/content/knowledge-base/wireguard-keepalive.md new file mode 100644 index 0000000..9ce014a --- /dev/null +++ b/content/knowledge-base/wireguard-keepalive.md @@ -0,0 +1,12 @@ ++++ +date = '2022-09-04T15:56:51' +draft = false +title = 'Wireguard Keepalive' +type = 'post' +tags = ['Misc'] ++++ + +If one peer is behind a DynDNS you need to use the `reresolve-dns.sh` script included with the wireguard-tools package. +Excelent [documentation in the Arch-Wiki](https://wiki.archlinux.org/title/WireGuard#Endpoint_with_changing_IP) + +__Note__: wireguard-tools package is installed on another directory in Debian than in Arch. use [apt-file](/knowledge-base/finding-package-files-with-apt-files) to find the relevant directory. \ No newline at end of file diff --git a/hugo.toml b/hugo.toml index 5c04df3..ca892c5 100644 --- a/hugo.toml +++ b/hugo.toml @@ -20,11 +20,16 @@ theme = "gokarna" [menu] [[menu.main]] - name = "Posts" - url = "/posts/" + name = "Projects" + url = "/projects/" weight = 1 + [[menu.main]] + name = "Knowledge Base" + url = "/knowledge-base/" + weight = 2 + [[menu.main]] name = "Tags" url = "/tags/" - weight = 2 + weight = 3