mirror of
https://github.com/vale981/website
synced 2025-03-04 17:11:40 -05:00
blog about restauration
This commit is contained in:
parent
1d893909b4
commit
d4b00f3985
2 changed files with 111 additions and 0 deletions
54
content.org
54
content.org
|
@ -495,6 +495,7 @@ the python tooling. I hope eventually they will pass the "noob test"
|
|||
:P. But, as you may have recognized above, I am not the best explainer.
|
||||
|
||||
***** Footnotes
|
||||
|
||||
[fn:4] I really appreciate c++ as a compiled language.
|
||||
|
||||
[fn:3] See the KStars Handbook.
|
||||
|
@ -2438,6 +2439,59 @@ Butterfabrik benutzten, ehemaligen Schiffsmotor!
|
|||
Und jetzt gehts schlafen. Bis nächste Woche in Deutschland.
|
||||
|
||||
** Uncategorized :@Uncategorized:
|
||||
*** Neuseeland Restauration
|
||||
CLOSED: [2021-08-03 Tue 14:53]
|
||||
:PROPERTIES:
|
||||
:EXPORT_FILE_NAME: neuseeland-restauration
|
||||
:END:
|
||||
Zwar lagen mir die Neuseeland-Blog posts als ~markdown~ quelle vor,
|
||||
jedoch hatte ich den Erstellungszeitpunk unvorteilhafter Weise aus den
|
||||
Dateisystem-Metadaten[fn:5] ausgelesen. Nach der Neuinstallation meines
|
||||
servers vor ein paar Jahren waren diese Metadaten vollends verloren.
|
||||
|
||||
Meine erste Idee war zu versuchen die Zeitpunkte anhand der Email
|
||||
Newsletter zu rekonstruieren. Auf diesem Wege versprach ich mir jedoch
|
||||
keinen baldigen Erfolg da mein eigenes Email Archiv nicht soweit
|
||||
zurueckreicht.
|
||||
|
||||
Zu meiner grossen Freude war letztendlich gar keine aufwaendige
|
||||
Archeologie notwendig, da ich damals ausversehen einmal meinen Blog
|
||||
Index in ~git~ eingecheckt hatte.
|
||||
|
||||
#+begin_src shell
|
||||
$ git show b1cf78b7182f0364343d2a87a1b361e7dc833688^1:data/indexes/post.json
|
||||
#+end_src
|
||||
|
||||
Und schon hattte ich die ganze Suppe (sogar vollstaendig) in einem
|
||||
maschinenlesbaren Format.
|
||||
|
||||
Ein wenig python verwandelte das ganze in das neue Blog format.
|
||||
#+begin_src python
|
||||
import sys
|
||||
import json
|
||||
import datetime
|
||||
|
||||
with open(sys.argv[1], "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
for post in data:
|
||||
export_name = (post["content"]).split("/")[-1][:-5]
|
||||
with open(post["content"][1:], "r") as cont:
|
||||
content = cont.read()
|
||||
date = datetime.datetime.strptime(post["created"], "%Y-%m-%dT%H:%M:%S.%fZ")
|
||||
print(
|
||||
f"""
|
||||
,*** {post["title"]}
|
||||
:PROPERTIES:
|
||||
:EXPORT_FILE_NAME: {export_name}
|
||||
:EXPORT_DATE: [{date}]
|
||||
:END:
|
||||
{content}""")
|
||||
#+end_src
|
||||
|
||||
Und damit koennt ihr nun unter [[*Neuseeland][Neuseeland]] die alten posts lesen.
|
||||
[fn:5] =ctime=, creation time
|
||||
|
||||
* Local Vars
|
||||
# Local Variables:
|
||||
# eval: (org-hugo-auto-export-mode)
|
||||
|
|
57
site/content/posts/neuseeland-restauration.md
Normal file
57
site/content/posts/neuseeland-restauration.md
Normal file
|
@ -0,0 +1,57 @@
|
|||
+++
|
||||
title = "Neuseeland Restauration"
|
||||
author = ["Valentin Boettcher"]
|
||||
date = 2021-08-03T14:53:00+02:00
|
||||
categories = ["Uncategorized"]
|
||||
draft = false
|
||||
+++
|
||||
|
||||
Zwar lagen mir die Neuseeland-Blog posts als `markdown` quelle vor,
|
||||
jedoch hatte ich den Erstellungszeitpunk unvorteilhafter Weise aus den
|
||||
Dateisystem-Metadaten[^fn:1] ausgelesen. Nach der Neuinstallation meines
|
||||
servers vor ein paar Jahren waren diese Metadaten vollends verloren.
|
||||
|
||||
Meine erste Idee war zu versuchen die Zeitpunkte anhand der Email
|
||||
Newsletter zu rekonstruieren. Auf diesem Wege versprach ich mir jedoch
|
||||
keinen baldigen Erfolg da mein eigenes Email Archiv nicht soweit
|
||||
zurueckreicht.
|
||||
|
||||
Zu meiner grossen Freude war letztendlich gar keine aufwaendige
|
||||
Archeologie notwendig, da ich damals ausversehen einmal meinen Blog
|
||||
Index in `git` eingecheckt hatte.
|
||||
|
||||
```shell
|
||||
$ git show b1cf78b7182f0364343d2a87a1b361e7dc833688^1:data/indexes/post.json
|
||||
```
|
||||
|
||||
Und schon hattte ich die ganze Suppe (sogar vollstaendig) in einem
|
||||
maschinenlesbaren Format.
|
||||
|
||||
Ein wenig python verwandelte das ganze in das neue Blog format.
|
||||
|
||||
```python
|
||||
import sys
|
||||
import json
|
||||
import datetime
|
||||
|
||||
with open(sys.argv[1], "r") as f:
|
||||
data = json.load(f)
|
||||
|
||||
for post in data:
|
||||
export_name = (post["content"]).split("/")[-1][:-5]
|
||||
with open(post["content"][1:], "r") as cont:
|
||||
content = cont.read()
|
||||
date = datetime.datetime.strptime(post["created"], "%Y-%m-%dT%H:%M:%S.%fZ")
|
||||
print(
|
||||
f"""
|
||||
*** {post["title"]}
|
||||
:PROPERTIES:
|
||||
:EXPORT_FILE_NAME: {export_name}
|
||||
:EXPORT_DATE: [{date}]
|
||||
:END:
|
||||
{content}""")
|
||||
```
|
||||
|
||||
Und damit koennt ihr nun unter [Neuseeland](posts/.org) die alten posts lesen.
|
||||
|
||||
[^fn:1]: `ctime`, creation time
|
Loading…
Add table
Reference in a new issue