vault backup: 2025-12-05 12:15:18
This commit is contained in:
21 files changed
+201
-59
No files matched your search
@@ -0,0 +1,46 @@
|
||||
|
||||
Read the `AGENTS.md`. The task is to move the first heading which is the name of the file and the title of the document to the frontmatter/metadata. Here is an example:
|
||||
|
||||
The entry `CrowdSec.md` looks like this:
|
||||
|
||||
```markdown
|
||||
---
|
||||
kind: reference
|
||||
section: tool
|
||||
website: https://crowdsec.net/
|
||||
---
|
||||
|
||||
# CrowdSec
|
||||
|
||||
## Beschreibung
|
||||
|
||||
Die CrowdSec Security Engine läuft. Sie sammelt Metriken in den Server-Logs und wertet diese aus (ähnlich fail2ban, aber im grösseren Stil).
|
||||
|
||||
Um die IP-Adressen aus den CrowdSec Blocklists zu blockieren, verwende wir den CrowdSec Firewall Bouncer: <https://docs.crowdsec.net/u/bouncers/firewall/>
|
||||
|
||||
Diese Komponente kommuniziert mit der CrowdSec Security Engine und konfiguriert die Blocklists mit iptables.
|
||||
|
||||
```
|
||||
|
||||
And afterwards should look like this:
|
||||
|
||||
```markdown
|
||||
---
|
||||
title: CrowdSec
|
||||
kind: reference
|
||||
section: tool
|
||||
website: https://crowdsec.net/
|
||||
---
|
||||
|
||||
## Beschreibung
|
||||
|
||||
Die CrowdSec Security Engine läuft. Sie sammelt Metriken in den Server-Logs und wertet diese aus (ähnlich fail2ban, aber im grösseren Stil).
|
||||
|
||||
Um die IP-Adressen aus den CrowdSec Blocklists zu blockieren, verwende wir den CrowdSec Firewall Bouncer: <https://docs.crowdsec.net/u/bouncers/firewall/>
|
||||
|
||||
Diese Komponente kommuniziert mit der CrowdSec Security Engine und konfiguriert die Blocklists mit iptables.
|
||||
```
|
||||
|
||||
Keep track of all files that start with a `^# Heading`.
|
||||
|
||||
If `website, tags, repository, section or kind` is not given. Do not add it.
|
||||
@@ -2,10 +2,9 @@
|
||||
tags:
|
||||
- Definition
|
||||
section: infrastructure
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
repository: https://gitlab.com/mint-system/ansible-inventories
|
||||
---
|
||||
|
||||
# Ansible Inventory
|
||||
|
||||
Repository: <https://gitlab.com/mint-system/ansible-inventories>
|
||||
+2
-4
@@ -1,13 +1,11 @@
|
||||
---
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
section: tool
|
||||
website: https://crowdsec.net/
|
||||
---
|
||||
|
||||
# CrowdSec
|
||||
|
||||
Website: <https://crowdsec.net/>
|
||||
|
||||
## Beschreibung
|
||||
|
||||
Die CrowdSec Security Engine läuft. Sie sammelt Metriken in den Server-Logs und wertet diese aus (ähnlich fail2ban, aber im grösseren Stil).
|
||||
|
||||
+3
-5
@@ -2,12 +2,10 @@
|
||||
tags:
|
||||
- Definition
|
||||
section: tool
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
repository: https://github.com/doomemacs/doomemacs
|
||||
---
|
||||
|
||||
# Doom Emacs
|
||||
|
||||
Repository: <https://github.com/doomemacs/doomemacs>
|
||||
|
||||
Learn Emacs Doom: <https://www.youtube.com/playlist?app=desktop&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj>
|
||||
Learn Emacs Doom: <https://www.youtube.com/playlist?app=desktop&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj
|
||||
+2
-4
@@ -1,15 +1,13 @@
|
||||
---
|
||||
tags:
|
||||
- Definition
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
section: tool
|
||||
website: https://www.mozilla.org/de/firefox/
|
||||
---
|
||||
|
||||
# Firefox
|
||||
|
||||
Website: <https://www.mozilla.org/de/firefox/>
|
||||
|
||||
Weiterführende Links:
|
||||
|
||||
- [[Firefox Handbuch]]
|
||||
|
||||
+2
-4
@@ -1,8 +1,6 @@
|
||||
---
|
||||
section: infrastructure
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
repository: https://mint.app.codey.ch/Mint-System/Helm-Values
|
||||
---
|
||||
# Helm Values
|
||||
|
||||
Repository: <https://mint.app.codey.ch/Mint-System/Helm-Values>
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Definition
|
||||
website: https://inkscape.org/de/
|
||||
---
|
||||
|
||||
# Inkscape
|
||||
|
||||
Mit Inkscape können Vektorgrafiken und PDF-Dateien bearbeitet werden.
|
||||
|
||||
Website: <https://inkscape.org/de/>
|
||||
+2
-4
@@ -1,17 +1,15 @@
|
||||
---
|
||||
tags:
|
||||
- Definition
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
section: infrastructure
|
||||
repository: https://github.com/tonarino/innernet
|
||||
---
|
||||
|
||||
# Innernet
|
||||
|
||||
A private network system that uses [WireGuard](https://wireguard.com) under the hood. See the [announcement blog post](https://blog.tonari.no/introducing-innernet) for a longer-winded explanation.
|
||||
|
||||
Repository: <https://github.com/tonarino/innernet>
|
||||
|
||||
## Prozesse
|
||||
|
||||
- [[Prozesse Infrastruktur - Innernet bereitstellen]]
|
||||
+3
-5
@@ -1,16 +1,14 @@
|
||||
---
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
section: infrastructure
|
||||
website: https://main.build
|
||||
repository: https://codeberg.org/Mint-System/Main-Build
|
||||
---
|
||||
|
||||
# Main Build
|
||||
|
||||
Linking page for .build projects.
|
||||
|
||||
Website: https://main.build\
|
||||
Repository: https://codeberg.org/Mint-System/Main-Build
|
||||
|
||||
Infomaniak Domains:
|
||||
|
||||
- main.build
|
||||
@@ -1,12 +1,10 @@
|
||||
---
|
||||
section: dev
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
repository: https://github.com/Mint-System/Dotfiles
|
||||
---
|
||||
# Mint System Dotfiles
|
||||
|
||||
Shell-Setup für Mitarbeitende.
|
||||
|
||||
Repository: <https://github.com/Mint-System/Dotfiles>
|
||||
|
||||
Das Repo enthält [[dotfiles]] und ein [[taskfile]].
|
||||
@@ -2,8 +2,8 @@
|
||||
tags:
|
||||
- Website
|
||||
kind: reference
|
||||
repository: https://github.com/marius-wieschollek/passwords
|
||||
---
|
||||
|
||||
# Nextcloud Passwords
|
||||
|
||||
Repository: <https://github.com/marius-wieschollek/passwords>
|
||||
+2
-3
@@ -4,13 +4,12 @@ tags:
|
||||
lang: en
|
||||
kind: reference
|
||||
section: dev
|
||||
website: https://odoo.build
|
||||
repository: https://github.com/Mint-System/Odoo-Development
|
||||
---
|
||||
|
||||
# Odoo Build
|
||||
|
||||
Website: <https://odoo.build>\
|
||||
Repository: <https://github.com/Mint-System/Odoo-Development>
|
||||
|
||||
Infomaniak Domains:
|
||||
|
||||
- odoo-build.ch
|
||||
|
||||
+1
-1
@@ -1,6 +1,7 @@
|
||||
---
|
||||
tags:
|
||||
- Definition
|
||||
repository: https://github.com/Mint-System/Odoo-Demodaten
|
||||
---
|
||||
|
||||
# Odoo Demodaten
|
||||
@@ -9,4 +10,3 @@ Die Mint System verwaltet ein öffentliches Git-Projekt mit Odoo Demodaten. Dies
|
||||
|
||||
Die [[Velo Manufaktur]] ist ein fiktives Unternehmen.
|
||||
|
||||
Repository: https://github.com/Mint-System/Odoo-Demodaten
|
||||
+1
-1
@@ -1,10 +1,10 @@
|
||||
---
|
||||
tags:
|
||||
- Definition
|
||||
repository: https://github.com/Mint-System/Ansible-Playbooks/tree/master/roles/odoo-scripts
|
||||
---
|
||||
|
||||
# Odoo Scripts
|
||||
|
||||
Eine Sammlung von Skripten zur Verwaltung von Odoo Container, Datenbanken und Benutzer.
|
||||
|
||||
Repository: <https://github.com/Mint-System/Ansible-Playbooks/tree/master/roles/odoo-scripts>
|
||||
+2
-4
@@ -1,14 +1,12 @@
|
||||
---
|
||||
tags:
|
||||
- Website
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
repository: https://github.com/mbnuqw/sidebery
|
||||
---
|
||||
|
||||
# Sidebery
|
||||
|
||||
Repository: <https://github.com/mbnuqw/sidebery>
|
||||
|
||||
## Export panels and tabs
|
||||
|
||||
Go to _Settings / Snapshots_ and create a snapshot.
|
||||
|
||||
@@ -2,10 +2,9 @@
|
||||
tags:
|
||||
- Definition
|
||||
section: tool
|
||||
website: https://appointment.day/
|
||||
repository: https://github.com/thunderbird/appointment
|
||||
---
|
||||
|
||||
# Thunderbird Appointment
|
||||
|
||||
Website: <https://appointment.day/>
|
||||
|
||||
Repository: <https://github.com/thunderbird/appointment>
|
||||
@@ -2,8 +2,8 @@
|
||||
tags:
|
||||
- Definition
|
||||
section: tool
|
||||
website: https://zellij.dev/
|
||||
---
|
||||
|
||||
# Zsh
|
||||
|
||||
Website: <https://zellij.dev/>
|
||||
@@ -2,15 +2,13 @@
|
||||
tags:
|
||||
- Definition
|
||||
section: contact
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
website: https://inosca.ch/
|
||||
repository: https://github.com/inosca/ebau
|
||||
---
|
||||
|
||||
# inosca
|
||||
|
||||
Interkantonale Entwicklungsgemeinschaft für elektronische Bewilligungsprozesse
|
||||
|
||||
Website: <https://inosca.ch/>\
|
||||
Repository: <https://github.com/inosca/ebau>
|
||||
|
||||
Weiterführende Links: [[eBau]]
|
||||
@@ -0,0 +1,119 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Script to process markdown files and move website and repository links to frontmatter.
|
||||
"""
|
||||
|
||||
import os
|
||||
import re
|
||||
from pathlib import Path
|
||||
import yaml
|
||||
|
||||
|
||||
def extract_frontmatter(content):
|
||||
"""Extract frontmatter from markdown content."""
|
||||
if content.startswith("---"):
|
||||
parts = content.split("---", 2)
|
||||
if len(parts) >= 3:
|
||||
return yaml.safe_load(parts[1]), parts[2]
|
||||
return {}, content
|
||||
|
||||
|
||||
def update_frontmatter(frontmatter, website=None, repository=None):
|
||||
"""Update frontmatter with website and repository info."""
|
||||
if website:
|
||||
frontmatter['website'] = website
|
||||
if repository:
|
||||
frontmatter['repository'] = repository
|
||||
|
||||
# Fix arrays to single values for kind, section, etc.
|
||||
for key in ['kind', 'section']:
|
||||
if key in frontmatter and isinstance(frontmatter[key], list):
|
||||
if len(frontmatter[key]) == 1:
|
||||
frontmatter[key] = frontmatter[key][0]
|
||||
elif len(frontmatter[key]) == 0:
|
||||
del frontmatter[key]
|
||||
|
||||
return frontmatter
|
||||
|
||||
|
||||
def process_file(filepath):
|
||||
"""Process a single markdown file to move website/repository links to frontmatter."""
|
||||
with open(filepath, 'r', encoding='utf-8') as f:
|
||||
original_content = f.read()
|
||||
|
||||
# Extract frontmatter and content
|
||||
frontmatter, content = extract_frontmatter(original_content)
|
||||
|
||||
# Look for website and repository links in content
|
||||
website_match = re.search(r'^Website:\s*<?(https?://[^>\s]+)>?\\?$', content, re.MULTILINE | re.IGNORECASE)
|
||||
repository_match = re.search(r'^Repository:\s*<?([^>\s]+)>?\\?$', content, re.MULTILINE | re.IGNORECASE)
|
||||
|
||||
# If no matches found, try other patterns
|
||||
if not website_match:
|
||||
website_match = re.search(r'^website:\s*<?(https?://[^>\s]+)>?\\?$', content, re.MULTILINE)
|
||||
if not repository_match:
|
||||
repository_match = re.search(r'^repository:\s*<?([^>\s]+)>?\\?$', content, re.MULTILINE)
|
||||
|
||||
website = website_match.group(1) if website_match else None
|
||||
repository = repository_match.group(1) if repository_match else None
|
||||
|
||||
if not website and not repository:
|
||||
# Also check for patterns like "Website: <https://...>"
|
||||
website_match = re.search(r'^Website:\s*<([^>]+)>\\?$', content, re.MULTILINE)
|
||||
repository_match = re.search(r'^Repository:\s*<([^>]+)>\\?$', content, re.MULTILINE)
|
||||
|
||||
website = website_match.group(1) if website_match else None
|
||||
repository = repository_match.group(1) if repository_match else None
|
||||
|
||||
# If we found links, process the file
|
||||
if website or repository:
|
||||
# Update frontmatter
|
||||
updated_frontmatter = update_frontmatter(frontmatter, website, repository)
|
||||
|
||||
# Remove the website and repository lines from content
|
||||
new_content = content
|
||||
if website:
|
||||
new_content = re.sub(r'^Website:\s*<?' + re.escape(website) + r'>?\\?$\n?', '', new_content, flags=re.MULTILINE)
|
||||
# Also try the bracketed format
|
||||
new_content = re.sub(r'^Website:\s*<' + re.escape(website) + r'>\\?$\n?', '', new_content, flags=re.MULTILINE)
|
||||
if repository:
|
||||
new_content = re.sub(r'^Repository:\s*<?' + re.escape(repository) + r'>?\\?$\n?', '', new_content, flags=re.MULTILINE)
|
||||
# Also try the bracketed format
|
||||
new_content = re.sub(r'^Repository:\s*<' + re.escape(repository) + r'>\\?$\n?', '', new_content, flags=re.MULTILINE)
|
||||
|
||||
# Remove empty lines created by the removal
|
||||
new_content = re.sub(r'\n\s*\n', '\n\n', new_content).strip()
|
||||
new_content = '\n' + new_content + '\n' # Ensure proper line endings
|
||||
|
||||
# Reconstruct the file
|
||||
updated_content = "---\n" + yaml.dump(updated_frontmatter, default_flow_style=False, allow_unicode=True) + "---" + new_content
|
||||
|
||||
# Write the updated content back to the file
|
||||
with open(filepath, 'w', encoding='utf-8') as f:
|
||||
f.write(updated_content)
|
||||
|
||||
print(f"Processed {filepath.name}: added {'website' if website else ''}{' and ' if website and repository else ''}{'repository' if repository else ''} to frontmatter")
|
||||
return True
|
||||
|
||||
return False
|
||||
|
||||
|
||||
def main():
|
||||
wiki_path = Path("/home/janikvonrotz/Wiki")
|
||||
|
||||
# Find all markdown files
|
||||
markdown_files = list(wiki_path.glob("*.md"))
|
||||
|
||||
processed_count = 0
|
||||
for filepath in markdown_files:
|
||||
try:
|
||||
if process_file(filepath):
|
||||
processed_count += 1
|
||||
except Exception as e:
|
||||
print(f"Error processing {filepath}: {e}")
|
||||
|
||||
print(f"\nProcessed {processed_count} files.")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
+2
-3
@@ -1,9 +1,8 @@
|
||||
---
|
||||
kind:
|
||||
- reference
|
||||
kind: reference
|
||||
section: tool
|
||||
website: https://rustdesk.com/
|
||||
---
|
||||
|
||||
# rustdesk
|
||||
|
||||
Website: <https://rustdesk.com/>
|
||||
Reference in new issue
Block a user