Skip to content

Instantly share code, notes, and snippets.

View mss's full-sized avatar

Malte S. Stretz mss

View GitHub Profile
@mss
mss / InternetAddress.java
Created September 1, 2014 15:53
JavaMail 1.4.2 Message-ID generator
/* [...]
*
* Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
*
* The contents of this file are subject to the terms of either the GNU
* General Public License Version 2 only ("GPL") or the Common Development
* and Distribution License("CDDL") (collectively, the "License"). [...]
*/
package javax.mail.internet;

Keybase proof

I hereby claim:

  • I am mss on github.
  • I am mss (https://keybase.io/mss) on keybase.
  • I have a public key whose fingerprint is RETU RN T HIS. PGP. GET_ FING ERPR INT( ); }

To claim this, I am signing this object:

@mss
mss / .bashrc
Created June 13, 2009 14:51
Append this to your .bashrc to have the current Git branch prepended to your Bash prompt
if [ "$(type -t __git_ps1)" ]; then
PS1="\$(__git_ps1 '(%s)')$PS1"
fi
@mss
mss / mark-old-kernels-as-autoinstalled.sh
Created December 2, 2015 08:49
A onelines to mark all kernels except the current and the most recent as autoinstalled on Ubuntu
ls -1d /boot/abi-* | cut -d - -f 2- | sort -V | fgrep -v $(uname -r) | head -n -1 | sed -e s:^:linux-image-: | xargs -r apt-mark auto
@mss
mss / ApacheHttpClient4Handler.java.patch
Created October 3, 2013 21:19
Fix for JERSEY-2126 aka dropwizard issue 403
Index: src/main/java/com/sun/jersey/client/apache4/ApacheHttpClient4Handler.java
===================================================================
--- src/main/java/com/sun/jersey/client/apache4/ApacheHttpClient4Handler.java (revision 5854)
+++ src/main/java/com/sun/jersey/client/apache4/ApacheHttpClient4Handler.java (working copy)
@@ -71,6 +71,7 @@
import javax.ws.rs.core.MultivaluedMap;
import java.io.BufferedInputStream;
import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
import java.io.Closeable;
@mss
mss / rails+php-on-docker.diag
Created October 7, 2013 18:16
A docker host serving Rails and PHP containers.
blockdiag {
orientation = portrait;
default_shape = roundedbox;
default_group_color = "#808080";
user [shape = actor]
inet [shape = cloud];
user -> inet
@mss
mss / Vagrantfile
Created October 8, 2013 11:49
Use ansible with a local connection in Vagrant (no ansible required on the host)
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu-precise-12.04.x-amd64-virtualbox-cloudimg"
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box"
config.vm.provision "shell" do |shell|
# Put the path to your playbook here
@mss
mss / checkpassword.sh
Created September 15, 2021 07:22 — forked from umrysh/checkpassword.sh
Time-based One-time Passwords for Email
#!/bin/bash
# Example Dovecot checkpassword script that may be used as both passdb or userdb.
#
# Originally written by Nikolay Vizovitin, 2013.
# Assumes authentication DB is in /etc/dovecot/users, each line has '<user>:<password>' format.
# Place this script into /etc/dovecot/checkpassword.sh file and make executable.
# Implementation guidelines at http://wiki2.dovecot.org/AuthDatabase/CheckPassword
@mss
mss / install-dovecot-1.2.sh
Last active June 19, 2022 13:41
How to build the last available Dovecot 1.x version on a recent Linux (for migration purposes)
#!/bin/bash
set -o errexit
set -o pipefail
# Dovecot 1.x is not compatible to OpenSSL 1.1 and later but LibreSSL mostly kept that API
curl -JLO \
https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.3.tar.gz
tar xfa libressl-3.4.3.tar.gz
@mss
mss / widhp.yml
Created October 16, 2022 15:21
All videos for www.widhp.de
# Each line's value is the iframe src URL from http://www.widhp.de/{{ key }}.html
trailer: http://player.vimeo.com/video/139455846?title=0&byline=0&portrait=0
qr-ba: http://player.vimeo.com/video/109682743?title=0&byline=0&portrait=0
qr-en: http://player.vimeo.com/video/114542203?title=0&byline=0&portrait=0
qr-bl: http://player.vimeo.com/video/109687018?title=0&byline=0&portrait=0
qr-as: http://player.vimeo.com/video/114559422?title=0&byline=0&portrait=0
qr-sm: http://player.vimeo.com/video/114562881?title=0&byline=0&portrait=0
qr-wa: http://player.vimeo.com/video/109679680?title=0&byline=0&portrait=0
qr-fr: http://player.vimeo.com/video/116553915?title=0&byline=0&portrait=0
qr-ye: http://player.vimeo.com/video/113904497?title=0&byline=0&portrait=0