Skip to content

Instantly share code, notes, and snippets.

View owenthewizard's full-sized avatar

Owen Walpole owenthewizard

View GitHub Profile
@owenthewizard
owenthewizard / dkim_rotation.sh
Created June 26, 2020 21:43 — forked from Frederick888/dkim_rotation.sh
Automatic DKIM key rotation with CloudFlare
#!/usr/bin/env bash
# Read https://www.linode.com/docs/email/postfix/configure-spf-and-dkim-in-postfix-on-debian-8 first!
# Run this script at the beginning of each month
# (Optional) Email notification if the script is interrupted
#function notify() {
# printf 'Refer to the logs for further info.\n' | mail -s 'DKIM rotation process was interrupted' '[email protected]'
#}
#
@owenthewizard
owenthewizard / genpass.py
Created September 2, 2018 05:24
Simple password generator. Probably not secure.
#!/usr/bin/env python3
# genpass by owenthewizard
from os import urandom
from base64 import b64encode
config = {
# Number of bytes of entropy to use when generating password
@owenthewizard
owenthewizard / wallpaper.py
Created May 26, 2018 01:40
Fetches the top wallpaper of the given subreddit and resolution.
#!/usr/bin/env python3
# Example: wallpaper.py wallpaper 1920x1080
import json
import requests
import tempfile
import subprocess
import sys
@owenthewizard
owenthewizard / samsungvfd.py
Created November 22, 2017 17:09
A simple library for interacting with the Samsung 20S207DA1 VFD
# Library for using Samsung 20S207DA1
# Based on https://www.pollin.de/productdownloads/D120394D.PDF
import serial
class Samsung20S207DA1:
DIM_0 = b'\x04\x00'
DIM_20 = b'\x04\x20'
DIM_40 = b'\x04\x40'
DIM_60 = b'\x04\x60'
@owenthewizard
owenthewizard / update-efibootmgr.sh
Last active September 8, 2017 18:53
Script to add kernels in /boot (or another EFI directory) to efibootmgr.
#!/bin/bash
# update-efibootmgr.sh
# Update UEFI boot entries using efibootmgr
# TODO: remove old entries, could use efibootmgr -v?
set -eu
set -o pipefail
distro="Funtoo Linux"
@owenthewizard
owenthewizard / disable-urgent-invisible.patch
Created April 9, 2017 05:34
Patch for i3-gaps to disable marking windows in invisible workspaces as urgent
diff -Naur i3.orig/src/manage.c i3/src/manage.c
--- i3.orig/src/manage.c 2017-04-09 00:17:47.132061657 -0500
+++ i3/src/manage.c 2017-04-09 00:18:35.928057642 -0500
@@ -269,9 +269,6 @@
else
nc = tree_open_con(nc->parent, cwindow);
- /* set the urgency hint on the window if the workspace is not visible */
- if (!workspace_is_visible(assigned_ws))
- urgency_hint = true;