Hugo generating content in memory

Software

This may be a little “inside baseball” as my American friends would say, but it was something I learned.

This site has been statically generated since 2013, originally with Jekyll and now with Hugo. Avoiding WordPress or a fully blown CMS means the site is easier to maintain and is fast. The only obvious downside is the time to generate the content each time.

(As an aside, if Jekyll takes too long to render your 4000+ blog posts too, try Hugo. Go being orders of magnitude faster than Ruby shouldn’t have come as a shock, but wow is Hugo fast. It also has nothing whatsoever to do with the fragrence).

I generate content on the server, but I was also wary of wearing out my SSD with thouands of small file writes each time I previewed a change. So I wrote a couple of terrible shell scripts that:

  1. Created and formatted a new RAM disk
  2. Symlinked Hugo’s public folder to the disk
  3. Generated a site preview with Hugo
  4. Destroyed the disk after terminating Hugo

Since upgrading to Hugo 0.16 though, I noticed nothing was being written to the RAM disk. I thought it was a bug in my script; maybe the symlink wasn’t being created.

Turns out, the answer was right in the shell:

$ hugo server --watch
Started building site
[..]
Serving pages from memory.

Huzzah! And from their docs:

‘hugo server’ will avoid writing the rendered and served content to disk, preferring to store it in memory.

This makes me happy. It’s also another reason to try Hugo if you haven’t yet.


Covering laptop cameras

Hardware

Leading Daring Fireball prognosticator John Gruber had a rare slip when admitting he was less than enthusiastic about covering laptop cameras with tape:

I think this is nonsense. Malware that can surreptitiously engage your camera can do all sort of other nefarious things. If you can’t trust your camera, you can’t trust your keyboard either. Follow best practices to avoid malware in the first place — don’t install Flash Player, and don’t install software from sketchy sources — and you’ll almost certainly be fine.

This is conflating security with privacy. It’d be bad enough knowing our banking details and other credentials were compromised, without knowing some creep was watching us during the ordeal too.

I don’t think getting access to email accounts was the primary concern of children and their parents in Pennsylvania when their webcams were remotely accessed in 2010:

According to the lawsuit filed by a high school student and his parents, the Lower Merion School District of Ardmore, Pa. has spied on students and families by “indiscriminate use of and ability to remotely activate the webcams incorporated into each laptop issued to students by the School District.”

Michael and Holly Robbins of Penn Valley, Pa., said they first found out about the alleged spying last November after their son Blake was accused by a Harriton High School official of “improper behavior in his home” and shown a photograph taken by his laptop.

I use whole drive encryption. I also have a separate password for my login and 1Password, and either carry the device with me or stash it in a locked apartment. Security is about layers, so covering your laptop camera is perfectly rational.


Rubenerd Show 347: The Harrison Ford episode

Show

Rubenerd Show 347

Podcast: Play in new window · Download

53:33 – Harrison Ford has done a lot of movies (GET ME OFF THIS PLANE). Also plummeting down a lift shaft, making the mistake of asking a question online, lack of empathy over anonymity, nostalgia for the early days of Twitter, Jimbo listener feedback, American education nomenclature, and drops of Jupiter’s clouds. Music by the fabulously talented Who-ha once more.

Recorded in Sydney, Australia. Licence for this track: Creative Commons Attribution 3.0. Attribution: Ruben Schade.

Released July 2016 on The Overnightscape Underground, an Internet talk radio channel focusing on a freeform monologue style, with diverse and fascinating hosts.

Subscribe with iTunes, Pocket Casts, Overcast or add this feed to your podcast client.


Rubenerd Show 346: The cereal episode

Show

Rubenerd Show 346

Podcast: Play in new window · Download

36:29 – Ruben discusses mixing your own carbohydrated breakfast, and comments on Shambles' Facebook adventures. Also feedback from episode 345, aircraft identification, umbrage, MythBusters and Penn and Teller Bullshit, rental inspections, weekend getaways, and debuting the all-new Moment with Clara Segment.

Recorded in Sydney, Australia. Licence for this track: Creative Commons Attribution 3.0. Attribution: Ruben Schade.

