Skip to content

Instantly share code, notes, and snippets.

@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
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
View WSL2GUIXvnc-en.md

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](https://docs.microsoft.com/pt-br/windows/wsl/w

@Ocramius
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
polaskj / deploy.sh
Last active Oct 14, 2020 — forked from dfetterman/lambda_function-ECS-cloudwatch-slack.py
Lambda function that takes ECS Cloudwatch events and sends a notification to Slack
View deploy.sh
#!/bin/bash
# deploy serverless stack
serverless deploy \
--stage "dev" \
--region "us-east-1" \
--service-name "my-service-name" \
--slack-channel "#slack-alerts-example" \
--webhook-url "https://hooks.slack.com/services/12345/12345/abcdefg" \
--ecs-cluster-arn "arn:aws:ecs:us-east-1:123456:cluster/test-cluster"
View PrecompileLatteCommand.php
<?php
declare(strict_types=1);
namespace App\Commands\Cache;
use Nette\Application\UI\ITemplateFactory;
use Nette\Utils\FileSystem;
use Nette\Utils\Finder;
use Symfony\Component\Console\Command\Command;
@milo
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>
ServerName example.com
ServerAdmin webmaster@example.com
@mortenson
mortenson / composelist.sh
Last active Jul 22, 2021
List all Docker Compose projects currently running
View composelist.sh
#!/bin/bash
docker ps --filter "label=com.docker.compose.project" -q | xargs docker inspect --format='{{index .Config.Labels "com.docker.compose.project"}}'| sort | uniq
@tinogomes
tinogomes / DNS_TO_LOCALHOST.markdown
Last active Sep 17, 2021
Public DNS Pointing to localhost (127.0.0.1)
View DNS_TO_LOCALHOST.markdown

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

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 127.0.0.1 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.
  • [*.]fuf.me - Managed by @fidian; it will always point to localhost for IPv4 and IPv6
  • [*.]fbi.com - 👏 👏 👏 👏 👏
  • [*.]localtest.me
  • [*.]127-0-0-1.org.uk
  • [*.]vcap.me
@johnpapa
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
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
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=""
DOCKER_OPTS="--dns 8.8.8.8 --dns 8.8.4.4 -H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock"