Putting a footer on automated email that says what generated it
We have various cron jobs and other systems that occasionally sendus email, such as notifications about Certbot renewals failing or alerts that Prometheus is down . One of our local system administrationhabits when we set up such automated email is that we always add afooter to the email message that includes as much information aspossible about what generated the message and where.
For example, the email we send on systemd unit failures (currentlyused for our Certbot renewal failures )has a footer that looks like this:
(This email comes
The problems with piping curl to a shell are system management ones
I was recently reading Martin Tournoij's Curl to shell isn't sobad ( via ), which arguesthat the commonly suggested approach of using ' curlexample.com/install.sh | sh ' is not the security hazard that it'soften made out to be. Although it may surprise people to hear this,I actually agree with the article's core argument. If you're goingto download and use source code (with its autoconfigure script and' make install ' and so on
I have to assume that people here can be successfully phished
Over on Mastodon, I said some things in a conversation:
@cks :Given what mobile browsers are doing to the visibility of web pageURLs plus how many 'you must authenticate' web services we have, Ibasically assume that a lot of our users can be phished by anyone whotries hard enough.
(Some spammers are starting to work that hard, but they're not doingphish spam, they're doing the 'please can you do me a favour' manualspam.)
@cks :
Some notes on getting email when your systemd timer services fail
Suppose, not hypothetically , that youhave some things that are implemented through systemd timers insteadof traditional cron.d jobs, and you would like to get email ifand when they fail. The lack of this email by default is one of theknown issues with turning cron.d entries into systemd timers andpeople have already come up with ways to do this with systemd tricks,so for full details I will refer you to the Arch Wiki section onthis (brought to my attention by keur's comment on
Realizing that Go constants are always materialized into values
I recently read Global Constant Maps and Slices in Go ( via ),which starts by noting that Go doesn't let you create const mapsor slices and then works around that by having an access functionthat returns a constant slice (or map):
const rateLimit = 10func getSupportedNetworks() []string { return []string{"facebook", "twitter", "instagram"}}
When I read the article, my instinctive reaction was that that'snot actually a constant because
Systemd needs official documentation on best practices
Systemd is reasonably well documented on the whole, although thereare areas that are less well covered than others (some of themprobably deliberately). For example, as far as I know everythingyou can put in a unit file is covered somewhere in the manpages.However, as was noted in the comments on my entry on how timerunits can hide errors , much of thisinformation is split across multiple places (eg, systemd.unit , systemd.service , systemd.exec , systemd.resource-control ,
Systemd timer units have the unfortunate practical effect of hiding errors
We've switched over to using Certbot as our Let's Encrypt . As packaged forUbuntu in their PPA , this isset up as a modern systemd-based package. In particular, it uses a systemd timer unit totrigger its periodic certificate renewal checks, instead of a cronjob (which would be installed as a file in /etc/cron.d ). Thisweekend, the TLS certificates on one of our machines silently failedto renew on schedule (at 30 days before it would expire
Many of our 'worklog' messages currently assume a lot of context
The primary way we keep track of things around here is our worklogsystem , which is a specific email log bothof changes that we make and of how to do things (such as rebuildsystems). Also, a while back I wrote about how keeping your pastchecklists doesn't help unless you can find them .In the process of recovering the checklist from 2015 that I waslooking for, I wound up re-reading a bunch of our worklog messagesfrom around that time, which gave
Using personal ruleset recipes in uMatrix in Firefox
I generally don't run Javascript on websites, and these days I dothis with uMatrix . uMatrixrequires more fiddling than controlling Javascript with uBlock Origin , but I like its fine grained control ofvarious things (including cookies) and how it can improve my webexperience . One of the ways I've started doingthat is by exploiting uMatrix's ability to let you define personalruleset recipes.
Suppose, not hypothetically, that you periodically read technicalarticles on Medium. These articles frequently use images and ofteninline
The appeal of text templating systems for generating HTML
One of the things that some people love in web frameworks and otherpeople hate is HTML page generation that's based around some formof evaluation of text-based templates. In systems that I'm familiarwith, both Django and Go have such a templating system. From someperspectives, such systems aren't ideal; for example, as I mentionedin my entry on XHTML's implications for page generation , truly text based templating systems can'teasily enforce strict correctness in the results. My view