six demon bag

Wind, fire, all that kind of thing!

2020-12-06

Registration Blocker 1.5.0 released

Due to popular demand I added an option to whitelist domains instead of the default blacklist mode to the Registration Blocker plugin for Question2Answer. Enjoy.

Download: Version 1.5.0

Posted 14:12 [permalink]

2020-10-05

Registration Blocker 1.4.0 released

A short while ago I forked the Registration Blocker plugin for Question2Answer, since it apparently has been abandoned by the original developer, and I needed some additional features.

Today I'm releasing my updated version of the plugin, which adds the following features:

See more ...

Posted 20:10 [permalink]

2020-06-27

How SJWs affected Stack Overflow

Earlier this year user AnonyMousse did an analysis of how the answer rate on Stack Overflow developed over time. This was prompted by the exodus of many high profile users after the social justice influenced changes to their Code of Conduct in late 2019.

See more ...

Posted 13:13 [permalink]

2020-06-25

Barracuda Backup Agent for Linux Unattended Installation (Update)

This is a brief update to my previous post Barracuda Backup Agent for Linux Unattended Installation. In recent versions the name of the actual installer binary has changed to UiConsole. The problem and solution remain the same, though.

Download and unpack the archive, then run

echo '/opt/barracuda' | ./lin/$(uname -m)/UiConsole

to install the agent to a different directory. To uninstall run

echo 'u' | ./lin/$(uname -m)/UiConsole

Note that uninstallation leaves an auto-generated SSL certificate in the directory <installdir>/config, so you need to clean up manually afterwards. Also, the public download location for the agents has apparently been removed. Now you need to download the agent from the Cloud Control web UI (System → Software-Downloads).

Posted 21:32 [permalink]

2020-06-11

Installing Discourse on Devuan

