commit 97d4a2eb6c8b74930c9a2c30f134ea2979c842a1
Author: Stephen Gregoratto <dev@sgregoratto.me>
Date: Sun, 8 Sep 2019 22:41:41 +1000
initial commit
Diffstat:
11 files changed, 391 insertions(+), 0 deletions(-)
diff --git a/Makefile b/Makefile
@@ -0,0 +1,26 @@
+include posts
+
+SERVER = liquid@www.sgregoratto.me
+WEBROOT = /var/www/homepage
+RSOPTS = -chavzP
+
+all: index.html blog.html atom.xml
+
+index.html: index.xml templates/post.xml
+ sblg -t templates/post.xml -co $@ index.xml
+
+blog.html: $(POSTS) templates/post.xml templates/postlist.xml
+ sblg -t templates/post.xml -L $(POSTS)
+ sblg -t templates/postlist.xml -o $@ $(POSTS)
+
+atom.xml: $(POSTS) templates/atom.xml
+ sblg -t templates/atom.xml -ao - $(POSTS) | grep -Fv "Untitled author" > $@
+
+new:
+
+
+sync: all
+ rsync $(RSOPTS) --delete atom.xml *.html css $(SERVER):$(WEBROOT)/
+
+clean:
+ rm -f *.html atom.xml
diff --git a/css/code.css b/css/code.css
@@ -0,0 +1,68 @@
+/* Background */ .chroma { background-color: #f0f0f0 }
+/* Error */ .chroma .err { }
+/* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
+/* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
+/* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
+/* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
+/* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em; }
+/* Keyword */ .chroma .k { color: #007020; font-weight: bold }
+/* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold }
+/* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold }
+/* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold }
+/* KeywordPseudo */ .chroma .kp { color: #007020 }
+/* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold }
+/* KeywordType */ .chroma .kt { color: #902000 }
+/* NameAttribute */ .chroma .na { color: #4070a0 }
+/* NameBuiltin */ .chroma .nb { color: #007020 }
+/* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold }
+/* NameConstant */ .chroma .no { color: #60add5 }
+/* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold }
+/* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold }
+/* NameException */ .chroma .ne { color: #007020 }
+/* NameFunction */ .chroma .nf { color: #06287e }
+/* NameLabel */ .chroma .nl { color: #002070; font-weight: bold }
+/* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold }
+/* NameTag */ .chroma .nt { color: #062873; font-weight: bold }
+/* NameVariable */ .chroma .nv { color: #bb60d5 }
+/* LiteralString */ .chroma .s { color: #4070a0 }
+/* LiteralStringAffix */ .chroma .sa { color: #4070a0 }
+/* LiteralStringBacktick */ .chroma .sb { color: #4070a0 }
+/* LiteralStringChar */ .chroma .sc { color: #4070a0 }
+/* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 }
+/* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic }
+/* LiteralStringDouble */ .chroma .s2 { color: #4070a0 }
+/* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold }
+/* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 }
+/* LiteralStringInterpol */ .chroma .si { color: #70a0d0; font-style: italic }
+/* LiteralStringOther */ .chroma .sx { color: #c65d09 }
+/* LiteralStringRegex */ .chroma .sr { color: #235388 }
+/* LiteralStringSingle */ .chroma .s1 { color: #4070a0 }
+/* LiteralStringSymbol */ .chroma .ss { color: #517918 }
+/* LiteralNumber */ .chroma .m { color: #40a070 }
+/* LiteralNumberBin */ .chroma .mb { color: #40a070 }
+/* LiteralNumberFloat */ .chroma .mf { color: #40a070 }
+/* LiteralNumberHex */ .chroma .mh { color: #40a070 }
+/* LiteralNumberInteger */ .chroma .mi { color: #40a070 }
+/* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 }
+/* LiteralNumberOct */ .chroma .mo { color: #40a070 }
+/* Operator */ .chroma .o { color: #666666 }
+/* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold }
+/* Comment */ .chroma .c { color: #60a0b0; font-style: italic }
+/* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic }
+/* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic }
+/* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic }
+/* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 }
+/* CommentPreproc */ .chroma .cp { color: #007020 }
+/* CommentPreprocFile */ .chroma .cpf { color: #007020 }
+/* GenericDeleted */ .chroma .gd { color: #a00000 }
+/* GenericEmph */ .chroma .ge { font-style: italic }
+/* GenericError */ .chroma .gr { color: #ff0000 }
+/* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold }
+/* GenericInserted */ .chroma .gi { color: #00a000 }
+/* GenericOutput */ .chroma .go { color: #888888 }
+/* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold }
+/* GenericStrong */ .chroma .gs { font-weight: bold }
+/* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold }
+/* GenericTraceback */ .chroma .gt { color: #0044dd }
+/* GenericUnderline */ .chroma .gl { text-decoration: underline }
+/* TextWhitespace */ .chroma .w { color: #bbbbbb }
diff --git a/css/style.css b/css/style.css
@@ -0,0 +1,66 @@
+body {
+ margin: auto;
+ max-width: 38rem;
+ padding: 2rem;
+ width: auto;
+ font-family: sans-serif;
+ font-size: 1rem;
+ border: none;
+ vertical-align: baseline;
+ text-align: justify;
+ text-justify: inter-word;
+ hyphens: auto;
+}
+header {
+ font-weight: bold;
+}
+p {
+ text-indent: 1rem;
+}
+blockquote + p, h2 + p, h3 + p, h4 + p, h5 + p, h6 + p, header + p,
+hr + p, ol + p, ul + p, table + p, p:first-child {
+ text-indent: 0;
+}
+hr {
+ border: none;
+ border-top: 1px solid;
+ height: 0;
+ margin: 1.5em auto;
+ width: 25%;
+}
+table {
+ width: 100%;
+ border-collapse: collapse;
+}
+figure {
+ text-align: center;
+}
+code {
+ font-family: monospace;
+ font-size: 9pt;
+}
+pre {
+ background-color: #f2f2f2;
+ border: 0.1rem solid #ccc;
+ border-radius: 0.5em;
+ overflow: auto;
+ word-wrap: normal;
+ font-family: monospace;
+ white-space: pre;
+ font-size: 9pt;
+ padding: 1em;
+}
+blockquote {
+ padding: 0 0 0rem 2rem;
+ margin: 0rem;
+ border-left: 0.3rem #aaa solid;
+ color: #666;
+}
+tr:nth-child(even) {
+ background-color: #f2f2f2;
+}
+@media print{
+ body{
+ max-width: none
+ }
+}
diff --git a/gpg-sync-all-pub-keys.xml b/gpg-sync-all-pub-keys.xml
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<article data-sblg-article="1">
+ <header>
+ <h1>Updating All Public Keys in GPG</h1>
+ <time datetime="2019-07-16">July 16, 2019</time>
+ </header>
+ <p>GPG and other OpenPGP implementations aren’t well known for their ease of use
+ <sup><a class="footnote" href="#fn1" id="fnref1">1</a></sup>
+ and the general view among many professional cryptographers
+ <sup><a class="footnote" href="#fn2" id="fnref2">2</a></sup>
+ is that the entire ecosystem is a dud, to be replaced with more
+ modern, specialised tools. Even when signing/encrypting emails —
+ the thing it was designed for, mind — GPG is a letdown.</p>
+ <p>Recently, <code>mutt</code> alerted me that the public key for a
+ mailing list user had expired. I sent a friendly message letting them
+ know, and received this in return:</p>
+ <blockquote>
+ <p>What keyserver did you pull from? I pushed a new expiry date at
+ least a month ago.</p>
+ </blockquote>
+ <p>So even though I set GPG to auto-download keys, it won’t update
+ them. Rather than wade through GPG’s option list, I decided it would
+ be simpler to just extract a list of public keys and feed that to
+ <code>--recv-keys</code>:</p>
+<code><pre class="chroma"><span class="cp">#!/bin/sh
+</span><span class="cp"></span><span class="c1"># The command expansion outputs a "machine readable" list of public keys</span>
+gpg --recv-keys <span class="k">$(</span>gpg --keyid-format long --list-public-keys --with-colons <span class="p">|</span>
+ grep <span class="s1">'^fpr'</span> <span class="p">|</span> cut -d <span class="s1">':'</span> -f <span class="m">10</span><span class="k">)</span></pre></code>
+ <p>Smugly, I dropped this in my <code>scripts</code> folder and called
+ it a day. Then I bothered to look at the gpg(1) manpage and found that
+ there was in fact an option for this:</p>
+<pre>'--refresh-keys'
+ Request updates from a keyserver for keys that already exist on the
+ local keyring. This is useful for updating a key with the latest
+ signatures, user IDs, etc. Calling this with no arguments will
+ refresh the entire keyring.</pre>
+ <p>This experience has made me question why I put up with this UI hell.
+ My interactions with GPG are limited to email encryption/signing
+ (sparingly) and file encryption via
+ <a href="https://www.passwordstore.org/">password-store</a>.
+ I used to sign all my commits too like a good boy, before realising
+ that nobody really checks them (especially not from little ol’ me).
+ Recently I’ve moved secure communications to
+ <a href="https://signal.org/">Signal</a> <em>because</em> of its
+ simplicity over PGP. If Filippo can get around to releasing his
+ <a href="https://age-tool.com/">age</a> tool, then I could finally
+ dispose of this broken ecosystem and fully transition to modern,
+ simpler crypto.</p>
+ <hr/>
+ <p>Update: I’ve reflected on this post a bit, and decided to remove the
+ links to my PGP key on my website. I fully believe that PGP is
+ fundamentally broken, and intend to revoke my PGP key when age is
+ released.</p>
+ <hr/>
+ <section class="footnotes" role="doc-endnotes">
+ <p>References:</p>
+ <ol>
+ <li id="fn1" role="doc-endnote">
+ <p>Take your pick:</p>
+ <ul>
+ <li><a href="https://people.eecs.berkeley.edu/~tygar/papers/Why_Johnny_Cant_Encrypt/OReilly.pdf">Why Johnny Can’t Encrypt</a></li>
+ <li><a href="https://cups.cs.cmu.edu/soups/2006/posters/sheng-poster_abstract.pdf">Why Johnny Still Can’t Encrypt</a></li>
+ <li><a href="https://arxiv.org/pdf/1510.08555.pdf">Why Johnny Still, Still Can’t Encrypt</a></li>
+ <li><a href="https://www.usenix.org/system/files/sec19fall_muller_prepub.pdf">“Johnny, you are fired!”</a></li>
+ </ul>
+ <a href="#fnref1" class="footnote-back">↩</a>
+ </li>
+ <li id="fn2" role="doc-endnote">
+ <p>Ditto:</p>
+ <ul>
+ <li><a href="https://blog.cryptographyengineering.com/2014/08/13/whats-matter-with-pgp/">Matthew Green — What’s the matter with PGP?</a></li>
+ <li><a href="https://moxie.org/blog/gpg-and-me/">Moxie Marlinspike — GPG And Me</a></li>
+ <li><a href="https://www.schneier.com/blog/archives/2016/12/giving_up_on_pg.html">Bruce Schneier — Giving Up on PGP</a></li>
+ <li><a href="https://arstechnica.com/information-technology/2016/12/op-ed-im-giving-up-on-pgp/">Filippo Valsorda — I’m throwing in the towel on PGP</a></li>
+ <li><a href="https://buttondown.email/cryptography-dispatches/archive/cryptography-dispatches-hello-world-and-openpgp/">Filippo Valsorda — OpenPGP Is Broken</a></li>
+ </ul>
+ <a href="#fnref1" class="footnote-back">↩</a>
+ </li>
+ </ol>
+ </section>
+</article>
diff --git a/index.xml b/index.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<article data-sblg-article="1">
+ <header><h1>Whoami</h1></header>
+ <p>Hello There! I’m Stephen Gregoratto, computer science student at the
+ University of Wollongong. I’m currently halfway through my course so
+ far, but I also do other things in my spare time:</p>
+ <h2>Blogging</h2>
+ <p>I run a blog called <a href="/blog.html">/var/log/trash</a>, which
+ mainly covers topics like programming, text processing and quaint
+ little UNIX things that I pick up/develop. Don’t expect intricate,
+ well detailed posts or furious updates though. Like most blogs, my
+ posts will eventually be left in the trash heap of history.</p>
+ <h2>Arch Packages</h2>
+ <p>I maintain a couple of packages on the AUR, located
+ <a href="https://aur.archlinux.org/packages/?K=KingofToasters&SeB=m">here</a>.
+ They’re mainly a mix of Go projects, UNIX shell tools, text
+ processing tools or other cool things I find. If anything is wrong
+ with them, feel free to yell at me in the comment section.</p>
+ <h2>Contact</h2>
+ <p>I have three main email addresses:</p>
+ <dl>
+ <dt><a href="mailto:personal@sgregoratto.me">personal@</a></dt>
+ <dd>For casual inquiries.</dd>
+ <dt><a href="mailto:dev@sgregoratto.me">dev@</a></dt>
+ <dd>Used to send/receive patches for the software projects I work on.</dd>
+ <dt><a href="mailto:work@sgregoratto.me">work@</a></dt>
+ <dd>Strictly for employment or work-related information.</dd>
+ </dl>
+</article>
diff --git a/new b/new
@@ -0,0 +1,51 @@
+#!/usr/bin/env perl
+use warnings;
+use strict;
+use utf8;
+use feature qw(say);
+use POSIX qw(strftime);
+use Lingua::EN::Titlecase::Simple 'titlecase';
+use XML::Writer;
+
+my $title;
+my $fname;
+my @time;
+my $isoTime = "%FT%TZ";
+my $fmtTime = "%B %e, %Y";
+my $postFile;
+my $xml;
+
+if (not defined $ARGV[0]) {
+ die "usage: new \"name\"\n";
+}
+
+$title = titlecase $ARGV[0];
+
+$fname = $ARGV[0];
+$fname =~ tr/A-Za-z0-9/-/cs;
+$fname .= ".xml";
+
+open($postFile, '>', $fname)
+ or die "could not open $fname for reading\n";
+
+$xml = XML::Writer->new(OUTPUT => $postFile,
+ DATA_MODE => 1,
+ DATA_INDENT => 1);
+
+@time = localtime();
+$isoTime = strftime($isoTime, @time);
+$fmtTime = strftime($fmtTime, @time);
+$fmtTime =~ tr/ / /s;
+
+$xml->xmlDecl("utf-8");
+$xml->startTag("article", "data-sblg-article" => 1);
+ $xml->startTag("header");
+ $xml->dataElement("h1", $title);
+ $xml->dataElement("time", $fmtTime, "datetime" => $isoTime);
+ $xml->endTag("header");
+$xml->endTag("article");
+$xml->end();
+
+close($postFile);
+
+say $fname;
diff --git a/posts b/posts
@@ -0,0 +1,4 @@
+# vim: ft=make
+POSTS = \
+ gpg-sync-all-pub-keys.xml
+
diff --git a/templates/atom.xml b/templates/atom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<feed xmlns="http://www.w3.org/2005/Atom">
+ <title>/var/log/trash</title>
+ <link href="https://www.sgregoratto.me/blog.html" />
+ <link href="https://www.sgregoratto.me/atom.xml" rel="self" />
+ <id>https://www.sgregoratto.me/blog.html</id>
+ <author>
+ <name>Stephen Gregoratto</name>
+ <email>personal@sgregoratto.me</email>
+ </author>
+ <updated />
+ <entry data-sblg-forall="1" data-sblg-entry="1" data-sblg-content="1" data-sblg-altlink="1"
+ data-sblg-altlink-fmt="https://www.sgregoratto.me/${sblg-base}.html" />
+</feed>
diff --git a/templates/post.xml b/templates/post.xml
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<html lang="en-AU">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>${sblg-titletext}</title>
+ <link rel="stylesheet" href="/css/style.css"/>
+ <link rel="stylesheet" href="/css/code.css"/>
+ <link rel="alternate" href="atom.xml" type="application/atom+xml" title="Atom Feed" />
+ </head>
+ <body>
+ <article data-sblg-article="1" data-sblg-permlink="0" />
+ <nav>
+ <a href="/">Home</a>
+ <a href="/blog.html">Blog</a>
+ <a href="/atom.xml">Feed</a>
+ </nav>
+ </body>
+</html>
diff --git a/templates/postlist.xml b/templates/postlist.xml
@@ -0,0 +1,24 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes" />
+ <title>/var/log/trash</title>
+ <link rel="stylesheet" href="/css/style.css"/>
+ <link rel="stylesheet" href="/css/code.css"/>
+ <link rel="alternate" href="atom.xml" type="application/atom+xml" title="Atom Feed" />
+ </head>
+ <body>
+ <header>
+ <h1>/var/log/trash</h1>
+ </header>
+ <table>
+ <nav data-sblg-nav="1" data-sblg-navxml="1">
+ <tr>
+ <td><a href="/${sblg-base}.html">${sblg-title}</a></td>
+ <td><time datetime="${sblg-date}">${sblg-datetime-fmt|%B %d, %Y}</time></td>
+ </tr>
+ </nav>
+ </table>
+ </body>
+</html>
diff --git a/templates/sitemap.xml b/templates/sitemap.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes"?>
+<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
+<nav data-sblg-nav="1" data-sblg-navxml="1">
+ <url>
+ <loc>https://www.sgregoratto.me/${sblg-base}.html</loc>
+ <lastmod>${sblg-datetime}</lastmod>
+ </url>
+</nav>
+</urlset>