From 720fa4a18b4c8389f93a56a37cd0408c34ac366d Mon Sep 17 00:00:00 2001 From: dadada Date: Sun, 26 Jul 2020 19:39:13 +0200 Subject: [PATCH] Initial commit --- .gitignore | 4 + .gitmodules | 9 + config.yaml | 31 ++ content/_index.md | 9 + content/blog/gpg.md | 41 +++ content/blog/hello-world.md | 9 + content/blog/home-layout/home.svg | 524 +++++++++++++++++++++++++++++ content/blog/home-layout/index.md | 63 ++++ content/blog/learning-rust.md | 16 + content/talks/systemd.generator.md | 87 +++++ default.nix | 19 ++ i18n/de.toml | 17 + i18n/en.toml | 17 + i18n/es.toml | 17 + i18n/nl.toml | 17 + smol | 1 + themes/smol | 1 + 17 files changed, 882 insertions(+) create mode 100644 .gitignore create mode 100644 .gitmodules create mode 100644 config.yaml create mode 100644 content/_index.md create mode 100644 content/blog/gpg.md create mode 100644 content/blog/hello-world.md create mode 100644 content/blog/home-layout/home.svg create mode 100644 content/blog/home-layout/index.md create mode 100644 content/blog/learning-rust.md create mode 100644 content/talks/systemd.generator.md create mode 100644 default.nix create mode 100644 i18n/de.toml create mode 100644 i18n/en.toml create mode 100644 i18n/es.toml create mode 100644 i18n/nl.toml create mode 160000 smol create mode 160000 themes/smol diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1bae415 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +archetypes/ +public/ +resources/ +result diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..cff3faa --- /dev/null +++ b/.gitmodules @@ -0,0 +1,9 @@ +[submodule "themes/blank"] + path = themes/blank + url = https://github.com/vimux/blank +[submodule "smol"] + path = smol + url = https://github.com/colorchestra/smol +[submodule "themes/smol"] + path = themes/smol + url = https://github.com/colorchestra/smol diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..b9150b0 --- /dev/null +++ b/config.yaml @@ -0,0 +1,31 @@ +baseURL: "https://dadada.li/" +title: "dadada" +defaultContentLanguage: "en" +paginate: 5 +theme: "smol" +enableRobotsTXT: true + +params: + author: "dadada" + rss: + includeContent: true + +taxonomies: + tag: "tags" + +author: + name: "dadada" + + +menu: + main: + - identifier: blog + name: Blog + title: Blog + url: /blog/ + weight: 0 + - identifier: talks + name: Talks + title: Talks + url: /talks/ + weight: 0 diff --git a/content/_index.md b/content/_index.md new file mode 100644 index 0000000..01de81d --- /dev/null +++ b/content/_index.md @@ -0,0 +1,9 @@ ++++ +title = "dadada" +date = 2020-07-05 + +[taxonomies] +tags = [] ++++ + +Hello, world! diff --git a/content/blog/gpg.md b/content/blog/gpg.md new file mode 100644 index 0000000..d1c3e1a --- /dev/null +++ b/content/blog/gpg.md @@ -0,0 +1,41 @@ ++++ +title = "Managing stripped GPG keys" +date = 2017-12-03 + +[taxonomies] +tags = ["gpg", "security"] ++++ + +``` + +--(master pass) +----(user pass)--+ + | | | | + | decrypts decrypts decrypts + | | | | + | v v v +decrypts +----------------+ +----------+ +-----------+ + | | TRUSTED | | ANDROID | | KEYCHAIN | + | | SCA (master) | | SE (ssb) | | SEA (ssb) | + | | offline + HSM | | Sandbox | | HSM | + | +----------------+ +----------+ +-----------+ + | | ^ ^ + | | | | + | +----creates-------------|-----------------+ + | + | +-----------------+ + | | PAPER | + +->| SEA (master) | + | remote on paper | + +-----------------+ +``` + +See [here](https://www.void.gr/kargig/blog/2013/12/02/creating-a-new-gpg-key-with-subkeys/) on how to strip the master key (sec) from your keyring and create secret subkeys (ssb) for daily active use. +The master key can sign (S) new subkeys, create certificates (C) and provide authentication (A). +The master key lives forever, while the ssb that is used for signing is created with an expiration date. +All encryption keys may remain valid indefinitely until revoked. +The master key can be used to revoke the subkeys. + +A few considerations + +- use a separate PIN on the trusted system / for the master key (sec) in case a key-logger reads the PIN on a semi-trusted machine (e.g. laptop or android) when decrypting a secret subkey (ssb) +- use subkey (A) for authenticating ssh +- keep master key offline / air-gapped diff --git a/content/blog/hello-world.md b/content/blog/hello-world.md new file mode 100644 index 0000000..94a1d38 --- /dev/null +++ b/content/blog/hello-world.md @@ -0,0 +1,9 @@ ++++ +title = "Hello, World!" +date = 2017-10-28 + +[taxonomies] +tags = ["hello world", "security"] ++++ + +Hello, World! diff --git a/content/blog/home-layout/home.svg b/content/blog/home-layout/home.svg new file mode 100644 index 0000000..4b75583 --- /dev/null +++ b/content/blog/home-layout/home.svg @@ -0,0 +1,524 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + lib + + + + tag + + + + src + + + + tmp + + + + + + + diff --git a/content/blog/home-layout/index.md b/content/blog/home-layout/index.md new file mode 100644 index 0000000..47a5bba --- /dev/null +++ b/content/blog/home-layout/index.md @@ -0,0 +1,63 @@ ++++ +title = "My $HOME" +date = 2018-09-03 + +[taxonomies] +tags = ["organisation", "linux"] ++++ + +Recently, I came across a blog posting titled "[$HOME, sweet $HOME](https://morr.cc/home-sweet-home/)", where [@blinry](https://morr.cc/) advocates for structuring your `$HOME` directory based on projects and their activity. +After reading this I felt inspired to finally have a look at the mess I made of my `$HOME` in the last years. + +A few things about my old `$HOME`: +- ``Documents`` contained basically everything I had accumulated during the last years besides music, videos, pictures and source code. +- ``projects`` just contained one gigantic folder of all projects that I ever worked on. +- the rest was based on the default [xdg-user-dirs](https://freedesktop.org/wiki/Software/xdg-user-dirs/) + +If you sorted the files by file type like the default XDG directories suggest, files from one project may be scattered across many different directories. + +So my goal for the new `$HOME` was to have a clean directory structure where: + - it is obvious where to place new files + - paths do not become too long to type out + - the directory structure relates to how I work + +A quick tour of my new `$HOME`: + +- `lib` for immutable files +- `src` for mutable files +- `tag` stores links to projects +- `tmp` for unsorted files and downloads + +## The project directory + +All of my projects are stored in `src`. +I use a flat directory structure, where every project has its own subdirectory based on its name. +Projects can become part of one or more larger contexts through the use of tags. + +## Tags + +Tag directories are stored in `tag`. +Each directory stores symbolic links to parts of a project that can be distributed around `lib` and `src`. +One possible use for the tag directories is creating workbenches. +If I use some directories in `lib` or `src` in different contexts, `tag` can be used to include them in multiple workbenches. + +An example workflow +```sh +$ cd tag +$ mkdir -p course1/examples +$ ln -s ~/src/example1 course1/examples/ +$ ln -s ~/lib/courses/course1 course1/material +$ rm -r course1 +``` + +I create new tags for various reasons, but mostly one for each larger context (e.g. work, hobbies, admin foo, thesis, courseXY) and some more for tracking project activity. +There are four different tags in `tag` directory right now for tracking project activity: + +- permanent +- active +- hold +- dead + +## Workflow + +![Basically this](home.svg) diff --git a/content/blog/learning-rust.md b/content/blog/learning-rust.md new file mode 100644 index 0000000..aad58ae --- /dev/null +++ b/content/blog/learning-rust.md @@ -0,0 +1,16 @@ ++++ +title = "Learning Rust" +draft = true +date = 1980-01-01 + +[taxonomies] +tags = ["rust", "programming", "language"] ++++ + +## Blog! + +{% for post in collections.posts.pages %} +#### {{post.title}} + +[{{ post.title }}]({{ post.permalink }}) +{% endfor %} diff --git a/content/talks/systemd.generator.md b/content/talks/systemd.generator.md new file mode 100644 index 0000000..0663cd2 --- /dev/null +++ b/content/talks/systemd.generator.md @@ -0,0 +1,87 @@ +--- +title: systemd.generator(7) +author: dadada +width: 1920 +height: 1080 +date: 2019-03-14 +--- + +[Recording](https://www.youtube.com/watch?v=X88zHJjodFw) + +# Dynamische Systeme sind schwierig + +- ➤ Devices, Mountpoints, Services, Timer möglichst als Unit +- Transitionstechnologie für `/etc/fstab` und SysV init-Skripte +- Hooks für den Bootprozess (System-Update, Resume, Debug ...) +- Umgebungsvariablen setzen +- ➤ Generatoren generieren beim Boot dynamisch Units + +# Calling convention + +`# /path/to/generator normal-dir early-dir late-dir` + +- Generatoren sind in + - `/run/systemd/{system,user}-generators/*` + - `/etc/systemd/{system,user}-generators/*` + - `/usr/lib/systemd/{system,user}-generators/*` + - `/usr/local/lib/systemd/{system,user}-generators/*` + + +# Generierte Units + +- neu generieren mit `systemctl daemon-reload` +- generierte Units landen in + - `normal-dir` ➤ `/run/systemd/generator` + - `early-dir` ➤ `/run/systemd/generator.early` + - `late-dir` ➤ `/run/systemd/generator.late` + +# Templating + +- generierte Units dürfen auch sein + - Templates + - Instanzen von Templates (`getty@tty1.service`) +- Generatoren können auch Symlinks in `.wants/`, `.target` und `.requires/` erstellen + +# Abhängigkeiten vermeiden +- kein syslog oder journal benutzen +- keine Units starten +- keine nicht essentiellen Dateisysteme verwenden (aber /proc, /usr, /sys und /dev) +- Generatoren werden parallel ausgeführt + +# Performance + +kann Boot verlangsamen ➤ Nicht mit bash implementieren, lieber C + +# Debugging + +``` +dir=$(mktemp -d) +SYSTEMD_LOG_LEVEL=debug /usr/lib/systemd/system-generators/systemd-fstab-generator "$dir" "$dir" "$dir" +find $dir +``` + +- syslog(3) ist nicht vefügbar +- keine Magie versuchen + +# Nicht geeignet für + +- Ersatz von init-Skripten + ➤ systemd-sysv-generator(8) +- dynamische Konfigurationsdateien + ➤ `ExecStartPre=` oder Service mit `Before=` + +# Beispiele + +- systemd-fstab-generator(8) + +- systemd-debug-generator(8) + +- systemd-getty-generator(8) + +- systemd-sysv-generator(8) + +- systemd.environment-generator(7) + +# Source + +- `man 7 systemd.generator` diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..cd8c719 --- /dev/null +++ b/default.nix @@ -0,0 +1,19 @@ +with import {}; +stdenv.mkDerivation { + name = "dadada.li"; + builtInputs = [ pkgs.hugo ]; + src = ./.; + buildPhase = "${pkgs.hugo}/bin/hugo"; + installPhase = '' + mkdir -p $out + cp -r public/* $out + ''; + dontFixup = true; + dontStrip = true; + + meta = with lib; { + description = "dadada.li web-site"; + license = licenses.cc-by-sa-40; + }; +} + diff --git a/i18n/de.toml b/i18n/de.toml new file mode 100644 index 0000000..8059f13 --- /dev/null +++ b/i18n/de.toml @@ -0,0 +1,17 @@ +[talks] +other = "Talks" + +[blog] +other = "Blogs" + +[writtenBy] +other = "Von" + +[on] +other = "am" + +[generator] +other = "Made with Hugo using the Tale theme." + +[publishdate] +other = "{{ .PublishDate.Day }}. {{ index $.Site.Data.months_de (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}" diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..ba342a5 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,17 @@ +[talks] +other = "Talks" + +[blog] +other = "Blog" + +[writtenBy] +other = "Written by" + +[on] +other = "on" + +[generator] +other = "Made with Hugo using the Tale theme." + +[publishdate] +other = "{{ .PublishDate.Format \"January 2, 2006\" }}" diff --git a/i18n/es.toml b/i18n/es.toml new file mode 100644 index 0000000..5578502 --- /dev/null +++ b/i18n/es.toml @@ -0,0 +1,17 @@ +[blog] +other = "Artículos" + +[talks] +other = "Talks" + +[writtenBy] +other = "Escrito por" + +[on] +other = "el" + +[generator] +other = "Hecho con Hugo usando el tema Tale." + +[publishdate] +other = "{{ .PublishDate.Day }} de {{ index $.Site.Data.months_es (printf \"%d\" .PublishDate.Month) }} de {{ .PublishDate.Year }}" diff --git a/i18n/nl.toml b/i18n/nl.toml new file mode 100644 index 0000000..9af6f44 --- /dev/null +++ b/i18n/nl.toml @@ -0,0 +1,17 @@ +[posts] +other = "Artikelen" + +[Talks] +other = "Talks" + +[writtenBy] +other = "Geschreven door" + +[on] +other = "op" + +[generator] +other = "Gemaakt met Hugo en thema Tale." + +[publishdate] +other = "{{ .PublishDate.Day }} {{ index $.Site.Data.months_nl (printf \"%d\" .PublishDate.Month) }} {{ .PublishDate.Year }}" diff --git a/smol b/smol new file mode 160000 index 0000000..2bb4ff7 --- /dev/null +++ b/smol @@ -0,0 +1 @@ +Subproject commit 2bb4ff73056f6b9ec4d5e43d9abe883bb62c9f9d diff --git a/themes/smol b/themes/smol new file mode 160000 index 0000000..2bb4ff7 --- /dev/null +++ b/themes/smol @@ -0,0 +1 @@ +Subproject commit 2bb4ff73056f6b9ec4d5e43d9abe883bb62c9f9d