Skip to content

Instantly share code, notes, and snippets.

@mricon
mricon / my-gen-msgid.sh
Last active December 14, 2023 19:23
my-gen-msgid
#!/bin/bash
# This generates lore-friendly message-id headers that are safe, unique, and
# provide better UX for someone using lore to retrieve messages.
#
# Instructions for using with mutt/neomutt:
#
# Save this as ~/bin/my-gen-msgid, then add ~/.mutt-fix-msgid with the following,
# fixing your path to the file:
#
# my_hdr Message-ID: <`/home/user/bin/my-gen-msgid`>
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF3pYnkBEAC4sv8l8UNcQW86zvIWbnBm4JBrylenzPfSsW06V+gZxtbNRjXM
JM6yhMaw67iXwSNQ4iJv2PHNBvO84sl7mQJ8RLft0Ej6NMq4+jE5TEtirLBOax58
S0sbqTHnk+HrSP0lrfYSTJNak7zEHh2DWAJA4Vahk+DuU81NpJOVMrfK+ehdp0P1
sVqoT00dwEoigkeCZyCGxe0oSuPTmaej1qM+ynC5u8wXyCjYg84A0LNC/RFnV2aH
O7+F1OPapKpWs5BlQvuZ7/mT0koUzels+FB8DQZ7u0G7uCz2fyHo3OAtyKt+XiJU
xAVsMeUza2EoMJt67R8Kdi6nKcHLaOfE1wCTwivganr5UwyPdCSflGAMKzElmxlF
QXJkqbWQycLrqsbEW4Bh7QL55YmxKgqaQAgeQayNpeEfO+ktelh0205e3a5kf0rt
ZYrx/yr6jZ5hsYF0IqlGi1qwxIKUGM64A/ezhNj9PX1bYvybvu0L9IBeTvZbjdqR
#!/bin/bash
# Don't bother with anything smaller than 1MB in size
MINSIZE="1M"
# Clean up any cache files older than 1 week, regardless of size
MAXAGE="7"
# In a multisite case, avoid running all cleaners at once
if [ "$2" != '--now' ]; then
sleep $(((RANDOM % 60)))
fi
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# LKML archive collator and sanitizer
#
# The purpose of this script is to make a complete LKML archive by
# collecting individual archives from kernel developers. It uses a
# list of known IDs to locate messages we don't already have in the
# archive, and sanitizes the headers to remove as much private
# information as possible. It also makes sure to consider messages
@mricon
mricon / ff
Last active September 25, 2019 07:15
Convenient wrapper for firejail and firefox
#!/bin/bash
# ff: convenient wrapper for firejail and firefox
#
# You can mix and match most keywords. Anything that's not a keyword
# will become the name of the private profile.
#
# Examples:
# ff
# - use basic defaults (no private directory, system resolver)
# ff 1dns personal
#!/usr/bin/python2 -tt
#
# bugzilla.kernel.org bug junker
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
#!/bin/bash
if [ -z "$GL_USER" ]; then
echo "Run me from gitolite"
exit 1
fi
function showsetusage {
echo
echo 'USAGE: track set your-repo orig-repo remote-name [--tags]'
echo
@mricon
mricon / dovecot-zlib-cron-compressor.sh
Last active November 7, 2021 19:44
Implements the cron script described on http://wiki2.dovecot.org/Plugins/Zlib for compressing old maildir messages. Use only after enabling the Dovecot zlib plugin.
#!/bin/bash
# This is implementation of the script that compresses old maildir messages
# as described in http://wiki2.dovecot.org/Plugins/Zlib
#
# Copyright (C) 2016 by Konstantin Ryabitsev
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
I am doing an AMA on /r/linux.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQEcBAEBCAAGBQJU9RFuAAoJEDZgaZyZ4FVXYjkIAI9lei1E9chFctPy4O9JszfA
C34rnPZYV+EUAG8CHr1nQlVb8Sr0iIpkvmB5RgJy5HPu57E7M6h9jKXXKaclMTJG
9iYObhk/z7PfsS6tRlqoCfYOq1IfoB+reNK0NScI8kDsmZ7uyxmvyfSqJzMuu2dM
@mricon
mricon / gitweb-rewrites.conf
Last active August 29, 2015 14:10
Gitweb to CGit rewrites used at git.kernel.org
# Legacy redirects for /linus/ and /tip/
rewrite ^/linus/(\w+)$ /cgit/linux/kernel/git/torvalds/linux.git/commit/?id=$1? permanent;
rewrite ^/linus/.*h=(\w+)$ /cgit/linux/kernel/git/torvalds/linux.git/commit/?id=$1? permanent;
rewrite ^/linus/$ /cgit/linux/kernel/git/torvalds/linux.git? permanent;
rewrite ^/tip/(\w+)$ /cgit/linux/kernel/git/tip/tip.git/commit/?id=$1? permanent;
rewrite ^/tip/.*h=(\w+)$ /cgit/linux/kernel/git/tip/tip.git/commit/?id=$1? permanent;
rewrite ^/tip/$ /cgit/linux/kernel/git/tip/tip.git? permanent;
if ($request_uri ~ "^/cgit") {
break;