Skip to content

Instantly share code, notes, and snippets.

View TheArchitectEngineer's full-sized avatar
💭
...

TheArchitectEngineer

💭
...
View GitHub Profile
@TheArchitectEngineer
TheArchitectEngineer / profiles.json
Created April 23, 2025 17:36 — forked from joshtynjala/profiles.json
Ayu color schemes for Windows Terminal
{
"schemes" :
[
{
"background" : "#fafafa",
"black" : "#000000",
"blue" : "#3199e1",
"brightBlack" : "#686868",
"brightBlue" : "#399ee6",
"brightCyan" : "#4cbf99",
@TheArchitectEngineer
TheArchitectEngineer / recursively-rename-extension.sh
Created November 22, 2024 08:40 — forked from bzerangue/recursively-rename-extension.sh
Terminal Script: Recursively rename or change file extensions (this example, changing extension from .html to .php)
find . -name "*.html" | while read i; do mv "$i" "${i%.html}.php"; done

I'm not the author the blog post and this gist is a simply a note on my usage based on the original post, https://boxofcables.dev/kvm-optimized-custom-kernel-wsl2-2022/.

I also changed the code that extract the latest to a concrete linux kernel version.

First start with openSUSE Tumbleweed distro and commands below can be used to build the custom kernel and set it to be used for WSL2 distros.

# prepare build deps
sudo zypper -n up
# original from the post

Install Ruby 3 and Bundler

Resources:

1. Install Ruby

@TheArchitectEngineer
TheArchitectEngineer / build_cross_gcc
Created May 21, 2024 13:44 — forked from preshing/build_cross_gcc
A shell script to download packages for, configure, build and install a GCC cross-compiler.
#! /bin/bash
set -e
trap 'previous_command=$this_command; this_command=$BASH_COMMAND' DEBUG
trap 'echo FAILED COMMAND: $previous_command' EXIT
#-------------------------------------------------------------------------------------------
# This script will download packages for, configure, build and install a GCC cross-compiler.
# Customize the variables (INSTALL_PATH, TARGET, etc.) to your liking before running.
# If you get an error and need to resume the script from some point in the middle,
# just delete/comment the preceding lines before running it again.
@TheArchitectEngineer
TheArchitectEngineer / build-xnu-4570.1.46.sh
Created May 19, 2024 11:27 — forked from bazad/build-xnu-4570.1.46.sh
A script to build XNU version 4570.1.46 (macOS High Sierra 10.13).
#! /bin/bash
#
# build-xnu-4570.1.46.sh
# Brandon Azad
#
# A script showing how to build XNU version 4570.1.46 on MacOS High Sierra
# 10.13 with Xcode 9.
#
# Note: This process will OVERWRITE files in Xcode's MacOSX10.13.sdk. Make a
# backup of this directory first!
@TheArchitectEngineer
TheArchitectEngineer / kernel_patch.sh
Created May 14, 2024 21:09 — forked from Jacobboogiebear/kernel_patch.sh
kernel patch for KVM on Windows WSL2
cp Microsoft/config-wsl .config
sed -i 's/# CONFIG_KVM_GUEST is not set/CONFIG_KVM_GUEST=y/g' .config
sed -i 's/# CONFIG_ARCH_CPUIDLE_HALTPOLL is not set/CONFIG_ARCH_CPUIDLE_HALTPOLL=y/g' .config
sed -i 's/# CONFIG_HYPERV_IOMMU is not set/CONFIG_HYPERV_IOMMU=y/g' .config
sed -i '/^# CONFIG_PARAVIRT_TIME_ACCOUNTING is not set/a CONFIG_PARAVIRT_CLOCK=y' .config
sed -i '/^# CONFIG_CPU_IDLE_GOV_TEO is not set/a CONFIG_CPU_IDLE_GOV_HALTPOLL=y' .config
sed -i '/^CONFIG_CPU_IDLE_GOV_HALTPOLL=y/a CONFIG_HALTPOLL_CPUIDLE=y' .config
sed -i 's/CONFIG_HAVE_ARCH_KCSAN=y/CONFIG_HAVE_ARCH_KCSAN=n/g' .config
sed -i '/^CONFIG_HAVE_ARCH_KCSAN=n/a CONFIG_KCSAN=n' .config
make -j 8
@TheArchitectEngineer
TheArchitectEngineer / wsl-kvm.sh
Last active May 19, 2024 23:16 — forked from afmiguez/wsl-kvm.sh
KVM in WSL2
#!/bin/bash
# Fork & Edited from https://gist.github.com/afmiguez/44c50ea146ea27f94f0696664afc8128
# Fully based on https://boxofcables.dev/kvm-optimized-custom-kernel-wsl2-2022/
if [ -z "$1" ]
then
echo "Must supply your Windows 11 username"
exit
fi
#!/bin/sh
set -e
set -x
mkdir -p build
cd build
# readelf
@TheArchitectEngineer
TheArchitectEngineer / upgrade-gcc.sh
Created May 3, 2024 23:53 — forked from hisplan/upgrade-gcc.sh
Upgrade gcc on Linux
wget https://ftp.gnu.org/gnu/gcc/gcc-6.3.0/gcc-6.3.0.tar.gz
cd gcc-6.3.0
./contrib/download_prerequisites
cd ..
mkdir objdir
cd objdir
$PWD/../gcc-6.3.0/configure --prefix=$HOME/gcc-6.3.0 --enable-languages=c,c++ --disable-multilib
make
make install