Skip to content

Instantly share code, notes, and snippets.

@tdcosta100
tdcosta100 / WSL2GUIWSLg-XWayland-en.md
Last active March 20, 2026 06:57
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

@sutaburosu
sutaburosu / cakeday_hack.ino
Last active January 15, 2025 01:04
Sub-pixel resolution is kinda essential for 16x16 displays.
// by <sutaburosu@gmail.com>
// License: Creative Commons CC0
#include <Arduino.h>
#include <FastLED.h>
#include <colorutils.h>
#define BRIGHTNESS 64
#define LED_PIN 2
#define COLOR_ORDER GRB
@frenck
frenck / hassio_ubuntu_install_commands.sh
Last active February 26, 2025 21:14
Simple install command for installing Hass.io on a Generic Ubuntu/Debian machine
Unbuntu is no longer support by the Home Assistant project.
The installation commands previous listed here, are not up 2 date, not recommended, not supported and, therefore, removed.
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active October 29, 2025 19:24
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@topheman
topheman / git-notes.md
Created June 29, 2015 17:39
Git notes cheat sheet
@jblang
jblang / tpm2.md
Last active December 28, 2025 18:11
TPM2 Protocol Description

TPM2 Protocol Implementation

Introduction

Frame data is transferred inside packets (similar to DMX, for example). A frame is an image representing a matrix or a light scene.

The packets start and end with one-byte characters. In between are a few control bytes followed by the payload. There is no set size for a payload; it is transmitted with each packet. This makes the protocol quite flexible. There are enough bytes in a single packet for an RGB matrix with 21,845 pixels, but if you just want to control an RGBW lamp, that only requires 9 bytes. The variable frame size means there is no overhead, allowing for maximum transfer speed.

TPM2 Packet Structure

@Smerity
Smerity / README
Created September 5, 2013 15:26
Instructions to install the required Python packages for CS109 on Ubuntu using virtualenv
#!/bin/bash
# If you'd like, you can actually run this file
# It likely makes more sense to read it, understand it, and run the instructions yourself
# Create the virtual environment
virtualenv env
# Enter into the virtual environment
source ./env/bin/activate
#!/usr/bin/env python
"""
simple example script for running and testing notebook resulting in a new workbook.
Usage: `ipnbdoctest.py foo.ipynb foo_new.ipynb`
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook.
"""
import io
@preshing
preshing / list_modifications.py
Last active January 21, 2016 04:44
List the contents of folders recursively, sorted by modification time.
#! /usr/bin/env python
# License: http://creativecommons.org/publicdomain/zero/1.0/
# See http://preshing.com/20130115/view-your-filesystem-history-using-python
import optparse
import os
import fnmatch
import time
# Parse options
parser = optparse.OptionParser(usage='Usage: %prog [options] path [path2 ...]')
anonymous
anonymous / example.cpp
Created December 18, 2012 08:57
A modification to http://christopherschwaab.wordpress.com/2012/09/01/generating-switch-statements-in-c/ Added the possibility to define a default option for the switch statement.
#include <stdio.h>
#include <switch.hpp>
// Default option shall be one higher than the last
enum { ADD = 0, SUB = 1, MUL = 2, DIV = 3, MOD = 4, DEFAULT = 5 };
template <int Operation>
struct interpreter {
static inline int run(const int x, const int y);
};