Skip to content

Instantly share code, notes, and snippets.

View mikejk8s's full-sized avatar
🦀

Mike Johnson mikejk8s

🦀
  • Denver, CO
View GitHub Profile
@tdcosta100
tdcosta100 / WSL2GUIWSLg-XWayland-en.md
Last active May 9, 2025 10:39
A tutorial to use GUI in WSL2/WSLg replacing original Xorg by Xwayland, allowing WSL to work like native Linux, including login screen

Full desktop shell in WSL2 using WSLg (XWayland)

Note

If you want to use Wayland in WSLg in a simpler setup, you can try the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2. No additional software outside WSL (like VcXsrv or GWSL) is required. You will find this tutorial very similar to the one that replaces Xorg with Xvnc. Indeed, it's pretty much the same tutorial, with some few changes.

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc), and after that, replace the default Xorg by a script that calls Xwayland instead.

For this setup, I will use Ubuntu 24.04, and install GNOME Desktop. Unfortunately older versions of Ubuntu lack some fundamental things, so we cannot reproduce it in older versions (at least not fully). Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample screenshot

@alexaandru
alexaandru / chi.go
Created February 14, 2024 16:40
Chi-like syntactic sugar layer on top of stdlib http.ServeMux
// Chi-like syntactic sugar layer on top of stdlib http.ServeMux.
package main
import (
"net/http"
"slices"
)
type (
middleware func(http.Handler) http.Handler

Rust Cheat Sheet

Variables & Mutability

Variables are immutable by default. This makes Rust safer and makes concurrency easier.
Immutable means once a value is bound to that variable, it cannot be changed.
For example:

fn main() {
 let x = 5;
@mfgbhatti
mfgbhatti / MOTD.md
Last active February 11, 2024 05:03
Ubuntu like motd for arch linux systems
#!/usr/bin/env bash
# ____ __ __ __ __ _
# ____ ___ / __/___ _/ /_ / /_ ____ _/ /_/ /_(_)
# / __ `__ \/ /_/ __ `/ __ \/ __ \/ __ `/ __/ __/ /
# / / / / / / __/ /_/ / /_/ / / / / /_/ / /_/ /_/ /
#/_/ /_/ /_/_/ \__, /_.___/_/ /_/\__,_/\__/\__/_/
# /____/
#
# https://gist.github.com/mfgbhatti/2c2ea5da5d6d7e608d90fd43d4daa4a8
@sts10
sts10 / rust-command-line-utilities.markdown
Last active May 9, 2025 19:03
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
@GitMurf
GitMurf / obsidian.templater.quick-capture.js
Last active September 12, 2024 10:28
Obsidian Quick Capture using templater. Activate from anywhere in your vault to record quick ideas, notes, time logging, etc. The Quick Capture file does NOT need to be open.
<%*
//v1.4: Adding option for including a header for each DNP day to fold
//'first' will add to top of file. 'last' will add to bottom of file
let firstOrLastLine = 'first';
//Name of the Quick Capture file. Do NOT include extension '.md'
let qcFileName = 'Quick Capture';
//Leave this blank if you want to use the default file path location (set to '/' to use root of vault)
@janeczku
janeczku / tf-rancher-cluster-template.md
Last active July 20, 2020 22:29
Rancher Cluster from RKE Template TF

Fetch details of an existing RKE cluster template:

data "rancher2_cluster_template" "hardened" {
    name = "hardened-template"
}

or create a new RKE cluster template:

@vairisingh
vairisingh / install-teleport.sh
Created June 27, 2020 03:39
Script to install Teleport on a system
#!/bin/bash
export version=v4.2.8
export os=linux
export arch=amd64
#####################################
curl -O https://get.gravitational.com/teleport-$version-$os-$arch-bin.tar.gz
tar -xzf teleport-$version-$os-$arch-bin.tar.gz
[wsl2]
kernel=C:\\Users\\JAKA\\vmlinux
@Andor
Andor / .gitlab-ci.yml
Last active February 28, 2023 15:03
terraform .gitlab-ci.yml
---
variables:
terraform_image: terraform-vault-jq
default:
image:
name: $terraform_image
cache:
key: terraform
paths: