Disk passthrough to a VM managing my ZFS array.
$ qm set 100 -scsi1 /dev/disk/by-id/…
$ qm set 100 -scsi2 /dev/disk/by-id/…
$ …
# /etc/traefik/pihole.yaml | |
http: | |
middlewares: | |
pihole-redirectregex: | |
redirectRegex: | |
regex: /admin/$ | |
replacement: / | |
pihole-addprefix: | |
addPrefix: | |
prefix: /admin |
#!/bin/bash | |
# Warning! Destructive! | |
# https://rook.io/docs/rook/latest-release/Getting-Started/ceph-teardown/#delete-the-data-on-hosts | |
# Run a rook-ceph-tools daemonset and run this on each node: | |
FDISK_BEFORE=$(fdisk -l); \ | |
DISK="/dev/sda"; \ | |
sgdisk --zap-all $DISK; \ | |
dd if=/dev/zero of="$DISK" bs=1M count=100 oflag=direct,dsync; \ |
[Unit] | |
Description=Kiosk | |
Wants=graphical.target | |
After=graphical.target | |
[Service] | |
Environment="DISPLAY=:0" | |
Type=simple | |
ExecStart=/bin/bash $HOME/kiosk.sh | |
Restart=on-abort |
# Micro SD | |
## read | |
sudo hdparm -Tt /dev/mmcblk0 | |
/dev/mmcblk0: | |
Timing cached reads: 2190 MB in 2.00 seconds = 1095.17 MB/sec | |
Timing buffered disk reads: 126 MB in 3.04 seconds = 41.46 MB/sec | |
## write |
# 1. Setup raspbian lite - no desktop environment or Xorg necessary. Install `fbi`. | |
# 2. Sync files to Pi: | |
rsync -ahP --delete ./slides remote-ssh-host:~ | |
# 3. Append to ~/.profile to run on startup | |
if [[ $(fgconsole 2>/dev/null) == 1 ]]; then | |
fbi -d /dev/fb0 -noverbose -a -t 60 -cachemem 0 $HOME/slides/* |
#!/bin/sh | |
curl -sS 'https://raw.githubusercontent.com/openzfs/zfs/master/META' | awk '$1 == "Linux-Maximum:" { print $2; exit }' |
# install go-task | |
--- | |
version: "3" | |
vars: | |
PROJECT: myproject | |
SECRETS_FILE: sops.env | |
COMPOSE_FILES: | |
sh: find . -type f -iname "compose*.yaml" -exec basename {} ';' | sort -r | |
COMPOSE_FILES_ARGS: -f {{ .COMPOSE_FILES | splitLines | join " -f " }} |
version: "3" | |
name: utils | |
x-options: &options | |
environment: &environment | |
TZ: "${TIMEZONE}" | |
restart: unless-stopped | |
networks: | |
- utils |
defmodule MyApp.RepoConnectionReaper do | |
@moduledoc """ | |
Disconnect all connections after a X minutes to reset cache build-up and leaky memory on long-lived connections | |
Especially useful for dynamic queries which contribute to this build-up. | |
Alternatively, use this Repo option e.g. `Repo.all(query, prepare: :unnamed)` to avoid using named prepared statements | |
on queries that are dynamic enough to not cache the prepared statement on the connection. | |
See also | |
- https://github.com/elixir-ecto/db_connection/issues/99 |