Skip to content

Instantly share code, notes, and snippets.

View DRRDietrich's full-sized avatar
👨‍💻
Setlog

DRRDietrich DRRDietrich

👨‍💻
Setlog
View GitHub Profile
@DRRDietrich
DRRDietrich / btrfs-guide.md
Created October 15, 2019 11:53 — forked from MaxXor/btrfs-guide.md
Btrfs guide for initial setup of an LUKS-encrypted btrfs raid with included recovery guide

Btrfs guide

Initial setup with LUKS/dm-crypt

This exemplary initial setup uses two devices /dev/sdb and /dev/sdc but can be applied to any amount of devices by following the steps with additional devices.

Create keyfile:

dd bs=64 count=1 if=/dev/urandom of=/etc/cryptkey iflag=fullblock
chmod 600 /etc/cryptkey
### Keybase proof
I hereby claim:
* I am drrdietrich on github.
* I am drrdietrich (https://keybase.io/drrdietrich) on keybase.
* I have a public key ASAOs7_w6q8Zpb_mlVOBPC9QxZ8-0ntJf5UQ0Y9KmXYW4Qo
To claim this, I am signing this object:
@DRRDietrich
DRRDietrich / watermark.sh
Created June 26, 2020 20:54
Script to apply watermarks on images
#!/bin/bash
config="${HOME}/.config/watermark"
usage() { echo "Usage: $0 [-e <jpeg|jpg|png>] [-n <watermark output name>] [-o <output path>] [-p <watermark position>] [-t <transparency>] [-w <watermark path>] picture [picture [...]]" 1>&2; exit 1; }
if [[ ! -d "$config" ]]; then
mkdir -p "$config"
touch "$config/watermark.cfg"
fi
resultpath="watermark"
watermarkname="watermark"
watermarkextension="png"
@DRRDietrich
DRRDietrich / apache-exclude-urls-basic-auth.conf
Created August 19, 2020 10:33 — forked from tkhn/apache-exclude-urls-basic-auth.conf
exclude one url from basic auth with apache
SetEnvIfNoCase Request_URI "^/status\.php" noauth
AuthType Basic
AuthName "Identify yourself"
AuthUserFile /path/to/.htpasswd
Require valid-user
Order Deny,Allow
Deny from all
Allow from env=noauth
@DRRDietrich
DRRDietrich / conkyrc.lua
Last active April 25, 2021 13:12
conkyrc
conky.config = {
update_interval = 5,
cpu_avg_samples = 2,
net_avg_samples = 2,
out_to_console = false,
override_utf8_locale = true,
double_buffer = true,
no_buffers = true,
text_buffer_size = 32768,
imlib_cache_size = 0,
@DRRDietrich
DRRDietrich / index.md
Created August 18, 2020 12:14
Cockpit Apache Virtual Host

Cockpit works on a web socket combined with http/https interface, Web Socket is used to deliver active content back and forth between client and server. But when a proxy sits in between, it needs to be configured likely.

We will need to create a virtual host, give the virtual host a domain name, install TLS/SSL certificate and set up a reverse proxy. (instructions adapted from here and here)

Set up Apache Virtual Host

Install Apache web server with the following command:

sudo apt install apache2