Skip to content

Instantly share code, notes, and snippets.

@SunRed
SunRed / -systemd-email.md
Last active October 6, 2021 09:00
Send systemd service reports via encrypted multipart email on restart/stop or fail/success

systemd service report via encrypted email

Installation (Example setup)

  • Move systemd-email.sh to /usr/local/bin/ as systemd-email with permissions 755
  • Move systemd-email.conf to /usr/local/etc/systemd-email/
  • Move [email protected] to /etc/systemd/system/
  • Create public keyring for GnuPG in /usr/local/etc/systemd-email/ with gpg --homedir /usr/local/etc/systemd-email/ --no-default-keyring --keyring pubring.gpg --fingerprint and set the permissions on pubring.gpg and trustdb.gpg accordingly or to 644
  • Import your public key with gpg --homedir /usr/local/etc/systemd-email/ --import

Usage

@SunRed
SunRed / player.html
Last active October 4, 2022 11:21
Simple video player using Plyr and Shaka Player from Google
<!DOCTYPE html>
<html lang="en">
<head>
<title>Player</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/plyr/3.7.2/plyr.min.css" integrity="sha512-1EV4ofS7XcLAlzTrHHfhk7UzxVEY8Qog2Jeve5UhGYrFm2BQylunV46RXUa5JJilEAmIAtIA2KbFxISjVmw+zg==" crossorigin="anonymous" referrerpolicy="no-referrer">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.2.1/controls.min.css" integrity="sha512-+8BR6lbGCJm021MhjZMszue47HrhbLww8rZqeelgkqAgTWsWvYe7m8/H7V9lUVrPDI18vxBTdJogoxVPBB3Qjg==" crossorigin="anonymous" referrerpolicy="no-referrer">
<style>
@SunRed
SunRed / sync.sh
Last active December 23, 2022 18:28
Sync script for package mirrors that I use
#!/usr/bin/env bash
set -e
# Name of the mirror used for local directory names
mirror="${1}"
# Directory where the repo is stored locally.
target="/srv/ftp/${mirror}"