Skip to content

Instantly share code, notes, and snippets.

View mberz's full-sized avatar

Marco Berzborn mberz

View GitHub Profile
@mberz
mberz / threadedgenerator.py
Created October 31, 2022 09:45 — forked from everilae/threadedgenerator.py
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
@mberz
mberz / patch-edid.md
Created November 16, 2021 08:18 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@mberz
mberz / oh-my-zsh-bira-conda-venv.md
Created January 18, 2021 11:26 — forked from Samyak2/oh-my-zsh-bira-conda-venv.md
Adding virtualenv and conda support to Oh My Zsh Bira theme
@mberz
mberz / wsl2-network.ps1
Created October 7, 2020 11:20 — forked from xmeng1/wsl2-network.ps1
WSL2 Port forwarding port to linux
$remoteport = bash.exe -c "ifconfig eth0 | grep 'inet '"
$found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}';
if( $found ){
$remoteport = $matches[0];
} else{
echo "The Script Exited, the ip address of WSL 2 cannot be found";
exit;
}
@mberz
mberz / discrete_cmap.py
Created June 25, 2020 14:54 — forked from jakevdp/discrete_cmap.py
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"""
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@mberz
mberz / supervisord.sh
Created September 19, 2018 09:28 — forked from danmackinlay/supervisord.sh
an init.d script for supervisord
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Example initscript
# Description: This file should be used to construct scripts to be
# placed in /etc/init.d.