Skip to content

Instantly share code, notes, and snippets.

View TrentSPalmer's full-sized avatar

Trent Palmer TrentSPalmer

View GitHub Profile
@TrentSPalmer
TrentSPalmer / 2018-02-13-051950_722x452_scrot.png
Last active August 18, 2023 21:40
Arch Headless Virt Install
2018-02-13-051950_722x452_scrot.png
@TrentSPalmer
TrentSPalmer / 2017-06-18-064710_722x410_scrot.png
Last active August 1, 2023 00:08
fish powerline on ubuntu the easy way
2017-06-18-064710_722x410_scrot.png
@TrentSPalmer
TrentSPalmer / django_sendxmpp_handler.py
Last active February 4, 2021 17:41
Add A Logging Handler to Django for sendxmpp
# mysite/mysite/django_sendxmpp_handler.py
from logging import Handler
from os import popen
from django.conf import settings
LOGGING_XMPP_CONFIG = settings.LOGGING_XMPP_CONFIG
class SENDXMPPHandler(Handler):
def emit(self, record):
@TrentSPalmer
TrentSPalmer / SENDXMPPHandler.md
Last active January 11, 2021 09:49
SENDXMPPHandler for Python logging

This is for logging from a flask app with sendxmpp, because prosody is far easier to set up compared to setting up an email server.

Not only is prosody easy to setup, but it is very well-documented, has it's own ppa, and it's also trivial to add a hook for Let's Encrypt Certs in your certbot renew cron.

I find that poezio is a great xmpp client on Linux, and Yaxim is great on Android.

@TrentSPalmer
TrentSPalmer / check_last_dist_upgrade_via_ssh.py
Last active November 2, 2018 12:20
Python SSH Nagios/Icinga Scripts for Checking System Updates.
#!/usr/bin/env python3
# check_last_dist_upgrade_via_ssh.py
import sys,re
from optparse import OptionParser
from time import time
from datetime import date
from subprocess import run, PIPE
parser = OptionParser()
@TrentSPalmer
TrentSPalmer / solusos_on_raid0_home.md
Last active March 9, 2018 18:20
Install SolusOS with Raid0 /home

Install SolusOS with software raid0 /home device

I don't know if this is correct or not, but it's working for me. First, torrent/download the latest iso and write it to a thumb drive with ddrescue

ddrescue -D --force Solus-1.2.1.iso /dev/sdX

On my machine you can write the thumb drive using USB 3, but you have to

@TrentSPalmer
TrentSPalmer / gentoo_nspawn_container_on_Digital_Ocean.md
Last active June 28, 2017 09:32
Gentoo Nspawn Container on Ubuntu 17.04 on Digital Ocean.

Install a Gentoo nspawn Container on Ubuntu 17.04 on Digital Ocean.

Spin up an Ubuntu 17.04 droplet, because nspawn containers are slightly more difficult with Ubuntu 16.04. Install systemd-container. (This will also work on your local workstation or laptop running Ubuntu 17.04.)

apt install systemd-container