Skip to content

Instantly share code, notes, and snippets.

@gwire
gwire / ignore_emoji_emails.sieve
Created September 22, 2016 10:22
Mark emails as read if they contain specific emoji in the Subject
require ["imap4flags"];
require ["encoded-character"];
## No time to waste on your cute emails
if header :contains "Subject" [
"${unicode:1F525}",
"${unicode:1F4A9}",
"${unicode:1F6BD}"
] {
addflag "\\Seen";
@gwire
gwire / ubuntu_https_mirrors.txt
Last active February 24, 2021 13:50
Ubuntu mirrors available over https (2021-02-24)
https://al.mirror.kumi.systems/ubuntu/
https://mirrors.eze.sysarmy.com/ubuntu/
https://ubuntu.unc.edu.ar/ubuntu/
https://mirror.internet.asn.au/pub/ubuntu/archive/
https://ubuntu.mirror.digitalpacific.com.au/archive/
https://mirror.aarnet.edu.au/pub/ubuntu/archive/
https://mirror.as24220.net/pub/ubuntu-archive/
https://mirror.as24220.net/pub/ubuntu/
https://mirror.launtel.net.au/ubuntu/
https://mirror.realcompute.io/ubuntu/
@gwire
gwire / exim4_main_10_local_single_domain
Created November 18, 2016 10:31
Exim config for working with Google delivery restrictions.
domainlist single_domain_mx = aspmx.l.google.com : gmail-smtp-in.l.google.com
@gwire
gwire / en-decrypt.py
Last active August 2, 2023 06:42
Decrypt password protected notes exported from Evernote (ENEX)
#!/usr/bin/env python
# Python script to decrypt encrypted ENEX notes exported from Evernote as ENEX
#
# This will onle work on notes encypted after 2014 using the "ENC0" format
#
# This script requires a modified version of pbkdf2.py to support SHA256
# https://github.com/PaulUithol/python-pbkdf2
#
# There's no helpful error if your password was incorrect, it will just
@gwire
gwire / tinydkim.py
Created December 26, 2016 16:14
takes an RSA public key on stdin and outputs a tinydns / djbdns DKIM record
#!/usr/bin/env python
# tinydkim - takes an RSA public key on stdin and outputs a tinydns / djbdns DKIM record
#
# example: openssl rsa -in test.pem -pubout | ./tinydkim.py -s test -d foo.com
#
# TODO: add support for notes field?
#
# 2016 Lee Maguire
@gwire
gwire / tinysshfp.py
Created February 8, 2017 14:33
takes an SSHFP record and converts to tinydns format
#!/usr/bin/env python
# tinysshfp - takes the output of "ssh-keygen -r" and converts into tinydns
#
# example: ssh-keygen -r example.com | ./tinysshfp.py
#
# 2017 Lee Maguire
import getopt
import sys
@gwire
gwire / slack_notifier.sieve
Last active October 19, 2018 09:27
Simple email notifications in Slack
require ["enotify", "variables"];
if header :contains ["Subject"] ["Urgent","Emergency","You done goofed"] {
if header :matches "Subject" "*" { set "subject" "${1}"; }
if header :matches "From" "*" { set "from" "${1}"; }
notify :importance "3" :from "New message notification <test@example.com>" :message "${from}: ${subject}" "mailto:0xdeadbeef@example.slack.com";
}
@gwire
gwire / 10_local_received.conf
Last active January 28, 2023 12:22
Exim Received header
received_header_text = Received: from ${if or{\
{eq{$received_protocol}{local}}\
{eq{$sender_host_address}{127.0.0.1}}\
}{$primary_hostname}{${if def:authenticated_id \
{SUBMISSION_IDENT}{$sender_rcvhost}}}\
}\n\tby $primary_hostname (Exim)${if and{\
{def:received_protocol}\
{!eq{$received_protocol}{local}}\
}{\n\twith ${uc:$received_protocol} ${if \
def:tls_in_cipher {tls $tls_in_cipher_std (${sg{$tls_in_ver}{TLS}{}})${if \
@gwire
gwire / exim4.service
Created December 3, 2017 15:40
systemd service unit for Exim (Debian)
[Unit]
Description=Exim Mail Transport Agent
After=network.target
[Service]
PrivateTmp=true
Environment=QUEUEINTERVAL=30m
EnvironmentFile=-/etc/default/exim4
ProtectSystem=full
PIDFile=/run/exim4/exim.pid
@gwire
gwire / 00_exim_gnutls.conf
Created September 6, 2018 15:58
Remove weak elliptic curves from Exim
## remove ECDHE support for curves less under 256 bits
tls_require_ciphers = ${if =={$received_port}{25}{NORMAL:%COMPAT:%SERVER_PRECEDENCE:-CURVE-SECP192R1:-CURVE-SECP224R1}{PFS:-DHE-RSA:-3DES-CBC:-CURVE-SECP192R1:-CURVE-SECP224R1}}