Skip to content

Instantly share code, notes, and snippets.

View csarn's full-sized avatar

Chris S csarn

View GitHub Profile
@csarn
csarn / README.md
Last active April 27, 2024 08:20
ZFS pull backup with minimal permissions

Usage

on system that should be backed up

  • put "restrict_commands.sh" in /usr/local/bin and make it executable
  • install ts, lzop and optionally mbuffer
useradd zfsbackup --create-home --system
mkdir /home/zfsbackup/.ssh
zfs allow -u zfsbackup send,hold tank/dataset
echo 'restrict,command="restrict_commands.sh" ssh-ed25519 ...' > /home/zfsbackup/.ssh/authorized_keys
@csarn
csarn / preseed.cfg
Created January 17, 2017 19:16
Debian jessie auto-install file. Put it into your initrd.gz of your tftp server, or use via http.
# Locale / Keymap
d-i debian-installer/locale string en_US.UTF-8
d-i debian-installer/keymap select de-latin1
d-i console-keymaps-at/keymap select de
d-i keyboard-configuration/xkb-keymap select nodeadkeys
d-i languagechooser/language-name-fb select German
d-i countrychooser/country-name select Germany
d-i console-setup/layoutcode string de_DE
# Netzwerk-Konfiguration
d-i netcfg/dhcp_timeout string 30
# solution to https://technology.jana.com/2016/04/26/challenge-your-python-knowledge/
# puzzle 4, in the original version (with the typo)
# replacing __repr__ without typing double underscores
# selected deque, because it has a method (pop) that
# 1) has no arguments
# 2) modifies the object
# 3) can return a string
from ctypes import *
from collections import deque