From 16655c00e0a84f6bfe58870c918fbfc016fe58ec Mon Sep 17 00:00:00 2001 From: jaseg Date: Mon, 30 Jun 2025 15:35:25 +0200 Subject: Fix hugo layout in hugo > ~0.130.0 For some reason, newer hugo versions have trouble with .summary, and on some pages where .summary is not defined in the page header metadata, when rendering the page as a preview card, hugo swallows the card's closing tag. Such a weird bug, we now just work around it by explicitly setting the .summary meta on pages that cause this bug(?) to surface. --- content/blog/8seg/index.rst | 8 ++++---- content/blog/hsm-basics/index.rst | 6 +++--- content/blog/ihsm-worlds-first-diy-hsm/index.rst | 3 +++ .../jupyterlab-notebook-file-oneliner/index.rst | 21 +++++++++++++++++++++ .../jupyterlab_notebook_file_oneliner/index.rst | 21 --------------------- content/blog/kicad-mesh-plugin/index.rst | 4 ++++ content/blog/multichannel-led-driver/index.rst | 4 ++++ content/blog/private-contact-discovery/index.rst | 5 ++--- content/blog/telekom-gpon-sfp/index.rst | 3 +++ content/blog/wifi-led-driver/index.rst | 7 +++++++ deploy.py | 3 ++- themes/conspiracy/layouts/_partials/card.html | 2 +- 12 files changed, 54 insertions(+), 33 deletions(-) create mode 100644 content/blog/jupyterlab-notebook-file-oneliner/index.rst delete mode 100644 content/blog/jupyterlab_notebook_file_oneliner/index.rst diff --git a/content/blog/8seg/index.rst b/content/blog/8seg/index.rst index c34a959..6b8d676 100644 --- a/content/blog/8seg/index.rst +++ b/content/blog/8seg/index.rst @@ -1,11 +1,11 @@ --- -title: "8seg" +title: "8seg Technical Overview" date: 2023-12-26T15:26:00+01:00 +summary: > + 8seg is a large-scale LED light art installation that displays text on a 1.5 meter high, 30 meter wide + 8-segment display made from cheap LED tape. --- -8seg Technical Overview -======================= - Prologue -------- diff --git a/content/blog/hsm-basics/index.rst b/content/blog/hsm-basics/index.rst index 306edcd..74b7275 100644 --- a/content/blog/hsm-basics/index.rst +++ b/content/blog/hsm-basics/index.rst @@ -1,11 +1,11 @@ --- title: "Hardware Security Module Basics" date: 2019-05-17T15:29:20+08:00 +summary: > + I gave a short introduction into Hardware Security Modules at our university workgroup, including an overview on + interesting research directions. --- -Hardware Security Modules and Security Research and Cryptography -================================================================ - On May 17 2019 I gave a short presentation on the fundamentals of hardware security modules at the weekly seminar of Prof. Mori's security research working group at Waseda University. The motivation for this was that outside of low-level hardware security people and people working in the financial industry HSMs are not thought about that often. In diff --git a/content/blog/ihsm-worlds-first-diy-hsm/index.rst b/content/blog/ihsm-worlds-first-diy-hsm/index.rst index 0932fc9..22cf8e4 100644 --- a/content/blog/ihsm-worlds-first-diy-hsm/index.rst +++ b/content/blog/ihsm-worlds-first-diy-hsm/index.rst @@ -1,6 +1,9 @@ --- title: "New Paper on Inertial Hardware Security Modules" date: 2021-11-23T23:42:20+01:00 +summary: > + Paper announcement: We have published a paper on how you can DIY a tamper-sensing hardware security module from any + single-board computer using a moving tamper-sensing mesh made from cheap PCBs. --- World's First DIY HSM diff --git a/content/blog/jupyterlab-notebook-file-oneliner/index.rst b/content/blog/jupyterlab-notebook-file-oneliner/index.rst new file mode 100644 index 0000000..5a543de --- /dev/null +++ b/content/blog/jupyterlab-notebook-file-oneliner/index.rst @@ -0,0 +1,21 @@ +--- +title: "Getting the .ipynb Notebook File Location From a Running Jupyter Lab Notebook" +date: 2025-06-29T23:42:00+01:00 +summary: > + If you need to get the path of the ipynb file in a running #Jupyter notebook, this one-liner will do the trick. It + seems chatgpt is confused, and a bunch of other approaches on the web look fragile and/or unnecessarily complex to + me. +--- + +If you need to get the path of the ipynb file in a running #Jupyter notebook, this one-liner will do the trick. It seems +chatgpt is confused, and a bunch of other approaches on the web look fragile and/or unnecessarily complex to me. + +.. code:: python + + import sys + Path(json.loads(Path(sys.argv[-1]).read_bytes())['jupyter_session']) + +The way this works is that for each notebook, jupyter starts a python "kernel" process that actually runs the notebook's +code. That kernel gets a json file with info on the notebook's location on the disk passed through its command line. +Since we're running code in that exact python process, we can just grab that json file from sys.argv, and read it +ourselves. diff --git a/content/blog/jupyterlab_notebook_file_oneliner/index.rst b/content/blog/jupyterlab_notebook_file_oneliner/index.rst deleted file mode 100644 index 8885c4c..0000000 --- a/content/blog/jupyterlab_notebook_file_oneliner/index.rst +++ /dev/null @@ -1,21 +0,0 @@ ---- -title: "Getting the .ipynb Notebook File Location From a Running Jupyter Lab Notebook" -date: 2025-06-30T23:42:00+01:00 -summary: > - If you need to get the path of the ipynb file in a running #Jupyter notebook, this one-liner will do the trick. It - seems chatgpt is confused, and a bunch of other approaches on the web look fragile and/or unnecessarily complex to - me. ---- - -If you need to get the path of the ipynb file in a running #Jupyter notebook, this one-liner will do the trick. It seems -chatgpt is confused, and a bunch of other approaches on the web look fragile and/or unnecessarily complex to me. - -.. code:: python - - import sys - Path(json.loads(Path(sys.argv[-1]).read_bytes())['jupyter_session']) - -The way this works is that for each notebook, jupyter starts a python "kernel" process that actually runs the notebook's -code. That kernel gets a json file with info on the notebook's location on the disk passed through its command line. -Since we're running code in that exact python process, we can just grab that json file from sys.argv, and read it -ourselves. diff --git a/content/blog/kicad-mesh-plugin/index.rst b/content/blog/kicad-mesh-plugin/index.rst index 5ba576a..0969bf3 100644 --- a/content/blog/kicad-mesh-plugin/index.rst +++ b/content/blog/kicad-mesh-plugin/index.rst @@ -1,6 +1,10 @@ --- title: "Kicad Mesh Plugin" date: 2020-08-18T13:15:39+02:00 +summary: > + I wrote a little KiCad plugin that you can use to create security meshes, heaters and other things where you need + one or more traces cover the entire surface of a PCB. The plugin supports arbitrary PCB shapes, cutouts, and can + route around existing footprints and traces on the PCB. --- .. raw:: html diff --git a/content/blog/multichannel-led-driver/index.rst b/content/blog/multichannel-led-driver/index.rst index c4e17b8..f157458 100644 --- a/content/blog/multichannel-led-driver/index.rst +++ b/content/blog/multichannel-led-driver/index.rst @@ -1,6 +1,10 @@ --- title: "32-Channel LED tape driver" date: 2018-05-02T11:31:14+02:00 +summary: > + Together, a friend and I outfitted the small staircase at Berlin's Chaos Computer Club with nice, shiny RGB-WW LED + tape for ambient lighting. For this installation, I made a 32-channel LED driver that achieves high dynamic range on + all 32 channels using a cheap microcontroller by using Binary Code Modulation. --- Theoretical basics diff --git a/content/blog/private-contact-discovery/index.rst b/content/blog/private-contact-discovery/index.rst index 797de50..386bd6e 100644 --- a/content/blog/private-contact-discovery/index.rst +++ b/content/blog/private-contact-discovery/index.rst @@ -1,11 +1,10 @@ --- title: "Private Contact Discovery" date: 2019-06-22T10:30:00+08:00 +summary: > + I gave a short introduction into Private Contact Discovery protocols at our university workgroup. --- -Private Contact Discovery -========================= - Private Contact Discovery (PCD) is the formal name for the problem modern smartphone messenger applications have on installation: Given a user's address book, find out which of their contacts also use the same messenger without the messenger's servers learning anything about the user's address book. The widespread non-private way to do this is to diff --git a/content/blog/telekom-gpon-sfp/index.rst b/content/blog/telekom-gpon-sfp/index.rst index 3d85732..d22894a 100644 --- a/content/blog/telekom-gpon-sfp/index.rst +++ b/content/blog/telekom-gpon-sfp/index.rst @@ -1,6 +1,9 @@ --- title: "Ubiquiti EdgeRouter on Deutsche Telekom GPON Fiber" date: 2022-02-21T20:00:00+01:00 +summary: > + Short tutorial on getting a Deutsche Telekom GPON internet connection running using a SFP ONU unit in an Ubiquiti + EdgeRouter. --- Disclaimer diff --git a/content/blog/wifi-led-driver/index.rst b/content/blog/wifi-led-driver/index.rst index f352fe6..04fcaf6 100644 --- a/content/blog/wifi-led-driver/index.rst +++ b/content/blog/wifi-led-driver/index.rst @@ -1,6 +1,13 @@ --- title: "Wifi Led Driver" date: 2018-05-02T11:31:03+02:00 +summary: > + After the `multichannel LED driver`_ was completed, I was just getting used to controlling LEDs at 14-bit resolution. + I liked the board we designed in this project, but at 32 channels it was a bit large for most use cases. Sometimes I + just want to pop a piece of LED tape or two somewhere, but I don't need a full 32 channels of control. I ended up + thinking that a smaller version of the 32-channel driver that didn't require a separate control computer would be + handy. So I sat down and designed a variant of the design with only 8 channels instead of 32 and an on-board ESP8266_ + module instead of the RS485_ transceiver for WiFi connectivity. --- Project motivation diff --git a/deploy.py b/deploy.py index 129d53b..f0cab5c 100644 --- a/deploy.py +++ b/deploy.py @@ -18,7 +18,8 @@ if __name__ == '__main__': try: env = dict(os.environ) env['PATH'] = f'{Path("hack").absolute()}:{env["PATH"]}' - subprocess.run(['hugo'], cwd=tmpdir, check=True, env=env) + hugo = os.environ.get('HUGO', 'hugo') + subprocess.run([hugo], cwd=tmpdir, check=True, env=env) subprocess.run([pagefind, '--site', 'public'], cwd=tmpdir, check=True, env=env) subprocess.run(['git', 'add', '--force', 'public'], cwd=tmpdir, check=True) write_tree = subprocess.run(['git', 'write-tree', '--prefix=public/'], cwd=tmpdir, check=True, capture_output=True) diff --git a/themes/conspiracy/layouts/_partials/card.html b/themes/conspiracy/layouts/_partials/card.html index 21eeebf..b158e59 100644 --- a/themes/conspiracy/layouts/_partials/card.html +++ b/themes/conspiracy/layouts/_partials/card.html @@ -3,7 +3,7 @@ {{- if and .Date (not (isset (index .Ancestors 0).Params "hide_date")) }}{{ .Date.Format "2006-01-02" }}{{- end }}
- {{ .Summary | safeHTML }} + {{ .Summary }} Read more
-- cgit