Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
| @mixin text-rendring(){ | |
| text-rendering: optimizeLegibility !important; | |
| -webkit-font-smoothing: antialiased !important; | |
| } | |
| body { | |
| @include text-rendring(); | |
| } |
| # Check Nahimic service status | |
| $nahimicService = Get-Service -Name "Nahimic service" -ErrorAction SilentlyContinue | |
| if ($nahimicService) { | |
| if ($nahimicService.Status -eq "Running") { | |
| Write-Host "Nahimic service is currently running." -ForegroundColor Yellow | |
| Write-Host "Advice: If you're experiencing issues related to Nahimic or high CPU/RAM usage, consider stopping and disabling the service." | |
| } | |
| else { | |
| Write-Host "Nahimic service is present but currently not running." -ForegroundColor Green |
| function parseNetstat { | |
| param([object[]]$Lines) | |
| if ($IsWindows) { | |
| $skip = 4 | |
| } else { | |
| $skip = 3 | |
| } | |
| $Lines | Select-Object -Skip $skip | ForEach-Object { |
| # 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 |