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
@mmozeiko
mmozeiko / !README.md
Last active March 31, 2025 01: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 March 28, 2025 07:01
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
@alyleite
alyleite / wsl.md
Last active March 14, 2025 15:53
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()
@nuno-andre
nuno-andre / export.ps1
Last active June 13, 2024 18:31
Import scoop applications
# export applications
scoop export | sls '([A-Za-z0-9\-\_]+)' |% {
$_.matches.groups[1].value } > apps.txt
# export used buckets
$buckets = scoop export | sls '\[([A-Za-z0-9\-\_]+)\]' |% {
$_.matches.groups[1].value } | select -unique
<# or all installed buckets
$buckets = scoop bucket list
@beci
beci / aur_speed_up.md
Last active March 7, 2025 03:37
Speed up compiling of AUR packages in arch linux

Edit /etc/makepkg.conf

replace in CFLAGS and CXXFLAGS to use the native one

-march=x86-64 -mtune=generic to -march=native

speed up build by set multiple threads

MAKEFLAGS="-j$(nproc)"