Skip to content

Instantly share code, notes, and snippets.

View ehrenfeu's full-sized avatar

Niko Ehrenfeuchter ehrenfeu

View GitHub Profile
@ehrenfeu
ehrenfeu / backup-lxc-with-tar.md
Last active April 19, 2022 12:49
Backup up LXC containers using `tar`

Creating tarballs from LXC containers

NOTE: this is about tarring up plain LXC (i.e. not LXD) containers without the benefits of btrfs or similar

shut down the respective container, e.g.

lxc-stop mycontainer
@ehrenfeu
ehrenfeu / html_mail.py
Last active April 24, 2024 22:24
Use Python to send HTML emails with expand/collapse boxes working in TB and Android
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
def send_html_mail(subject, body, to_addr, from_addr):
"""Send an HTML email using the given subject, body, etc."""
# Create message container - the correct MIME type is multipart/alternative here!
message = MIMEMultipart('alternative')
message['subject'] = subject