Skip to content

Instantly share code, notes, and snippets.

View rmlandvreugd's full-sized avatar

R. Mathieu Landvreugd rmlandvreugd

View GitHub Profile
@oleksis
oleksis / wsl2- Linux-6.3.md
Last active April 7, 2023 18:43
WSL2 and Custom Linux/x86 Kernel >= v6.3-rc4

WSL2 and Custom Linux/x86 Kernel v6.3-rc4

Follow the Custom Linux/x86 Kernel Configuration for compile the Linux kernel source >= v6.3-rc4 getting this errors:

wsl -d Ubuntu Output:

Catastrophic failure
Error code: Wsl/Service/CreateInstance/CreateVm/ConfigureNetworking/E_UNEXPECTED
Catastrophic failure
@nkhitrov
nkhitrov / structlog_fastapi.py
Created March 16, 2023 00:04
Structlog FastAPI example
"""
Structlog example configuration with FastAPI.
Features:
- async bound logger
- contextvars to log request-id and other meta data
- custom format for default logging loggers and structlog loggers
"""
import asyncio
import logging
@oleksis
oleksis / v1.0.0_wsl2_wslg_display_x0.md
Last active September 8, 2024 09:08
X11 display socket in WSLg

Update to WSL2 v1.0.0

➜ wsl --shutdown
➜ wsl --update --web-download
➜ wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
@bpradipt
bpradipt / ocp410-params.yaml
Last active March 17, 2023 11:10
kcli params for deploying OpenShift 4.10
# Cluster domain
domain: test410.com
# Cluster name
cluster: test
# RHCOS image name in the libvirt storage pool
# You can leave it empty for kcli to download and use the release specific image
# image:
imagecontentsources: []
mdns: True
@sts10
sts10 / rust-command-line-utilities.markdown
Last active July 7, 2025 16:53
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@jwkenney
jwkenney / users.fact
Created December 10, 2021 07:28
Custom Ansible fact for local Linux users
#!/usr/bin/env bash
# Requires Bash v4+
# Gathers Ansible facts for local Linux users from /etc/passwd, and optionally /etc/shadow.
# Place this under /etc/ansible/facts.d/ on your remote hosts,
# and make it executable. Ansible will save user info under the 'ansible_local' fact,
# whenever a playbook gathers facts.
# You can toggle whether to also include password expiration data from /etc/shadow.
# THIS REQUIRES ROOT PRIVILEGES TO WORK, or else empty / '0' results will be returned.
gather_shadow=true
@slavistan
slavistan / cuda-ready-archlinux-for-wsl2.md
Last active June 1, 2025 20:02
CUDA-ready Archlinux for WSL2

This is a brief guide on how to install Archlinux as a WSL2 distribution and how to set up CUDA afterwards.

As of late, Window's WSL2 offers GPU passthrough from WSL2/Linux to Windows for NVidia graphics cards which allows to run (and develop) CUDA-based applications on the WSL2/Linux-side with almost native performance. Unfortunately, the official guides for the CUDA setup for WSL2/Linux are predominantly Ubuntu-specific. Here's to you, Arch!

1. Install Archlinux

  1. Make sure that your Windows meets the dependencies and that your WSL2 is set up. See these instructions.

Archlinux is not among the default distributions available for WSL2. We'll install it from a tarball instead, a functionality offered natively by the WSL.

@Nimamoh
Nimamoh / win-gpg-agent-relay.sh
Last active April 7, 2025 23:56
win-gpg-agent-relay
#!/usr/bin/env bash
GNUPGHOME="$HOME/.gnupg"
PIDFILE="$GNUPGHOME/win-gpg-agent-relay.pid"
LOGFILE="$GNUPGHOME/win-gpg-agent-relay.log"
is_pid_running() {
if [[ -z "$1" ]]; then
return 1
fi
@MatMercer
MatMercer / wsl-vpn-fix.sh
Last active April 5, 2025 02:20
Fix WSL 2 DNS resolution when connected to Cisco AnyConnect VPN
#!/bin/bash
#--------------------------------------------------------------------------------#
# #
# Fix WSL DNS resolution with Cisco AnyConnect #
# #
# ! Don't forget to set this configuration in /etc/wsl.conf: #
# [network] #
# generateResolvConf = false #
# #
# Based on: #