Skip to content

Instantly share code, notes, and snippets.

View AronNovak's full-sized avatar

Aron Novak AronNovak

View GitHub Profile
@AronNovak
AronNovak / markdown-to-email
Last active December 3, 2021 10:13 — forked from rtulke/markdown-to-email
markdown-to-emailA simple script to send beautifully formatted emails that you write in Markdown. The email will have an HTML payload and a plain-text alternative, so you'll make everyone happy, including yourself. With added table support.
#!/usr/bin/env python
'''
Send an multipart email with HTML and plain text alternatives. The message
should be constructed as a plain-text file of the following format:
From: Your Name <your@email.com>
To: Recipient One <recipient@to.com>
Subject: Your subject line
---
@AronNovak
AronNovak / disk_used_alert2slack
Last active December 3, 2020 09:27 — forked from AAber/disk_used_alert2slack
Script to monitor disk space and alert via slack when disk usage is > 80% Place the script in /etc/cron.hourly
#!/bin/bash
# Parse df selected output
df -h|egrep -v 'File|tmpfs|docker|udev|snap|loop'| \
while read LINE; do
USED_NUMBER=`echo $LINE |awk '{print $5}'|sed 's/\%//'|sed 's/ //g'`
USED_PERCENT=`echo $LINE |awk '{print $5}'|sed 's/ //g'`
MOUNT_POINT=`echo $LINE |awk '{print $6}'|sed 's/ //g'`
if [ $USED_NUMBER -gt 80 ]; then
# Create message without spaces