all repos — h3rald @ 6b42b35e5b56074a84ca61395a4956a25a4d194c

The sources of https://h3rald.com

Added spells, CSS tweaks.
h3rald h3rald@h3rald.com
Sat, 24 Feb 2024 21:57:53 +0100
commit

6b42b35e5b56074a84ca61395a4956a25a4d194c

parent

6d1dc4dc86b95bcb7884a2be4d52b1f2d4f77864

M assets/styles/style.cssassets/styles/style.css

@@ -6,6 +6,7 @@ cursor: pointer;

float: right; margin: 2px; margin-right: 10px; + margin-top: -5px; } .theme-switcher-icon svg {

@@ -22,9 +23,9 @@ :root {

--html-font-size: 18px; --base-font-size: 1rem; - --line-height: 1.5; + --line-height: 2rem; --scale-factor: 1.3333; - --leading: 1.5rem; + --leading: 2rem; --letter-spacing: 0.05em; }

@@ -346,7 +347,7 @@ padding-bottom: calc(var(--leading) * 0.25);

} .container-fluid { - padding: 0 calc(var(--leading) * 0.5); + padding: 0 calc(var(--leading) * 0); } time {

@@ -379,9 +380,10 @@ position: fixed;

top: 28px; right: 0; left: 0; + padding: 0.5rem 0; background-color: var(--primary-background); box-shadow: 0 16px 16px -16px #000; - margin-top: -30px; + margin-top: -40px; } footer,

@@ -391,6 +393,10 @@ max-width: 1024px;

margin: auto; } +footer { + padding: 1rem; +} + .main-content { margin-top: 20px; }

@@ -405,7 +411,7 @@

/* End fixed header */ .main-header h1 { - margin: 0 0.5rem; + margin: 0 0.5rem 0.5rem 0.5rem; height: 40px; text-align: center; }

@@ -560,7 +566,6 @@ color: var(--heading-text-color);

} .primary-subtitle { - margin-top: 0.5rem; color: var(--secondary-text-color); }
A contents/grimoire/create-self-signed-tls-cert.md

@@ -0,0 +1,14 @@

+----- +id: create-self-signed-tls-cert +title: "Create a self-signed TLS certificate" +subtitle: "And also a new certificate key" +content-type: spell +----- + +This is all you need to create a self-signed X509 certificates that lasts for 365 days, and a 2048-bit-long certificate key: + +```bash +sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt +``` + +This will ask you a few questions which should be self-explanatory. When asked about the FQDN, you can use the IP address of the server.
A contents/grimoire/create-symlink.md

@@ -0,0 +1,14 @@

+----- +id: create-symlink +title: "Create a symbolic link" +subtitle: "Because I never remember if the source file comes first or second..." +content-type: spell +----- + +The existing file you want to link to comes first, and the new file that links to it comes second. + +Oh, and don't forget `-s`. + +```bash +ln -s <source_file> <myfile> +```
A contents/grimoire/remove-cr-characters.md

@@ -0,0 +1,14 @@

+----- +id: remove-cr-characters +title: "Remove carriage return characters" +subtitle: "These pesky ^M characters can be seen when using Vim every so often" +content-type: spell +----- + +Vim will add these if you created a file on Windows, and you try to open it on a *nix machine. Apparently you can [avoid this entirely](https://vim.fandom.com/wiki/File_format) with some extra configuration, but if it happens, just ente the following command: + +```vim +:s/^M$// +``` + +(press `CTRL+V` and `CTRL+M` to enter the `^M` thingie)
M templates/_header.mustachetemplates/_header.mustache

@@ -6,9 +6,9 @@ <img src="/images/logo-dark.svg" alt="H3RALD" class="logo dark-mode-hide">

</a> </h1> <div class="navlinks"> - <a href="/now" class="navbar-link">now</a> - &middot; <a href="/about/" class="navbar-link">about</a> + &middot; + <a href="/now" class="navbar-link">now</a> &middot; <a href="/articles" class="navbar-link">articles</a> &middot;
M templates/grimoire.mustachetemplates/grimoire.mustache

@@ -10,11 +10,16 @@ {{> _header}}

</div> </div> <div class="row main-content"> - <div class="col-xs-12"> <article class="{{content-type}} box content"> {{> _page_header}} - <p>This is the old grimoire of Herald. It contains <strong>{{grimoire-count}}</strong> powerful spells and enchantments to unlock the secret magic of Unix or the dark curses of Windows.</p> <div id="body-text" class="hyphenate"> + <p>A <em>grimoire</em> is a book of spells. If you &mdash;like me in the '90s&mdash; ever played <a href="https://en.wikipedia.org/wiki/Magic:_The_Gathering">Magic: The Gathering</a>, + then you'll already know that.</p> + <p>However, in this case we are not talking about conjuring unicorns or moving objects using telekinesis, but rather unlocking the + forbidden powers of the command line. The <strong>{{grimoire-count}}</strong> <em>spells</em> contained in these pages are powerful commands, scripts, and similar incantations + that help me every so often to complete a task in a fast, efficient way.</p> + + <h3>List of Spells</h3> <ul> {{#spells}} <li><a href="/{{rawid}}">{{title}}</a></li>

@@ -22,7 +27,6 @@ {{/spells}}

</ul> </div> </article> - </div> </div> <div class="row"> <div class="col-xs-12">
M templates/home.mustachetemplates/home.mustache

@@ -5,20 +5,16 @@ <body>

{{> _theme_switcher}} <div class="main container-fluid themed-content"> {{> _header}} - <div class="main-content"> - <div class="row"> - <div class="box content home-content"> - <article class="page"> - <h2>Welcome</h2> - <div class="body-text"> - <p>Welcome to H3RALD.com. This site used to be a fairly active blog back in the early 2000s, but sadly I progressively lost interest in writing articles, perhaps because I didn't have anything new to write about that you couldn't find elsewhere. However, all the content is still here, so feel free to browse through the <a href="/articles">articles</a> section.</p> - <p>As I progressively neglected writing, I started creating more and more small programs and tools to perform common tasks, mostly using the <a href="https://nim-lang.org" target="_blank">Nim</a> programming language. They are all open source, they all have a dedicated project page here, and there's some pretty decent documentation for most of them. You can find them all in the <a href="/projects">projects</a> section.</p> - <p>At any rate, thank you for stopping by!</p> - <p>&mdash; Fabio</p> - </div> - </article> - </div> + <div class="row main-content"> + <article class="page box content"> + <h2>WELCOME!</h2> + <div class="body-text"> + <p>Welcome to H3RALD.com. This site used to be a fairly active blog back in the early 2000s, but sadly I progressively lost interest in writing articles, perhaps because I didn't have anything new to write about that you couldn't find elsewhere. However, all the content is still here, so feel free to browse through the <a href="/articles">articles</a> section.</p> + <p>As I progressively neglected writing, I started creating more and more small programs and tools to perform common tasks, mostly using the <a href="https://nim-lang.org" target="_blank">Nim</a> programming language. They are all open source, they all have a dedicated project page here, and there's some pretty decent documentation for most of them. You can find them all in the <a href="/projects">projects</a> section.</p> + <p>At any rate, thank you for stopping by!</p> + <p>&mdash; Fabio</p> </div> + </article> </div> <div class="row sidebar"> {{> _panels}}