Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View ThomasLeister's full-sized avatar

Thomas Leister ThomasLeister

View GitHub Profile
/* Create queries for https://thomas-leister.de/mailserver-debian-stretch/ */
create table domains (
id serial not null,
domain char (255) unique not null,
PRIMARY KEY (id)
);
create table accounts (
id serial not null,
@ThomasLeister
ThomasLeister / cloud-ubuntu-netplan-secondary-ip-static.md
Created May 25, 2018 08:30
Ubuntu netplan config for secondary ip address

In case there's already a DHCP config for netplan for the private IP address:

File: /etc/netplan/50-cloud-init.yaml

Contents:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
Error:
mastodon@mastodon:~/live$ bundle install
rbenv: version `2.5.1' is not installed (set by /home/mastodon/live/.ruby-version)
Solution:
cd /home/mastodon/.rbenv/plugins/ruby-build && git pull && cd -
rbenv install '2.5.1'
Then quit "mastodon" user via "exit" and re-enter user shell.
(This reloads environment variables)
@ThomasLeister
ThomasLeister / lxd-grow-zfs-pool-file.txt
Created March 6, 2018 07:44
Grow LXD ZFS pool file (LXD snap package)
According to: "Growing a loop backed ZFS pool" on https://lxd.readthedocs.io/en/latest/storage/
For LXD via Snap package:
- The default pool is located at /var/snap/lxd/common/lxd/disks/default.img
- and is named "default".
### To increase the pool size by 20 GiB do this:
>>> Stop all your containers! <<<
@ThomasLeister
ThomasLeister / gist:a8a43143d8a2612ed35f5b3902b0f908
Created October 21, 2017 08:00
Delete outdated Prosody uploads
find /var/lib/prosody/uploads/* -maxdepth 0 -type d -mtime +30 | xargs rm -rf
@ThomasLeister
ThomasLeister / write_win10_usb_stick_on_linux.txt
Created September 6, 2017 10:30
Make Windows 10 boot USb stick on Linux
lsblk
sudo fdisk /dev/sdb
List all partitions
Delete all partitions by pressing "d"
Create new primary Partition with full size (enter, enter, ...)
Set partition type by pressing "t" and set to FAT32 (choice "b")
@ThomasLeister
ThomasLeister / fedora_latest_stable_kernel
Created September 5, 2017 20:13
Latest official vanilla linux kernel
Add this into /etc/yum.repos.d/fedora-kernel-vanilla-stable.repo
# Place this file in your /etc/yum.repos.d/ directory
[fedora-kernel-vanilla-stable]
name=Linux vanilla kernels for Fedora, stable series
baseurl=http://repos.fedorapeople.org/repos/thl/kernel-vanilla-stable/fedora-$releasever/$basearch/
enabled=1
@ThomasLeister
ThomasLeister / le-cert-verification-multiple-hosts.txt
Created August 12, 2017 19:12
Let's Encrypt Zertifikatsbestätigungen sammeln
###
### Let's Encrypt Zertifikatsbestätigungen sammeln
### (nur möglich im manual mode und mit webroot-verifizierung)
Auf allen anderen Hosts:
### /etc/nginx/global/letsencrypt-auth.conf
location /.well-known/acme-challenge {
location ~ /.well-known/acme-challenge/(.*) {
return 301 http://le-auth.650thz.de$request_uri;
@ThomasLeister
ThomasLeister / opendkim-postfix-chrooted-systemd
Created August 5, 2017 13:24
OpenDKIM with chrooted Postfix on systemd Systems
If postfix runs in an chrooted environment:
# ==========================================================================
# service type private unpriv chroot wakeup maxproc command + args
# (yes) (yes) (yes) (never) (100)
# ==========================================================================
cleanup unix n - y - 0 cleanup
... opendkim.sock must be placed into /var/spool/postfix. Postfix won't be able to access the socket otherwise.
@ThomasLeister
ThomasLeister / pdf-remove-password.sh
Last active June 4, 2017 09:49
PDF Passwortschutz entfernen
### Execute in directory with .pdf files in it.
dnf install qpdf
mkdir out
find . -maxdepth 1 -type f -iname '*.pdf' -printf '%f\0' | xargs -0 -I '{}' qpdf --password="MYPASSWORD" --decrypt '{}' out/'{}'