Skip to content

Instantly share code, notes, and snippets.

View SnailShea's full-sized avatar
🦊

Shea Zerda SnailShea

🦊
View GitHub Profile
-- /etc/rspamd/rspamd.local.lua
local lua_maps = require 'lua_maps'
local rspamd_util = require 'rspamd_util'
local mail_to_allowed_user_map = rspamd_config:add_map{
type = "map",
url = '/etc/rspamd/mail_to_allowed_user.map',
}
@rechner
rechner / ldap-auth.py
Created November 18, 2019 23:47
LDAP Auth script for HomeAssistant
import os
from ldap3 import Server, Connection, ALL, core
# XXX: Update these with settings apropriate to your environment:
# (I use FreeIPA and an homeassistant group assignment)
SERVER = "ipa.example.com"
USERDN = "uid={},cn=users,cn=accounts,dc=example,dc=com"
TIMEOUT = 3
BASEDN = USERDN
SCOPE = "base"
@KurtJacobson
KurtJacobson / header_bar.py
Last active August 22, 2022 10:25
Custom GTK+ HeaderBar with fullscreen toggle button
#!/usr/bin/env python
# Copyright (c) 2017 Kurt Jacobson
# License: https://kcj.mit-license.org/@2017
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('Gdk', '3.0')
@QueuingKoala
QueuingKoala / setup.sh
Last active May 16, 2024 09:32
Sub-CA example
# Assumptions: easyrsa3 available in current dir, and functional openssl.
# This basic example puts the "offline" and "sub" PKI dirs on the same system.
# A real-world setup would use different systems and transport the public components.
# Build root CA:
EASYRSA_PKI=offline ./easyrsa init-pki
EASYRSA_PKI=offline ./easyrsa build-ca nopass
# Build sub-CA request:
EASYRSA_PKI=sub ./easyrsa init-pki
@lorennorman
lorennorman / hex_grid.scad
Created December 29, 2011 17:02
learning me some openscad by playing with a hexagonal grid
module hexagon(radius)
{
circle(r=radius,$fn=6);
}
module shell(radius)
{
difference()
{
hexagon(radius*1.2); // base