Skip to content

Instantly share code, notes, and snippets.

View mss's full-sized avatar

Malte S. Stretz mss

View GitHub Profile
@mss
mss / flatpak-spawn-host.md
Last active October 20, 2023 11:48
How to execute binaries from $PATH from flatpak applications

Let's say you don't want to install Visual Studio Code from their package repository but use the flatpak package instead. This works but as soon as you try to execute any binaries from your regular PATH they won't be found since that's blocked by the sandbox. Even giving full host filesystem access won't work reliably because that filesystem will be mounted under /run/host which messes up any absolute paths which are often baked into the most unexpected places.

After lots of digging I found this solution from the qutebrowser flatpak maintainer. Just in case Reddit dies a copy can be found below.

I assumed that the mentioned flatpak-spawn-wrapper was a feature shipped in all flatpaks but it looks like only flatpak-spawn is included and that wrapper is a [script](https://github.com/flathub/org.qutebrowser.qutebrowser/blob/master/

@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
@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 / 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 / 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 / ifupdown-to-netplan.txt
Last active July 16, 2024 03:27
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 / 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

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 / 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;
@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