Skip to content

Instantly share code, notes, and snippets.

View MrDwarf7's full-sized avatar
🏠
Working from home

Blake B. MrDwarf7

🏠
Working from home
  • Australia
View GitHub Profile
@Csqhi515
Csqhi515 / CompactWSL.bat
Created October 18, 2024 17:35
Script to help compact WSL and vhdx.
@echo off
net session >nul 2>&1
if %errorlevel% neq 0 (
echo Requesting administrative privileges...
powershell -Command "Start-Process '%~f0' -Verb RunAs"
exit /b
)
wsl sudo fstrim --all; echo "Exit status: $?";
@AntonC9018
AntonC9018 / .wezterm.lua
Last active September 1, 2024 14:54
Wezterm config
local wezterm = require 'wezterm'
local act = wezterm.action
local config = wezterm.config_builder()
config.use_dead_keys = false
-- https://github.com/wez/wezterm/discussions/5102
config.enable_kitty_keyboard = true
config.allow_win32_input_mode = false
@pablomdo
pablomdo / Dockerfile
Created April 7, 2023 19:58
Docker Squid proxy server example
# Use the official Ubuntu 20.04 image as the base
FROM ubuntu:20.04
# Set environment variables to avoid interactive installation
ENV DEBIAN_FRONTEND=noninteractive
# Update package list and install Squid
RUN apt-get update && \
apt-get install -y squid
@marvinlehmann
marvinlehmann / powershell-wol.md
Created October 26, 2022 14:58
How to enable Wake-On-Lan on Windows 10 using PowerShell

Settings for Wake-On-Lan

0. Enabling it in BIOS/UEFI

1. Disabling fast startup and/or hibernation

Turning off fast startup:

New-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Power" -Name HiberbootEnabled -PropertyType DWord -Value 0 -Force

Disabling hibernation, which disables fast startup too (?): POWERCFG /HIBERNATE OFF

@mmozeiko
mmozeiko / !README.md
Last active July 10, 2025 00:48
Download MSVC compiler/linker & Windows SDK without installing full Visual Studio

This downloads standalone MSVC compiler, linker & other tools, also headers/libraries from Windows SDK into portable folder, without installing Visual Studio. Has bare minimum components - no UWP/Store/WindowsRT stuff, just files & tools for native desktop app development.

Run py.exe portable-msvc.py and it will download output into msvc folder. By default it will download latest available MSVC & Windows SDK - currently v14.40.33807 and v10.0.26100.0.

You can list available versions with py.exe portable-msvc.py --show-versions and then pass versions you want with --msvc-version and --sdk-version arguments.

To use cl.exe/link.exe first run setup_TARGET.bat - after that PATH/INCLUDE/LIB env variables will be updated to use all the tools as usual. You can also use clang-cl.exe with these includes & libraries.

To use clang-cl.exe without running setup.bat, pass extra /winsysroot msvc argument (msvc is folder name where output is stored).

@bubba-h57
bubba-h57 / instructions.md
Last active April 20, 2025 21:08
Configuring Jetbrains Gateway and WSL

Step 1: SSH Daemon

In your WSL instance, re-install OpenSSH server as follows.

sudo apt remove --purge openssh-server
sudo apt install openssh-server

Edit /etc/ssh/sshd_config (e.g. sudo vi /etc/ssh/sshd_config) and add the following lines to the bottom of the file. Ensure you replace WSL_ACCOUNT_NAME with your WSL2 account name.

@SynCap
SynCap / Rename-GitBranch.psm1
Last active September 27, 2023 11:53
Rename Git branch locally and remote with PowerShell
# Raname current branch Locally and Remote
function Rename-GitBranch {
[CmdletBinding()]
param(
[Parameter(mandatory=$true)][String] $OldName,
[Parameter(mandatory=$true)][String] $NewName,
[String] $UpstreamName = 'origin'
)
# Rename the local branch to the new name
@boh
boh / Windows command line gui access.md
Created July 12, 2021 11:36 — forked from scotgabriel/Windows command line gui access.md
Common windows functions via rundll user32 and control panel

Rundll32 commands

OS: Windows 10/8/7

Add/Remove Programs

  • RunDll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,0

Content Advisor

  • RunDll32.exe msrating.dll,RatingSetupUI

Control Panel

@alyleite
alyleite / wsl.md
Last active July 1, 2025 10:55
Failed to connect to bus: Host is down - WSL 2

» sudo systemctl daemon-reload

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to connect to bus: Host is down

==============================================

Edit*

  1. Open /etc/wsl.conf with any editor:
@hyrious
hyrious / lazy-load-pwsh-module.ps1
Created February 14, 2021 07:19
lazy load in powershell
$LazyLoadProfile = [PowerShell]::Create()
[void]$LazyLoadProfile.AddScript(@'
Import-Module posh-git
'@)
$LazyLoadProfileRunspace = [RunspaceFactory]::CreateRunspace()
$LazyLoadProfile.Runspace = $LazyLoadProfileRunspace
$LazyLoadProfileRunspace.Open()
[void]$LazyLoadProfile.BeginInvoke()