Skip to content

Instantly share code, notes, and snippets.

View bernhardkaindl's full-sized avatar

Bernhard Kaindl bernhardkaindl

View GitHub Profile
@bernhardkaindl
bernhardkaindl / python_source_import.rst
Created December 11, 2023 03:29 — forked from mportesdev/python_source_import.rst
Importing Python source code from a script without the .py extension

Importing Python source code from a script without the .py extension

Generally, to import a python module programatically when you know the file's path, you could do something like this:

import importlib.util
import sys
@bernhardkaindl
bernhardkaindl / readme.md
Created March 11, 2024 23:26 — forked from jasonkarns/readme.md
Git send-email using Gmail
  1. Configure git.
# ~/.config/git/config
[sendemail]
  confirm = auto
  smtpServer = smtp.gmail.com
  smtpServerPort = 587
  smtpEncryption = tls
  smtpUser = <gmail email address>
@bernhardkaindl
bernhardkaindl / XML_breaker.py
Created March 14, 2024 02:11 — forked from nicwolff/XML_breaker.py
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0
@bernhardkaindl
bernhardkaindl / docker-compose-letsencrypt.yml
Created August 20, 2024 14:08 — forked from marcelo-ochoa/docker-compose-letsencrypt.yml
Docker Swarm stack for LetsEncrypt CertBot and Oracle OCI registration
version: '3.6'
volumes:
certs-repo:
driver: s3fs
name: "certs"
services:
nginx:
image: registry.mydomain.com/letsencrypt:1.19.3