Released July 2016 on The Overnightscape Underground, an Internet talk radio channel focusing on a freeform monologue style, with diverse and fascinating hosts.

Subscribe with iTunes, Pocket Casts, Overcast or add this feed to your podcast client.


Alternative Let’s Encrypt Clients

Internet

I haven’t blogged about Lets Encrypt yet, but I’ve been using it professionally and personally since it came out of beta, and am very impressed. I’d argue the client and automation even beat the fact its free.

To meet their goal of a universal and accessible client though, its necessarily large. For most projects I’d say run with the official and save yourself problems, but there may be times where you need something lighter weight. I’ve used two alternatives, and can vouch for their awesomeness.

acme-tiny

This takes the form of a tiny Python script that works great unmodified on the Debian and CentOS VMs I’ve tried on Joviam. From the [acme-tiny repo]:

This is a tiny, auditable script that you can throw on your server to issue and renew Let’s Encrypt certificates. Since it has to be run on your server and have access to your private Let’s Encrypt account key, I tried to make it as tiny as possible (currently less than 200 lines). The only prerequisites are python and openssl.

It does require manual steps, but then again that’s why you’re going with a light weight solution.

letsencrypt.sh

This is my current favourite. As Ansible users would be keenly aware, FreeBSD and NetBSD don’t ship with Python. I don’t want to install an entire dependency chain to run a script from cron, so this works (though it still needs bash or zsh). From the letsencrypt.sh repo:

This is a client for signing certificates with an ACME-server (currently only provided by letsencrypt) implemented as a relatively simple bash-script.

It uses the openssl utility for everything related to actually handling keys and certificates, so you need to have that installed.

There are dependencies, but are handled gracefully even with BSD/GPL differences:

Other dependencies are: curl, sed, grep, mktemp (all found on almost any system, curl being the only exception)

FreeBSD and NetBSD users can use git-lite to pull the repo, or on FreeBSD you can just install it from ports.


Recharge

Travel

Like most of us in the world now, I’ve always lived in cities. I appreciate the convenience, infrastructure, employment and education, arts, and the illogical calm an introvert can derive from being surrounded by people without interaction. They’re communities, on a scale of millions.

For all intents and purposes, cities represent the pinnacle of human development. Here are entire societies of people living and working together in these huge and densely-packed structures in (relative) peace, getting along with our lives. It’s amazing we don’t all step on each others toes.

My old man’s job had us moving around varies Australian and Asian cities when my sister and I were growing up, but we always made the trip each year to Ubud in the Baliniese hills to unwind. My parents’ excitement rubbed off. The sounds, sights, smells and tastes of that part of the world left a deep impression on me.

For school camps in Singapore, we went to Malaysia and Thailand. For longer trips, we’d venture to Europe (my dad is German).

Like every self-respecting computer nerd, I also adore East Asian cultures. Clara and I both want to do an epic trip from Hong Kong, Seoul, Kyoto, Sapporo, Taipei. I also want to hit up New York, Boston, Montana and Toronto.

I’ve been so lucky with the travel opportunities we had as kids, and the disposable income now to travel the world at 30. Most people aren’t as fortunate, either by family or financial circumstances.

My dad’s job moved us around various ones in Australia and Asia when we were kids, but early on we were told of.

And then on the weekend, I headed up to North Arm Cove and Tea Gardens, small villages on the Central Coast of NSW. My old man retired up there, with a house five times the size of my apartment, waterfront views overlooking national park, and sounds of nature.

For really the first time in years, I recharged.


Kindly, Don’t Do That

Internet

I’ve started a new blog called Kindly, Don’t Do That.

It started as a photo journal of everyone who’s parked on the footpath outside our office, which not only breaks the law, but forces us to walk on a dangerous, cracked road frequented by heavy construction lorries and unreasonably deep rainwater puddles. Now, it includes other actions I’d kindly ask people not to do, including implementing lightbox popups and whatever else I can think of. So far, it may include:

  • Flat, wooden plates in restaurants
  • Fonts with incorrect fallbacks (sans serif with a serif fallback)
  • Ultralight fonts on non-retina screens
  • Beverages contaminated with high-fructose corn syrup
  • Unnecessary meatstack (≡) icons
  • Vegetarian-advertised foods with meat in them
  • Socks contaminated with non-cotton materials
  • Email unsubscribe links that don’t immediately unsubscribe

