Skip to content

Instantly share code, notes, and snippets.

View zifnab06's full-sized avatar
🏳️‍🌈

Tom Powell zifnab06

🏳️‍🌈
View GitHub Profile
@palant
palant / README.md
Last active February 17, 2024 16:56
DKIM signing and verification filters for OpenSMTPD

Important

Current version of this code has moved into a proper GitHub repository: https://github.com/palant/opensmtpd-filters

The OpenSMTPD documentation currently suggests using either opensmtpd-filter-dkimsign or opensmtpd-filter-rspamd for DKIM support. The former lacks functionality and requires you to compile code from some Austrian web server yourself. The latter is overdimensioned for my needs. So I’ve written my own fairly simple filters in Python.

Prerequisites

These filters require Python 3 with dkimpy module installed. You can optionally install pyspf module as well, if you want dkimverify.py to perform SPF verification as well.

Setting up

@dragolabs
dragolabs / jenkins-slave.service
Last active August 16, 2023 08:15
Supervisor and systemd config for jenkins slave
[Unit]
Description=Jenkins Slave
Wants=network.target
After=network.target
[Service]
ExecStart=/usr/bin/java -Xms512m -Xmx512m -jar /opt/jenkins/slave.jar -jnlpUrl http://${JENKINS_SERVER}/slave-agent.jnlp -secret ${SECRET}
User=jenkins
Restart=always
RestartSec=10
@dmtucker
dmtucker / ipv6-erl.md
Last active April 13, 2024 15:58
Configuring IPv6 on EdgeRouter Lite

Configuring IPv6 on EdgeRouter Lite

Tested with:

  • v1.9.7+hotfix.4, Wave G in Seattle
  • v1.10.5, Comcast in the South Bay Area
set interfaces ethernet eth0 description LAN
set interfaces ethernet eth1 description WAN
set interfaces ethernet eth2 description WLAN
@fourkbomb
fourkbomb / switch_default_branch.py
Last active February 12, 2018 06:01
python script using requests to change the default branch for all repos owned by a user/organisation
#!/usr/bin/python
from __future__ import print_function
import requests
BRANCH = 'cm-14.1'
REPO_OWNER = 'orgs/LineageOS'
USERNAME = 'your github username'
# generate this here: https://github.com/settings/tokens
# this script only needs the 'repo' scope
@alessonforposterity
alessonforposterity / drgn.txt
Created April 12, 2015 04:43
Abandon all hope, ye who enter here
This file has been truncated, but you can view the full file.
//Dr. Seuss once wrote, "IF." He meant, "If you give a fuck, maybe,
//JUST MAYBE, you can change this shitty world in some small way for
//the better." I might've been an writer of children's books someday,
//but instead, I decided to make this. So in lieu of The Lorax,
//let's call this The Dragon, and have my word be, "DON'T." As in,
//"Don't do something stupid like this the way I did, you jackass."
//But the truth is humans are very stubborn creatures. You probably
//won't listen to my advice and, chances are, neither will I.
//This is just an excerpt of the source code for DRAGON: A Game About
@aras-p
aras-p / preprocessor_fun.h
Last active May 23, 2024 08:26
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@KartikTalwar
KartikTalwar / Documentation.md
Last active May 9, 2024 12:59
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs