Skip to content

Instantly share code, notes, and snippets.

@everilae
everilae / threadedgenerator.py
Last active March 26, 2024 18:49
Threaded generator wrapper for Python
# A simple generator wrapper, not sure if it's good for anything at all.
# With basic python threading
from threading import Thread
try:
from queue import Queue
except ImportError:
from Queue import Queue
@jakevdp
jakevdp / discrete_cmap.py
Last active August 26, 2024 01:46
Small utility to create a discrete matplotlib colormap
# By Jake VanderPlas
# License: BSD-style
import matplotlib.pyplot as plt
import numpy as np
def discrete_cmap(N, base_cmap=None):
"""Create an N-bin discrete colormap from the specified input map"""
#!/bin/sh
set -x
NAME=thingy
MIRROR=ftp.at.debian.org/debian
tmpdir=$(mktemp -p "${TMPDIR:-/tmp/}" -d $NAME-XXXX) || exit 1
#tmpdir=/tmp/thingy
#mkdir -p "$tmpdir"
port=0
interface=enp8s0
bind-interfaces
dhcp-range=192.168.0.50,192.168.0.150,12h
enable-tftp
dhcp-match=set:efi-x86_64,option:client-arch,7
dhcp-boot=tag:efi-x86_64,grubx64.efi
tftp-root=/tmp/tftpboot
@vemacs
vemacs / compton.conf
Last active May 8, 2023 16:57
Reasonable compton.conf (fixes shadows in the stock desktop environment) for Xubuntu 16.04
#################################
#
# Backend
#
#################################
# Backend to use: "xrender" or "glx".
# GLX backend is typically much faster but depends on a sane driver.
backend = "glx";
@RenatoUtsch
RenatoUtsch / template.tex
Last active April 15, 2020 12:30
Modern barebones template for LuaLaTeX and BibLaTeX
\documentclass[12pt]{article}
% Encoding
\usepackage{fontspec}
\usepackage{polyglossia}
\usepackage{csquotes}
\setdefaultlanguage{english}
% Formatting
\usepackage{fullpage}
@wohlert
wohlert / Sinkhorn-solver.ipynb
Created April 3, 2019 11:43
Sinkhorn solver in PyTorch
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cnlohr
cnlohr / forgot_to_check_out_with_recurse_submodules.md
Last active August 19, 2024 16:58
Git forgot to clone recursively (forgot to check out with recurse submodules)

[x] Setup environment for wireguard

STEPS:

  1. Organize zones
  2. Forward wireguard traffic (tunnel unrecognized (0.0.0.0/0) traffic to your default gateway)
  3. Masquerade forwarding traffic (do snat for outgoing and dnat for incoming traffic)

1. Organize Zones