Skip to content

Instantly share code, notes, and snippets.

View lzlrd's full-sized avatar
🛍️
Keeping the digital till running.

Diab Neiroukh lzlrd

🛍️
Keeping the digital till running.
View GitHub Profile
@lzlrd
lzlrd / wslg-guide.md
Last active September 1, 2025 18:24
How to get WSLg working with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances.

WSLg with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances

Note: I haven't documented CUDA here. I'm lazy (and haven't tested on Arch). See https://documentation.ubuntu.com/wsl/en/latest/howto/gpu-cuda for that on Ubuntu.

Context

microsoft/wslg#1312:

So I got this working on both Ubuntu, and Arch. First, start with a fresh install (of archlinux from https://gitlab.archlinux.org/archlinux/archlinux-wsl or Ubuntu from wsl --install Ubuntu or https://apps.microsoft.com/detail/9pdxgncfsczv).

Arch

*/2 * * * * /bin/bash /etc/rc.local > "/dev/null" 2>&1
@lzlrd
lzlrd / .bashrc
Last active August 27, 2024 19:29
Prompts
#! /usr/bin/env bash
# shellcheck disable=SC1090,SC1091
shopt -s histappend
mkjump() {
mkdir -p "$1"
cd "$1" || echo "Failed to cd into $1." && return 1
}
ipconfig /release
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
ipconfig /registerdns
@lzlrd
lzlrd / Fix Network.bat
Last active July 4, 2024 10:00
Apply https://davidvielmetter.com/tricks/netsh-int-ip-reset-says-access-denied before running (preferably to Administrators, only).
ipconfig /release
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
ipconfig /registerdns
load_module /usr/lib/nginx/modules/ngx_http_brotli_filter_module.so;
load_module /usr/lib/nginx/modules/ngx_http_brotli_static_module.so;
load_module /usr/lib/nginx/modules/ngx_http_zstd_filter_module.so;
load_module /usr/lib/nginx/modules/ngx_http_zstd_static_module.so;
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
@lzlrd
lzlrd / Dockerfile
Created October 18, 2023 03:00
NGINX Docker built top of rolling release QuicTLS, Zlib-ng, the ZSTD module, Mimalloc, and the OQS Provider.
FROM alpine:latest
ENV LD_PRELOAD=/usr/lib/libmimalloc-secure.so
ENV MIMALLOC_LARGE_OS_PAGES=1
ENV NGINX_VERSION=1.25.2
RUN GPG_KEYS=13C82A63B603576156E30A4EA0EA981B66B0D967 \
&& CONFIG="\
--prefix=/etc/nginx \
--sbin-path=/usr/sbin/nginx \
@lzlrd
lzlrd / xsudo.sh
Last active October 13, 2023 00:53
#! /usr/bin/env bash
args="$@"
argsUnsupported="false"
asUser="root"
if [[ $@ == "" ]]; then
echo "usage: xsudo [command [arg ...]]"
echo "usage: xsudo [-u user] [command [arg ...]]"
exit 1
#! /usr/bin/env bash
declare -A extraPaths=( \
["certbot"]="/etc/letsencrypt /root/.secrets/certbot/cloudflare.ini" \
)
takeOwnership() {
local datafsMount="$(stat -c '%n' "/srv/$1" 2> /dev/null)"
local mount="$(podman mount "$1")"
local volumeMount="$(podman volume mount $1 2> /dev/null)"
#! /usr/bin/env bash
case "$1" in
"get")
if [[ -f /tmp/mkinitcpio-defer ]]; then
rm /tmp/mkinitcpio-defer
exit 0
else
exit 1
fi