Skip to content

Instantly share code, notes, and snippets.

View ThomasLeister's full-sized avatar

Thomas Leister ThomasLeister

View GitHub Profile
insert into tlspolicies (domain, policy, params) values ('email.de', 'secure', 'match=.web.de');
insert into tlspolicies (domain, policy, params) values ('freenet.de', 'secure', 'match=.freenet.de');
insert into tlspolicies (domain, policy, params) values ('gmx.at', 'dane-only', '');
insert into tlspolicies (domain, policy, params) values ('gmx.biz', 'secure', 'match=.gmx.net');
insert into tlspolicies (domain, policy, params) values ('gmx.ch', 'dane-only', '');
insert into tlspolicies (domain, policy, params) values ('gmx.co.uk', 'secure', 'match=.gmx.net');
insert into tlspolicies (domain, policy, params) values ('gmx.com', 'dane-only', '');
insert into tlspolicies (domain, policy, params) values ('gmx.com.my', 'secure', 'match=.gmx.net');
insert into tlspolicies (domain, policy, params) values ('gmx.de', 'dane-only', '');
insert into tlspolicies (domain, policy, params) values ('gmx.es', 'secure', 'match=.gmx.net');
@ThomasLeister
ThomasLeister / convert-vmail-db.py
Last active September 25, 2020 12:00
Python database convert script for Thomas Leister's Mailserver Guide
# This script converts the DB layout of the old mailserver guide (Ubuntu 14.04) [1]
# to the new one, introduced with Ubuntu Xenial (16.04) [2].
# Please note that the DB schema / tables for the new schema already need to exist.
# This script is just transferring / converting table _contents_.
#
# No not forget to provide your own database name and credentials in the
# MySQL "connect" commands at the beginning of the script!
#
# Prerequisites:
# apt install python3-pip
@ThomasLeister
ThomasLeister / install-root-ca.sh
Created February 23, 2017 10:19
Firefox, Thunderbird, Chromium, Chrome Root CA certificate installer
#!/bin/bash
### Script installs root.cert.pem to certificate trust store of applications using NSS
### (e.g. Firefox, Thunderbird, Chromium)
### Mozilla uses cert8, Chromium and Chrome use cert9
###
### Requirement: apt install libnss3-tools
###
@ThomasLeister
ThomasLeister / delete-ejabberd-accounts-list.sh
Created May 9, 2020 20:41
Delete Ejabberd accounts by JID list
##
## Create a "spammers.txt" file with all the JIDs (Jabber IDs) to delete. One in each line:
## user1@server.tld
## user2@server.tld
## user3@server.tld
## ...
## then run this command:
cat spammers.txt | xargs -L1 -i bash -c 'jid={}; name=${jid%@*}; domain=${jid##*@}; ejabberdctl unregister $name $domain; echo "deleted $jid"'
#!/bin/sh
libressl_version=libressl-2.5.1
libressl_archive=${libressl_version}.tar.gz
if [ -f ${libressl_archive} ]
then
:
else
wget -O ${libressl_archive} https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${libressl_archive}

Keybase proof

I hereby claim:

  • I am thomasleister on github.
  • I am thomasleister (https://keybase.io/thomasleister) on keybase.
  • I have a public key whose fingerprint is 2500 F4F5 2F77 AE69 E22B 331D 2AB6 AD36 9DFD 2A65

To claim this, I am signing this object:

ACLs enabled for LXD / LXC containers on ZFS:
apt install acl (on host and container)
zfs set acltype=posixacl default/containers/kirby (on host)
(restart container)
=> *profit*
/* 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,
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 / 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