Skip to content

Instantly share code, notes, and snippets.

View bernhardkaindl's full-sized avatar

Bernhard Kaindl bernhardkaindl

View GitHub Profile
@bernhardkaindl
bernhardkaindl / install-gpedit-home.ps1
Last active August 22, 2025 13:39
Install the gpedit.msc in Win11 Home:
# Elevated Windows Powershell commands to install the gpedit.msc in Win11 Home.
# Update active hours automatically each hour to prevent automatic reboot:
# - https://udse.de/reboot-blocker/
# Other options:
# https://www.sordum.org/9470/windows-update-blocker-v1-8/
# https://www.thewindowsclub.com/block-updates-windows-10-stopupdates10
# https://superuser.com/questions/957267/how-to-disable-automatic-reboots-in-windows-10/1529456#1529456
# - Run a program that blocks reboot/shutdown entirely:
# https://www.udse.de/en/windows-10-reboot-blocker
# Settings -> Windows Update -> Advanced Options -> Notify me when a restart is required to finish updating
@bernhardkaindl
bernhardkaindl / lehrlingsdatenbank-userimport.py
Created September 22, 2024 23:17
Skipt um neue Lehrlinge vom 1. LJ per Plugin "Import and export users and customers" zu importieren
#!/usr/bin/env python3
# Installl Dependencies:
# sudo apt install -y python3-pandas python3-ipython python3-unidecode
infile = "Lehrlingsdatenbank.xlsx"
from datetime import datetime
from IPython.display import display
@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
@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 / 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 / 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

Assigning Static IP Addresses in WSL2

WSL2 uses Hyper-V for networking. The WSL2 network settings are ephemeral and configured on demand when any WSL2 instance is first started in a Windows session. The configuration is reset on each Windows restart and the IP addresses change each time. The Windows host creates a hidden switch named "WSL" and a network adapter named "WSL" (appears as "vEthernet (WSL)" in the "Network Connections" panel). The Ubuntu instance creates a corresponding network interface named "eth0".

Assigning static IP addresses to the network interfaces on the Windows host or the WSL2 Ubuntu instance enables support for the following scenarios:

@bernhardkaindl
bernhardkaindl / disable_vim_auto_visual_on_mouse.txt
Created October 23, 2023 21:56 — forked from u0d7i/disable_vim_auto_visual_on_mouse.txt
Disable vim automatic visual mode on mouse select
Disable vim automatic visual mode on mouse select
issue: :set mouse-=a
add to ~/.vimrc: set mouse-=a
my ~/.vimrc for preserving global defaults and only changing one option:
source $VIMRUNTIME/defaults.vim
set mouse-=a
@bernhardkaindl
bernhardkaindl / gist:30e17204ee730bcbd91a62694e9a2319
Created October 23, 2023 20:34
Debian/Ubuntu: Prevent changes to /etc/resolv.conf
https://www.cyberciti.biz/faq/dhclient-etcresolvconf-hooks/
chattr +i /etc/resolv.conf
/etc/dhcp/dhclient-enter-hooks.d/nodnsupdate
make_resolv_conf(){
:
}
chmod +x /etc/dhcp/dhclient-enter-hooks.d/nodnsupdate
@bernhardkaindl
bernhardkaindl / gist:cf254734a15530bd3bf218ed07b30f99
Last active October 23, 2023 20:14
Reset DNS to fix ping when nslookup works
https://thegeekpage.com/fix-nslookup-works-but-ping-fails-in-windows-10/
netsh winsock reset catalog
netsh int ip reset reset.log
ipconfig /flushdns
ipconfig /registerdns
route /f