Skip to content

Instantly share code, notes, and snippets.

View lin71008's full-sized avatar
🫠
On vacation

Nick Lin lin71008

🫠
On vacation
  • 23:58 (UTC +08:00)
View GitHub Profile
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active April 17, 2025 04:55
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

Note

If you want to use pure WSLg, you can try the new WSLg (XWayland) tutorial or the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc) and tigervnc-standalone-server.

For this setup, I will use Ubuntu (20.04, 22.04 and 24.04 are working), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample

@davidzchen
davidzchen / sample-google.c
Last active March 13, 2025 21:03
Sample C code using the Google C++ style guide
// Sample file using the Google C++ coding standard.
//
// http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
//
// General rules:
// - Indents are two spaces. No tabs should be used anywhere.
// - Each line must be at most 80 characters long.
// - Comments can be // or /* but // is most commonly used.
// - File names should be lower_case.c or lower-case.c
//
@eternnoir
eternnoir / gist:7701964
Created November 29, 2013 05:30
pandoc markdown to pdf chinese template
\documentclass[$if(fontsize)$$fontsize$,$endif$$if(lang)$$lang$,$endif$$if(papersize)$$papersize$,$endif$$for(classoption)$$classoption$$sep$,$endfor$]{$documentclass$}
\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt
\usepackage{titlesec}
\titleformat{\section}{\LARGE\filcenter}{}{1em}{}
\titleformat{\subsection}{\Large\filcenter}{}{1em}{}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}