This commit is contained in:
Marc Beninca 2025-02-18 22:05:22 +01:00
parent 2a32fee946
commit 7c5916ceb0
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F
3 changed files with 47 additions and 44 deletions

View file

@ -197,7 +197,7 @@ Last update: {time.strftime('%Y/%m/%d %H:%M:%S')}
</html>
"""
css_file = os.path.join(css, "index.css")
css_text = f"""\
css_text = """\
@media screen and (max-aspect-ratio: 10/16) {{
body {{
@ -329,7 +329,7 @@ border-width: 1px;
}}
"""
js_file = os.path.join(js, "index.js")
js_text = f"""\
js_text = """\
function check(tab) {{
const tabs = tab.split('/')
let id = 'tab'
@ -388,11 +388,11 @@ function swap() {{
tabs = {
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"about": f"""\
"about": """\
About
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"bio": f"""\
"bio": """\
<h1>Marc Beninca</h1>
Welcome to a recap attempt of my IT life!
@ -420,13 +420,13 @@ I had the occasion to develop projects in:
To be continued
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"books": f"""\
"books": """\
<ul>
<li><a href="https://www.tradepub.com">TradePub</a></li>
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"buy": f"""\
"buy": """\
<ul>
<li><a href="https://www.i-comparateur.com">i-comparateur</a></li>
</ul>
@ -453,13 +453,13 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"comments": f"""\
"comments": """\
<ul>
<li><a href="https://www.youtube.com/@LogicallyAnswered/videos">Logically Answered</a></li>
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"cv": f"""\
"cv": """\
<ul class="cards">
<li class="card"><a href="pdf/cv.en.pdf">
<img src="img/en.svg" /><br />English</a></li>
@ -468,7 +468,7 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"repos": f"""\
"repos": """\
<ul>
<li><a href="https://forge.rwx.work/marc.beninca">RWX</a></li>
</ul><ul>
@ -511,7 +511,7 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"health": f"""\
"health": """\
<ul>
<li><a href="https://www.youtube.com/@chubbyemu/videos">Chubby Emu</a></li>
<li><a href="https://www.youtube.com/@drekberg/videos">Sten Ekberg</a></li>
@ -526,7 +526,7 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"id": f"""\
"id": """\
<table>
<tr><th colspan="2">OpenPGP</th><td colspan="3" rowspan="4"><img src="img/marc.jpeg" /></td></tr>
@ -581,7 +581,7 @@ To be continued…
</table>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"learn": f"""\
"learn": """\
<ul>
<li><a href="https://roadmap.sh">Roadmap</a></li>
<li><a href="https://teachyourselfcs.com">Teach Yourself Computer Science</a></li>
@ -599,7 +599,7 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"links": f"""\
"links": """\
<ul>
<li><a href="https://marc-beninca.8b.io">8bio</a></li>
<li><a href="https://allmylinks.com/marc-beninca">AllMyLinks</a></li>
@ -641,7 +641,7 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"music": f"""\
"music": """\
<ul>
<li><a href="https://www.youtube.com/watch?v=_ITiwPMUzho">3 AM Coding Session</a></li>
</ul>
@ -668,7 +668,7 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"profiles": f"""\
"profiles": """\
<ul class="cards">
<li class="card"><a href="https://forge.rwx.work/marc.beninca">
<img src="img/ForgeJo.svg" /><br />ForgeJo</a></li>
@ -695,7 +695,7 @@ To be continued…
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"lsgm": f"""\
"lsgm": """\
<h1>Live Scan Grub Menu</h1>
Setup a whole EFI System Partition:
<ul>
@ -709,7 +709,7 @@ BASH experimenting:
<li><a href="https://youtu.be/mx2lhm7qClc">2023/05/04: 1st boot into QCOW storage with encrypted data partition</a></li>
</ul>
""",
"ofsp": f"""\
"ofsp": """\
<h1>Operating File System Profile</h1>
Build from mirror a full operating system bootable file image:
<ul>
@ -732,7 +732,7 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"social": f"""\
"social": """\
<ul>
<li><a href="https://calckey.org">Calckey</a></li>
<li><a href="https://joinmastodon.org">Mastodon</a></li>
@ -761,7 +761,7 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"software": f"""\
"software": """\
<ul>
<li><a href="https://developer.puri.sm/Librem5">Librem 5</a></li>
</ul>
@ -785,14 +785,14 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"style": f"""\
"style": """\
<ul>
<li><input type="checkbox" id="dark" onclick="swap()">Dark</input></li>
<li><input type="checkbox" id="debug" onclick="debug()">Debug</input></li>
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"tasks": f"""\
"tasks": """\
<ul>
<li>categorize music</li>
</ul>
@ -807,7 +807,7 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"tbm": f"""\
"tbm": """\
<ul class="cards">
<li class="card"><a href="https://montempsreel.infotbm.com/arret/1224">Bertin B</a></li>
<li class="card"><a href="https://montempsreel.infotbm.com/arret/7">Bertin V</a></li>
@ -818,7 +818,7 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"trips": f"""\
"trips": """\
<ul>
<li>Belgium<ul>
<li>Brussels</li>
@ -862,7 +862,7 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"vegan": f"""\
"vegan": """\
<ul>
<li><a href="https://www.youtube.com/@CheapLazyVegan/videos">Cheap Lazy Vegan</a></li>
<li><a href="https://www.youtube.com/@gazoakleychef/videos">Gaz Oakley</a></li>
@ -888,7 +888,7 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"others": f"""\
"others": """\
<ul>
<li><a href="https://bsky.app/profile/marc-beninca.bsky.social">Blue Sky</a></li>
<li><a href="https://buymeacoffee.com/marc.beninca">Buy Me A Coffee</a></li>
@ -920,7 +920,7 @@ BASH experimenting:
</ul>
""",
# ⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅⋅
"unsorted": f"""\
"unsorted": """\
<ul>
<li><a href="https://foss.events">FOSS Events</a></li>
</ul>

View file

@ -1,4 +1,5 @@
import os
from pathlib import Path
import subprocess
PORT = 22
@ -12,13 +13,13 @@ class PubNix:
def __init__(
self,
dn,
ssh=None,
port=PORT,
user=USER,
root=ROOT,
dir=DIR,
web=None,
sub=None,
ssh: str = None,
port: int = PORT,
user: str = USER,
root: str = ROOT,
dir: bool = DIR,
web: str = None,
sub: bool = None,
):
self.dn = dn
self.ssh = f"{ssh}.{self.dn}" if ssh else self.dn
@ -32,9 +33,9 @@ class PubNix:
else:
self.fqdn = self.web
self.context = f"~{self.user}"
self.path = os.path.join(self.root, self.fqdn) if dir else self.root
self.path = (Path(self.root) / self.fqdn) if dir else self.root
self.target = f"{self.user}@{self.ssh}:{self.path}"
self.url = [f"{PROTOCOL}:", str(), self.fqdn]
self.url = [f"{PROTOCOL}:", "", self.fqdn]
if self.context:
self.url.append(self.context)
self.url = "/".join(self.url)
@ -57,11 +58,11 @@ class PubNix:
**kwargs,
)
def disk_free(self):
def disk_free(self) -> str:
process = self.capturun("df", "-h", os.curdir)
return process.stdout.decode("UTF-8").strip()
def os(self):
def os(self) -> str:
ps = self.capturun("cat", "/etc/os-release")
if ps.returncode == 0:
for line in ps.stdout.decode("UTF-8").strip().split(os.linesep):
@ -70,5 +71,6 @@ class PubNix:
else:
return self.capturun("uname", "-sr").stdout.decode("UTF-8").strip()
def __str__(self):
def __str__(self) -> str:
"""Return target & url."""
return os.linesep.join([self.target, self.url])

13
sync.py
View file

@ -1,8 +1,9 @@
#! /usr/bin/env python3
from logging import log
import os
import subprocess
from logging import log
from pathlib import Path
import pubnix
@ -64,14 +65,14 @@ def sync(root, pubnix, exclude=None):
os.path.join(root, ""),
]
for item in exclude:
args.extend(["--exclude", os.path.join(str(), item)])
args.append(os.path.join(pubnix.target, str()))
args.extend(["--exclude", os.path.join("", item)])
args.append(os.path.join(pubnix.target, ""))
subprocess.call(args, stdout=subprocess.DEVNULL)
def main():
root = os.path.dirname(os.path.realpath(__file__))
root = os.path.join(root, "out", "web")
def main() -> None:
"""Synchronize content on remote pubnixes."""
root = Path(os.path.realpath(__file__)).parent / "out" / "web"
for pn in PUBNIXES:
log()
log(pn)