Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Working on a Password Manager for new Solo v2

DRRDietrich DRRDietrich

👨‍💻
Working on a Password Manager for new Solo v2
View GitHub Profile
@DRRDietrich
DRRDietrich / apache-exclude-urls-basic-auth.conf
Created Aug 19, 2020 — forked from tkhn/apache-exclude-urls-basic-auth.conf
exclude one url from basic auth with apache
View apache-exclude-urls-basic-auth.conf
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 / index.md
Created Aug 18, 2020
Cockpit Apache Virtual Host
View index.md

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

View conkyrc.lua
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 / watermark.sh
Created Jun 26, 2020
Script to apply watermarks on images
View watermark.sh
#!/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"
View gist:9ceeb1359a5411c44a20cdc9a22746f6
### 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 / btrfs-guide.md
Created Oct 15, 2019 — forked from MaxXor/btrfs-guide.md
Btrfs guide for initial setup of an LUKS-encrypted btrfs raid with included recovery guide
View btrfs-guide.md

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