Skip to content

Instantly share code, notes, and snippets.

View mss's full-sized avatar

Malte S. Stretz mss

View GitHub Profile
@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 / 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 / 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 / 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 / ifupdown-to-netplan.txt
Last active March 17, 2024 12:39
Migrate from ifupdown to netplan
# Tested on an upgraded Ubuntu 20.04
apt install netplan.io
systemctl unmask systemd-networkd.service
systemctl unmask systemd-resolved.service
ENABLE_TEST_COMMANDS=1 netplan migrate
netplan try
reboot
apt purge ifupdown resolvconf
ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
@mss
mss / zoom-pulse-prop-media-role-phone-wrapper-installer.sh
Last active April 16, 2024 08:11
Make the Ubuntu Zoom client automatically switch Bluetooth headset profiles to HSP/HFP
#!/bin/bash
# This is a hack to make Bluetooth headests like the jabra Evolve 65 actually
# work as a headset with the Linux (Ubuntu/Debian) Zoom client without having
# to switch manually from A2DP to the HSP/HFP profile.
#
# This is done by injecting an environment variable which makes PulseAudio
# recognize the application as a telephony/voice application as described
# here:
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#profiles
# * https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/Developer/Clients/ApplicationProperties/#pa_prop_media_role
@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