Before deciding on setting up my Q&A site with Question2Answer I evaluated several programs, one of them being Discourse. And even though I ultimately decided against Discourse (because the setup was too complex and it doesn't have all the features I wanted) I don't want my experiences go to waste, so I'll publish them here.

See more ...

Posted 19:57 [permalink]

2020-06-07

Content Security Policy for Question2Answer

The trickiest part of setting up my Q&A site (running on Question2Answer) was getting the content security policy right. I started with this basic policy:

default-src 'self';
script-src 'self';
style-src 'self';
img-src *;
object-src: 'none';
form-action: 'self';
frame-ancestors: 'self';

but quickly realized that it prevented some page elements from showing.

See more ...

Posted 13:16 [permalink]

2020-06-05

My Own Q&A Site

At long last I've set up my own Q&A site. If you want to ask a scripting or system administration question, or need support for the stuff I cobbled together, feel free to ask there.

Since the available themes sort of looked like somebody threw random paintballs at them, I made my own. If you're interested you can download it from Github or here.

Posted 12:46 [permalink]

2020-06-03

Disable Firefox 77 Address Bar Popout

*sigh* Another day, another Firefox fuckup. One of the more annoying new "features" in recent Firefox versions is the address bar jumping at you when it gets the focus. In Firefox 75 that misbehavior could be corrected with a couple adjustments in about:config:

browser.urlbar.openViewOnFocus false
browser.urlbar.update1 false
browser.urlbar.update1.interventions false
browser.urlbar.update1.searchTips false

However, with Firefox 77 those settings don't work anymore (you can reset/delete them). Because who would ever want to disable what Mozilla developers in their infinite wisdom decided that you must like?

See more ...

Posted 12:42 [permalink]

2020-06-02

Privacy-friendly Logging With Nginx

IP addresses are considered personal information, so your web server is not supposed to log them, at least not in a way that would allow tracing the address back to a person. The usual way to comply with this requirement is to mask part of the visitor's IP address, e.g. 192.168.23.42 → 192.168.23.0 (IPv4) or fd22:e03e:f88a:ea84::42 → fd22:e03e:: (IPv6).

See more ...

Posted 15:27 [permalink]

2020-05-23

Shell Patterns (5) - Locking

This is a short series describing some Bash constructs that I frequently use in my scripts.

Sometimes you need to ensure that a script is doing an operation exclusively, to avoid race conditions in case it had been launched several times in parallel. This kind of concurrency control is called mutual exclusion, or mutex for short. In Bash a mutex can be implemented by terminating or suspending execution unless the script is able to create a lock file.

See more ...

Posted 15:33 [permalink]

Barracuda Backup Reports Missing Drive

Barracuda Backup reports show a warning when the Windows agent cannot find a drive that is supposed to be backed up:

A Volume (drive) that was previously backed up is no longer there and being backed up.: Removing volume X: because it no longer exists.

The vendor documentation has an article that describes how to bring the missing drive back online. But what if the drive was removed on purpose and people just forgot to adjust the backup configuration first? You can't simply change the backup configuration to ignore the drive after the fact, since the drive is already absent and thus cannot be de-selected.

See more ...

Posted 11:05 [permalink]

2020-04-30

Shell Patterns (4) - Limiting Execution Time

This is a short series describing some Bash constructs that I frequently use in my scripts.

Sometimes you want a script to give up on what it's trying to do after some period of time. The simplest way for limiting the time a given statement may take for execution is the timeout command.

$ timout 2 ping 127.0.0.1
PING 127.0.0.1 (127.0.0.1) 56(84) bytes of data.
64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.031 ms
64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.012 ms
$ echo $?
124

However, timeout is only useful for limiting the execution time of a single (blocking) command. Consider for instance a situation where you deployed a VM or an LXD container, and need to wait for cloud-init to complete on that system. Or a situation where you sent an asynchronous request to a REST API. timeout won't help you there. You need to poll the system or API repeatedly until the respective "operation completed" indicator appears.

See more ...

Posted 22:35 [permalink]

2020-03-23

FRITZ!Box Firewall is Broken

AVM's FRITZ!Box routers have builtin packet filtering capabilities that are configured via the parental controls. However, for some unknown reason the vendor deemed it a good idea to hard-link MAC addresses to IPs (hint: it's not) with no option to override it (hint #2: that's an even worse idea).

See more ...

Posted 16:06 [permalink]

Shell Patterns (3) - Structured Output

This is a short series describing some Bash constructs that I frequently use in my scripts.

On Linux (and many other operating systems) it's common to have regular and error output written to stdout and stderr respectively. In shell scripts you'd use the echo or printf commands for displaying messages, and redirect stdout to stderr for having the message displayed on stderr.

echo 'foo'       # output goes to stdout
echo 'bar' 1>&2  # output goes to stderr

There may be different levels of information that you want to separate from each other, though, like having additional debug output that you don't want to pollute stdout or stderr. For that you can use the file descriptors 3 through 9.

See more ...

Posted 15:22 [permalink]

2020-03-06

Shell Patterns (2) - Error Handling

This is a short series describing some Bash constructs that I frequently use in my scripts.

When writing scripts for automation purposes you normally want the scripts to terminate when something goes wrong. Because terminating in a controlled way is usually better than blindly continuing execution when the assumptions subsequent commands are based on aren't valid anymore.

Bash provides several options for controlling error handling, the most commonly used ones being

  • -e (or -o errexit): Exit immediately when a command terminates with a non-zero exit code.
  • -u (or -o nounset): Treat unset variables and parameters (except for $@ and $*) as errors when expanding them. This prevents problems due to misspelled variables.

There are some issues with using just these two options, though:

See more ...

Posted 17:25 [permalink]

2020-02-29

Non-interactive MongoDB Commandline

MongoDB provides an interactive command shell for working with the database. Which is all nice and dandy, but from an admin and automation perspective it's desirable to also be able to run commands non-interactively. The mongo commandline tool does have a parameter --eval that kind of allows you to do that:

--eval <javascript>
Evaluates a JavaScript expression that is specified as an argument. mongo does not load its own environment when evaluating code. As a result many options of the shell environment are not available.

except that it doesn't play nice when you also want to automatically authenticate via the config file .mongorc.js.

See more ...

Posted 01:29 [permalink]

2020-02-24

Shell Patterns (1) - Logging

This is a short series describing some Bash constructs that I frequently use in my scripts.

What do you do when you run fully automated scripts in the background, but still want to keep track of what they're doing and, more importantly, when something goes wrong? The answer is, of course, you log what the script is doing (or is about to do).

There are two commonly used ways of implementing logging in Bash scripts:

Personally, I prefer the latter, since it allows not only for managing log files independently of the process creating the log output, but also for filtering log data and/or forwarding it to a central loghost.

See more ...

Posted 20:47 [permalink]