Skip to content

Instantly share code, notes, and snippets.

View martint17r's full-sized avatar

Martin Treusch von Buttlar martint17r

  • Hamburg, Germany
View GitHub Profile
@martint17r
martint17r / exim4.conf
Created May 28, 2021 20:07
systemd service file for rootless Exim on Debian Bullseye
[Unit]
Description=Exim Mail Transport Agent
After=network.target
[Service]
EnvironmentFile=-/etc/default/exim4
PIDFile=/run/exim4/exim.pid
ExecStartPre=+chmod u-s /usr/sbin/exim4
ExecStartPre=+chmod g+r /etc/exim4/exim4.conf
ExecStartPre=+chgrp Debian-exim /etc/exim4/exim4.conf
@martint17r
martint17r / oath-qrcode.sh
Created January 5, 2015 11:40
Generate TOTP QRcode for Google Authenticator for 2FA on linux debian wheezy
#!/bin/bash
USERNAME=$1
HOSTNAME=$(hostname --fqdn)
qrencode -t ANSI256 -o - $(echo otpauth://totp/$USERNAME@$HOSTNAME?secret=$(oathtool --totp -v $(grep $USERNAME /etc/users.oath | cut -f 4) | grep Base32 | cut -d " " -f 3))
$ cat bin/dice
#!/usr/bin/perl -w
use strict;
my %words;
open WORDLIST, "$ENV{HOME}/.diceware_german.txt" or die "Could not open wordlist: $!";
while(<WORDLIST>) {
chomp;
next unless /^(\d{5})\s+(.+)$/;
$words{$1}=$2;
@martint17r
martint17r / docker-cleanup.sh
Created June 2, 2014 13:09
Script to clean up docker leftovers periodically
#!/bin/bash
# adapted from http://jimhoskins.com/2013/07/27/remove-untagged-docker-images.html
docker rm $(docker ps -a -q)
docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}')
#!/bin/bash
# Activate in /etc/ssh/sshd_config
# AuthorizedKeysCommand /usr/local/sbin/monkeysphere-sshd-keyprovider
# AuthorizedKeysCommandUser root
export MONKEYSPHERE_CHECK_KEYSERVER=false
export MONKEYSPHERE_RAW_AUTHORIZED_KEYS=/dev/null
monkeysphere-authentication keys-for-user $@
@martint17r
martint17r / BuildConfig.groovy
Created March 11, 2013 09:10
grails server port selection for test environment
if (System.getProperty('grails.env') == 'test') {
grails.server.port.http=new Integer(System.getProperty('grails.server.port', System.getProperty('server.port', "7070")))
}