added old posts from ghost

This commit is contained in:
paul-loedige
2024-12-03 15:38:07 +01:00
parent 7ac2af94ca
commit 052470509f
15 changed files with 301 additions and 3 deletions
+1
View File
@@ -2,4 +2,5 @@
date = '{{ .Date }}'
draft = true
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
type='post'
+++
@@ -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).
@@ -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
<https://wiki.debian.org/UnattendedUpgrades>
@@ -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\\<chars\\>**' visualizes all the text to the nearest match for \\<chars\\>)
## 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
@@ -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)"
@@ -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.
@@ -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.
@@ -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
+58
View File
@@ -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
+27
View File
@@ -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 <Host>@<Remote>
```
### Disable Access via Password
modify `/etc/ssh/sshd_config` so that it includes
```
PasswordAuthentication no
```
#### enable changes
```
systemctl restart ssh
```
@@ -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
@@ -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
@@ -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)
@@ -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.
+8 -3
View File
@@ -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