Skip to content

Instantly share code, notes, and snippets.

tdcosta100 /
Last active Sep 19, 2021
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

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 components we need to install are tigervnc-standalone-server and systemd-genie.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa), 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 screenshots section for examples.

So let's go. First, we need a working [WSL2](

Ocramius / Caddyfile
Last active Jun 4, 2021
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
View Caddyfile
:80 {
root /serve
polaskj /
Last active Oct 14, 2020 — forked from dfetterman/
Lambda function that takes ECS Cloudwatch events and sends a notification to Slack
# deploy serverless stack
serverless deploy \
--stage "dev" \
--region "us-east-1" \
--service-name "my-service-name" \
--slack-channel "#slack-alerts-example" \
--webhook-url "" \
--ecs-cluster-arn "arn:aws:ecs:us-east-1:123456:cluster/test-cluster"
View PrecompileLatteCommand.php
namespace App\Commands\Cache;
use Nette\Application\UI\ITemplateFactory;
use Nette\Utils\FileSystem;
use Nette\Utils\Finder;
use Symfony\Component\Console\Command\Command;
milo / vhost.conf
Created Nov 22, 2017
Apache proxy to localhost port with WebSockets
View vhost.conf
# Proxy for local running .NET application on port 5000
# a2enmod proxy proxy_http proxy_wstunnel
<VirtualHost *:443>
mortenson /
Last active Jul 22, 2021
List all Docker Compose projects currently running
docker ps --filter "label=com.docker.compose.project" -q | xargs docker inspect --format='{{index .Config.Labels "com.docker.compose.project"}}'| sort | uniq
tinogomes / DNS_TO_LOCALHOST.markdown
Last active Sep 17, 2021
Public DNS Pointing to localhost (
View DNS_TO_LOCALHOST.markdown

Available Public Wildcard DNS Domains pointing to localhost (

It turns out that some kind hearted people already set up wildcard domains for you already. You can use any domain below and/or any subdomain of these and they currently resolve to but could switch at any time to resolve somewhere else. Here's the list of ones I know about. Let me know if there are more!

  • localhost - It will always works. Do you know why? I hope so.
  • [*.] - Managed by @fidian; it will always point to localhost for IPv4 and IPv6
  • [*.] - 👏 👏 👏 👏 👏
  • [*.]
  • [*.]
  • [*.]
johnpapa / .bash_profile
Last active Jan 23, 2020
simple git prompt
View .bash_profile
function parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
export PS1="\u @ \w$\[\033[32m\]\$(parse_git_branch)\[\033[00m\] \n$ "
milo / fid-remove.js
Created Apr 20, 2017
Flash message _fid parameter remove.
View fid-remove.js
(function (w, timeout) {
setTimeout(function () {
var url = w.location.toString();
if (w.history && w.history.replaceState && url.indexOf('_fid=') !== -1) {
w.history.replaceState({}, null, /[?&]_fid=[^&]+$/.test(url)
? url.replace(/[?&]_fid=[^&]+/, '')
: url.replace(/([?&])_fid=[^&]+&/, '$1')
}, timeout || 2000);
jupeter / docker
Created Mar 24, 2017
Turn on Docker Remote API on Ubuntu (on port 2375)
View docker
# File: etc/default/docker
# Use DOCKER_OPTS to modify the daemon startup options.
DOCKER_OPTS="--dns --dns -H tcp:// -H unix:///var/run/docker.sock"