Skip to content

Instantly share code, notes, and snippets.

@Roy-Orbison
Roy-Orbison / acme.sh
Last active April 17, 2026 01:30
Bash completion for acme.sh. Save in /usr/share/bash-completion/completions or similar.
_comp_cmd_acme_sh()
{
local cur prev words cword
_init_completion -n : || return
local commands
commands='
--create-account-key
--create-csr
--create-domain-key
@Roy-Orbison
Roy-Orbison / README.md
Last active July 6, 2026 03:10
Install a DCA printer monitoring solution in a VM running Alpine.

EKM Global DCA on Alpine Linux

Assumes you have Alpine set up and running. I use a little VM so the DCA can have the privileges it wants and not interfere with anything else, but you might want to use Docker, etc.

The default installer failed, and when I got it working, the service would not stay up. This is what I did to get it going.

  1. Copy the relevant installer URL from [EKM's updates site][1].
  2. Fetch it.
@Roy-Orbison
Roy-Orbison / README.md
Last active October 26, 2026 08:48
Python script to check for latest versions of Mattermost Server, including patch releases, optionally filtered to ESR.

Check for Mattermost updates

Mattermost has [limited admin notifications for security patch releases][0], and does not differentiate a preference for stable ESR from outdated versions. The Workspace Optimisation page of the System Console can report fully patched and supported systems as a Problem, in red type.

Here is a script to run with cron, which actively alerts you to updates. It lists all available updates and whether your major + minor version is currently supported.

Call it with env vars like so:

@Roy-Orbison
Roy-Orbison / acmebase64
Created July 19, 2024 07:03
A simple tool for decoding & encoding data saved in acme.sh conf files, denoted by __ACME_BASE64__START_ & __ACME_BASE64__END_.
#!/bin/sh
ts=__ACME_BASE64__START_
te=__ACME_BASE64__END_
case $# in
0)
# loop ensures no final newline is added to input
printf '%s%s%s\n' "$ts" "$(
q=false
f='%s'
@Roy-Orbison
Roy-Orbison / README.md
Last active August 4, 2026 00:43
Mozilla APT repository (like PPA) files to install and automatically update Firefox and Thunderbird.

Quick setup of Mozilla's APT repository

The easy way to enable installation of packages, adapted from [Mozilla's][1] [guides][3]. Files should be saved to:

/etc/apt/preferences.d/mozilla
/etc/apt/sources.list.d/mozilla.sources

The PGP key is [Mozilla's][2], which you can compare to the one embedded in the .sources file.

@Roy-Orbison
Roy-Orbison / dropbox-filenames-fix
Created January 22, 2024 07:02
A bash script to make filenames created on Mac/Linux compatible with Windows for shared Dropbox folders (or similar file syncing services).
#!/bin/bash
set -e
#shopt -s compat32
# illegal on windows
re_ctrl='[:cntrl:]'
re_ctrl="^([^$re_ctrl]*)[$re_ctrl]+(.*)"
re_punct='<>:"\\/|?*'
re_punct="^([^$re_punct]*)[$re_punct]+(.*)"
re_ts_td='[. ]+$'
@Roy-Orbison
Roy-Orbison / slash-search-fallback.html
Last active April 12, 2023 07:58
A contrived example to demonstrate that you can listen for "/" as a shortcut key *and* still fall back to the native Quick Find, so your site does not completely commandeer a useful browser feature.
<input type=search placeholder=search><br>
<textarea placeholder="won't respond to / shortcut"></textarea>
<script>
document.addEventListener(
'keydown',
(function() {
let lastWasSlash = false,
thisIsSlash,
input = document.querySelector('input');
return evt => {
@Roy-Orbison
Roy-Orbison / com.mattermost.calls-config.md
Last active June 9, 2023 12:52
Configure integrated calls plugin for Mattermost

Configure calls plugin for Mattermost

Simple case of Single-instance Team edition

Setting Value
RTC Server Address 0.0.0.0 or [::]
RTC Server Port Leave blank for 8443 default, or change to another available port
ICE Host Override Your chat server's host name, e.g. mm.organisation.example, unless that may not resolve to your public IP address when queried locally on that server. The latter can occur if you have an entry in your hosts file that resolves to a loopback address, or split-horizon DNS, in which case you need to enter the IP address or a different (sub)domain that always resolves to it, e.g. calls-mm.organisation.example.
ICE Servers Configurations Leave blank
@Roy-Orbison
Roy-Orbison / dl_ext_webstore_console.js
Last active May 1, 2022 04:56 — forked from tim-hub/dl_ext_webstore_console.js
Download the CRX file of a Chrome extension for inspection or manual installation.
window.location.href = (function() {
var browser = (function() {
var ua = navigator.userAgent,
tem,
M = ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || [];
if (/trident/i.test(M[1])) {
tem = /\brv[ :]+(\d+)/g.exec(ua) || [];
return {
name: 'IE',
version: (tem[1] || '')
@Roy-Orbison
Roy-Orbison / import-from-dir.php
Last active March 16, 2026 12:47 — forked from joshcangit/folder-import.php
Import any .sql[.gz] file, from a specifiable directory, rather than only the default adminer.sql[.gz], with Adminer.
<?php
/**
* Import SQL files from a directory
*
* @author joshcangit, https://github.com/joshcangit
* @author Roy-Orbison, https://github.com/Roy-Orbison
*/
class AdminerImportFromDir {