This may be extended further in the future to include:

  • Use of the word “gotten”

Like so many secondary blogs I start, this will likely be folded back into the main Rubenerd site at some point in the future.


URL encoding codes

Annexe

This originally appeared on the Annexe.

backspace      %08
tab            %09
linefeed       %0A
creturn        %0D
space          %20
!              %21
"              %22
#              %23
$              %24
%              %25
&              %26
'              %27
(              %28
)              %29
*              %2A
+              %2B
,              %2C
-              %2D
.              %2E
/              %2F
0              %30
1              %31
2              %32
3              %33
4              %34
5              %35
6              %36
7              %37
8              %38
9              %39
:              %3A
;              %3B
<              %3C
=              %3D
>              %3E
?              %3F
@              %40
A              %41
B              %42
C              %43
D              %44
E              %45
F              %46
G              %47
H              %48
I              %49
J              %4A
K              %4B
L              %4C
M              %4D
N              %4E
O              %4F
P              %50
Q              %51
R              %52
S              %53
T              %54
U              %55
V              %56
W              %57
X              %58
Y              %59
Z              %5A
[              %5B
\              %5C
]              %5D
^              %5E
_              %5F
`              %60
a              %61
b              %62
c              %63
d              %64
e              %65
f              %66
g              %67
h              %68
i              %69
j              %6A
k              %6B
l              %6C
m              %6D
n              %6E
o              %6F
p              %70
q              %71
r              %72
s              %73
t              %74
u              %75
v              %76
w              %77
x              %78
y              %79
z              %7A
{              %7B
|              %7C
}              %7D
~              %7E
¢              %A2
£              %A3
¥              %A5
|              %A6
§              %A7
«              %AB
¬              %AC
¯              %AD
º              %B0
±              %B1
ª              %B2
,              %B4
µ              %B5
»              %BB
¼              %BC
½              %BD
¿              %BF
À              %C0
Á              %C1
              %C2
à             %C3
Ä              %C4
Å              %C5
Æ              %C6
Ç              %C7
È              %C8
É              %C9
Ê              %CA
Ë              %CB
Ì              %CC
Í              %CD
Î              %CE
Ï              %CF
Ð              %D0
Ñ              %D1
Ò              %D2
Ó              %D3
Ô              %D4
Õ              %D5
Ö              %D6
Ø              %D8
Ù              %D9
Ú              %DA
Û              %DB
Ü              %DC
Ý              %DD
Þ              %DE
ß              %DF
à              %E0
á              %E1
â              %E2
ã              %E3
ä              %E4
å              %E5
æ              %E6
ç              %E7
è              %E8
é              %E9
ê              %EA
ë              %EB
ì              %EC
í              %ED
î              %EE
ï              %EF
ð              %F0
ñ              %F1
ò              %F2
ó              %F3
ô              %F4
õ              %F5
ö              %F6
÷              %F7
ø              %F8
ù              %F9
ú              %FA
û              %FB
ü              %FC
ý              %FD
þ              %FE
ÿ              %FF

Eschewing (gesundheit) the word just

Thoughts

The word just preceiding a statemet or task implies it will be simple or straightforward. How often is that really the case?

I think it’s dismissive, and places a burden on people. So I’m going to stop using it.


It’s 7-11

Thoughts

If you write your dates correctly, it’s 7-11 today!:

2016-07-11

This also works if you write your dates incorrectly:

07-11-2016

But not if you write your dates somewhat correctly:

11-07-2016

7-11 has been in murky ethical water in Australia of late. I make no comment on this, other than to mention the date corresponds to the name which made me smile on this hectic Monday morning, and reminded me of many happy afternoons spent buying unhealthy snacks after school in Jelita. Maybe shop somewhere else in Australia though.