This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'export DISPLAY=${HOSTNAME}.local:0.0' >> ~/.bashrc | |
echo 'export LIBGL_ALWAYS_SOFTWARE=1' >> ~/.bashrc | |
https://sourceforge.net/projects/vcxsrv/files/latest/download | |
start X with "C:\Program Files\VcXsrv\vcxsrv.exe" -ac -multiwindow -nowgl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/vscode/devcontainers/base:dev-alpine-3.14 | |
RUN apk add --no-cache gdb file g++ clang coreutils | |
#RUN rm /etc/alpine-release \ | |
#&& wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub \ | |
#&& wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.33-r0/glibc-2.33-r0.apk \ | |
#&& apk add glibc-2.33-r0.apk | |
#&& apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/testing mono gdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:focal | |
RUN apt update && apt install -y ca-certificates wget gnupg \ | |
&& wget -O - https://download.grammatech.com/gtirb/files/apt-repo/conf/apt.gpg.key | apt-key add - \ | |
&& echo "deb https://download.grammatech.com/gtirb/files/apt-repo focal unstable" >> /etc/apt/sources.list \ | |
&& apt update && apt install -y ddisasm | |
# RUN ddisasm --generate-import-libs --asm=a.exe.asm a.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sed -Ei 's/^# deb-src /deb-src /' /etc/apt/sources.list | |
apt update && apt build-dep -y qemu | |
apt install -y git clang lld | |
mkdir build && cd build | |
CC=clang CXX=clang++ CFLAGS="-O3 -march=skylake -flto=thin" CXXFLAGS="-O3 -march=skylake -flto=thin" LDFLAGS="-fuse-ld=lld -O3 -march=skylake -flto=thin" \ | |
../configure --prefix=$(pwd)/install --target-list=aarch64-linux-user --static --disable-system --enable-linux-user --enable-lto --disable-stack-protector --disable-pie | |
-gsplit-dwarf | |
--disable-strip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <https://raw.githubusercontent.com/swansontec/map-macro/master/map.h> | |
#define CONST_MAP_CASE2(a, b) case a: return b; | |
#define CONST_MAP_CASE(pair) CONST_MAP_CASE2 pair | |
#define HEAD(h, ...) h | |
#define CONST_MAP_RET2(a, b) return decltype(b){}; | |
#define CONST_MAP_RET(pair) CONST_MAP_RET2 pair | |
#define CONST_MAP(name, ...) \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 460 | |
#extension GL_KHR_shader_subgroup_vote: require | |
layout (location = 0) in float lightDistanceSqared; | |
layout (location = 0) out vec4 fragColor; | |
void main() | |
{ | |
const int radius = 5; | |
#if 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int baseline(int x) | |
{ | |
switch (x) | |
{ | |
case 0: | |
case 2: | |
case 8: | |
case 15: | |
case 16: | |
return 5; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ErrorActionPreference = "Stop" | |
$files = Get-ChildItem -Path C:\Users -Recurse -Include "ext4.vhdx" -Force -ErrorAction SilentlyContinue | Select-Object FullName, Length | |
wsl -u root fstrim / | |
foreach ($file in $files) { | |
echo "Compacting $file" | |
wsl --shutdown | |
Mount-VHD -Path $file.FullName -ReadOnly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt install -y llvm clang ccache | |
git clone https://github.com/nathanchance/WSL2-Linux-Kernel | |
cd WSL2-Linux-Kernel | |
cp arch/x86/configs/wsl2_defconfig .config | |
./scripts/config -d XFS_FS -d NFS_FS -d NFSD -d BTRFS_FS -d F2FS_FS -d SUNRPC -d X86_X32 -d X86_16BIT -e CPU_FREQ -e CPU_FREQ_STAT -e CPU_FREQ_GOV_USERSPACE -e CPU_FREQ_GOV_ONDEMAND -e X86_INTEL_PSTATE -e SCHED_MC_PRIO -e PROFILING -e PERF_EVENTS_INTEL_UNCORE -e PERF_EVENTS_INTEL_RAPL -e PERF_EVENTS_INTEL_CSTATE -e ENERGY_MODEL -e INTEL_IDLE -e MODULE_COMPRESS_LZ4 -e KERNEL_LZ4 -e CC_OPTIMIZE_FOR_PERFORMANCE_O3 -e LD_DEAD_CODE_DATA_ELIMINATION -e BPF_JIT -e LTO_CLANG_THIN -d CFI_CLANG -d STACKPROTECTOR -e OPROFILE -e OPROFILE_EVENT_MULTIPLEX | |
./scripts/config -d SPECULATION_MITIGATIONS -d NETFILTER | |
# /sys/kernel/debug/tracing not available without this | |
./scripts/config -d SECURITY_LOCKDOWN_LSM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://godbolt.org/z/9vWYd8 | |
#include <utility> // forward, integer_sequence | |
#include <tuple> // get | |
namespace detail { | |
template <typename F, typename Tuple, std::size_t... I> | |
constexpr void static_foreach_impl(Tuple&& t, F&& f, std::index_sequence<I...>) | |
{ | |
// assume f is a simple FunctionObject, so just call instead of std::invoke |