Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View MatthewVance's full-sized avatar

Matthew Vance MatthewVance

View GitHub Profile
@MatthewVance
MatthewVance / restic-exclude-file-linux
Created May 18, 2019 15:04
Restic backup exclude file example for Linux.
/dev/*
/home/*/.bash_history
/home/*/.cache/chromium
/home/*/.local/share/Trash
/home/*/.mozilla/firefox/*/Cache
/home/*/Documents/Exclude/*
/lib/modules/*/volatile/.mounted
/media/*
/mnt/*
/proc/*
@MatthewVance
MatthewVance / unbond.conf
Created April 16, 2020 01:12
Example of how to configure Unbound as a local forwarder using DNS-over-TLS to forward queries.
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
cache-max-ttl: 86400
@MatthewVance
MatthewVance / restic-backup-daily.sh
Created May 18, 2019 19:49
Restic daily and hourly backup scripts with systemd timers.
#!/bin/bash
#: Title : restic
#: Date : July 15 2018
#: Author : Matt Vance
#: Version : 1.1
#: Description : Script to fully sytem backlup
#: License : MIT License (MIT)
# Copyright (C) 2019 Matthew Vance
@MatthewVance
MatthewVance / unbound.conf
Last active January 13, 2024 02:38
Config for running Unbound as a caching DNS forwarder (performance settings optimized for Raspberry Pi 2).
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
cache-max-ttl: 86400
@MatthewVance
MatthewVance / restic-backup-weekly.sh
Created May 18, 2019 19:56
Script to backup a Raspberry Pi weekly to a Restic over the network via REST.
#!/bin/bash
#: Title : restic
#: Date : October 13, 2018
#: Author : Matt Vance
#: Version : 1.0
#: Description : Script to run regular restic backups
#: License : MIT License (MIT)
# Copyright (C) 2018 Matthew Vance
@MatthewVance
MatthewVance / nanorc
Created July 27, 2019 11:25
Customize nano behavior. Use ~/.nanorc file.
#####################
# Behavior Settings #
#####################
# Make new lines contain the same amount of whitespace as line above.
unset autoindent
# Use a tab size of n columns. The value of n must be greater than 0.
# The default value is 8.
set tabsize 4
@MatthewVance
MatthewVance / rclone.service
Created July 11, 2018 02:45
Rclone Systemd service
[Unit]
Description=rclone - rsync for cloud storage
Documentation=https://rclone.org/docs/
After=network-online.target
Before=caddy.service
Wants=network-online.target systemd-networkd-wait-online.service
Requires=caddy.service
[Service]
Restart=on-abnormal
@MatthewVance
MatthewVance / Caddyfile
Last active February 10, 2022 01:59
Caddy config (Caddyfile) and systemd service to reverse proxy Restic REST server running via Rclone.
bind 192.168.1.106:8889
tls /etc/caddy/ssl/host_name-bundle.pem /etc/caddy/ssl/end_device-key.pem {
protocols tls1.2 tls1.3
}
# Reverse proxy to rclone restic rest service
proxy / localhost:8080 {
# health_check /
transparent
max_conns 1024
@MatthewVance
MatthewVance / Paperkey
Created July 23, 2019 01:45
Install the Paperkey OpenPGP key archiver from source on Debian based distros https://www.jabberwocky.com/software/paperkey/
curl https://www.jabberwocky.com/software/paperkey/paperkey-1.6.tar.gz -O
curl https://www.jabberwocky.com/software/paperkey/paperkey-1.6.tar.gz.sig -O
gpg --recv-key 0x99242560
gpg --verify paperkey-1.6.tar.gz.sig paperkey-1.6.tar.gz
tar -xzvf paperkey-1.6.tar.gz
cd paperkey-1.6
apt install build-essential
./configure
make
make check
@MatthewVance
MatthewVance / ssh_config
Created May 30, 2019 02:34
OpenSSH SSH client configuration example for Raspberry Pi, customized to improve security.
# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.
# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.