Skip to content

Instantly share code, notes, and snippets.

View t1m0thyj's full-sized avatar

Timothy Johnson t1m0thyj

  • Pittsburgh, PA
  • 17:19 (UTC -04:00)
View GitHub Profile
@milnak
milnak / ubuntu20-hyperv-enhanced-session.md
Last active April 6, 2024 16:08
[Enabling enhanced session in Hyper-V for Ubuntu 20] This works for me, although it seems that Hyper-V quick create now supports enhanced session by default. #ubuntu #hyperv

Setup Hyper-V enhanced session for Ubuntu 20

I couldn't find instructions that were 100% complete, so I put this together.

These instructions worked fine for me. Follow each step carefully.

Download Ubuntu 20 desktop

DO NOT create the VM by choosing Quick Create in Hyper-V Manager. Follow these instructions exactly.

@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active April 6, 2024 00:36
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 component we need to install is tigervnc-standalone-server.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), 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 installation.

@Kazark
Kazark / Maybe.cs
Last active October 25, 2019 01:05
Maybe monad encoding in C#
class Nothing : Exception {}
public static class Maybe {
public static void Nothing() => throw new Nothing();
public static void Guard(bool cond) { if (!cond) Nothing(); }
public static void GuardNot(bool cond) { if (cond) Nothing(); }
}
public static class TryParse {
public static UInt32 UInt32(string x) {
@abdusco
abdusco / active_desktop.py
Last active May 29, 2021 01:03
Enable ActiveDesktop and set wallpaper with fade effect on Windows (tested on W10)
import ctypes
from win32com.shell import shell, shellcon
import pythoncom
def enable_active_desktop():
"""
Taken from:
https://stackoverflow.com/a/16351170
@Schoggiweggli
Schoggiweggli / mojavewallpaper_WinMac.txt
Created October 26, 2018 19:42
mojavewallpaper_WinMac
10:40AM
Windows: image 3 - Mac: image 4
10:50AM / Windows switched
Windows: image 4 - Mac: image 4
11:40AM Mac switched
Windows: image 4 - Mac: image 5
11:45AM Windows switched
@AveYo
AveYo / .. MediaCreationTool.bat ..md
Last active April 12, 2024 17:23
Universal MediaCreationTool wrapper for all MCT Windows 10 versions - MOVED TO github.com/AveYo/MediaCreationTool.bat
@jamesthompson
jamesthompson / install-stack-raspbian.sh
Created February 1, 2017 16:46
A script to install stack on Raspbian
#!/bin/sh
set +ex
# A script to install stack on Raspbian
# Use stack installer script to install stack
curl -sSL https://get.haskellstack.org/ | sh
# Use apt-get to install llvm
@olivertappin
olivertappin / create-large-file.sh
Last active March 7, 2023 06:36
Create a large file for testing
# Please note, the commands below will create unreadable files and should be
# used for testing file size only. If you're looking for something that has
# lines in it, use /dev/urandom instead of /dev/zero. You'll then be able to
# read the number of lines in that file using `wc -l large-file.1mb.txt`
# Create a 1MB file
dd if=/dev/zero of=large-file-1mb.txt count=1024 bs=1024
# Create a 10MB file
dd if=/dev/zero of=large-file-10mb.txt count=1024 bs=10240
/**
* This Google Sheets script keeps data in the specified column sorted any time
* the data changes.
*
* After much research, there wasn't an easy way to automatically keep a column
* sorted in Google Sheets, and creating a second sheet to act as a "view" to
* my primary one in order to achieve that was not an option. Instead, I
* created a script that watches for when a cell is edited and triggers
* an auto sort.
*
@yamen
yamen / generate-certificate-chain.sh
Last active February 16, 2024 21:03
Generate a full self-signed certificate chain (Root -> Intermediate CA -> Server) using keytool, that can be used for 'localhost' development
#!/bin/bash
rm *.jks 2> /dev/null
rm *.pem 2> /dev/null
echo "===================================================="
echo "Creating fake third-party chain root -> ca"
echo "===================================================="
# generate private keys (for root and ca)