Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
# Clear-Host | |
Import-Module Pester | |
# New-Item -ItemType Directory 'a/b' -Force -ErrorAction Ignore | |
# New-Item -ItemType Directory 'c' -Force -ErrorAction Ignore | |
# New-SmbShare -Name "Shared" -Path "./shared" -FullAccess "Everyone" | |
$ErrorActionPreference = 'Stop' | |
$PesterPreference = [PesterConfiguration]::Default | |
$PesterPreference.Output.StackTraceVerbosity = 'None' |
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
import os | |
import re | |
import zipfile | |
import logging | |
import requests | |
import xml.etree.ElementTree as ET | |
from io import BytesIO | |
#!/usr/bin/env python | |
import ntpath | |
import argparse | |
from ftplib import FTP | |
def upload_file(host, port, | |
username, password, | |
file_path, remote_path): |
--- | |
apiVersion: v1 | |
kind: PersistentVolumeClaim | |
metadata: | |
name: etcd-backup | |
namespace: kube-system | |
spec: | |
accessModes: | |
- ReadWriteOnce | |
volumeMode: Filesystem |
#!/usr/bin/env python3 | |
import base64 | |
from getpass import getpass | |
def create_secret_yaml(secret_name, **kwargs): | |
""" | |
Create k8s Secret Yaml with key: value | |
Value must already be base64 encoded and in utf-8 encoded bytes |
--- | |
- name: Setup Docker engine with specific configuration and secure TCP socket | |
hosts: all | |
become: yes | |
vars: | |
ca_key: /etc/docker/ssl/ca-key.pem | |
ca_cert: /etc/docker/ssl/ca.pem | |
server_key: /etc/docker/ssl/server-key.pem | |
server_cert: /etc/docker/ssl/server-cert.pem | |
client_key: /etc/docker/ssl/client-key.pem |
#!/bin/bash | |
install_deps_windows() { | |
echo "Installing Build Dependencies (Windows)..." | |
choco install -y make visualstudio2019buildtools visualstudio2019-workload-vctools | |
} | |
install_deps_darwin() { | |
echo "Installing Build Dependencies (Darwin)..." | |
xcode-select --install |
#!/bin/bash | |
install_deps_windows() { | |
echo "Installing Build Dependencies (Windows)..." | |
choco install -y make visualstudio2019buildtools visualstudio2019-workload-vctools | |
} | |
install_deps_darwin() { | |
echo "Installing Build Dependencies (Darwin)..." | |
xcode-select --install |