Skip to content

Instantly share code, notes, and snippets.

View DavidArsene's full-sized avatar

DavidArsene

  • Bucharest
  • 06:19 (UTC +02:00)
View GitHub Profile
@DavidArsene
DavidArsene / CompatTelRunner.reg
Created October 10, 2021 19:12
Permanently kill CompatTelRunner.exe
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe]
"Debugger"="%1"
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\CompatTelRunner.exe]
"Debugger"="%1"
@DavidArsene
DavidArsene / kill_chromium_cache.ps1
Created January 1, 2022 14:56
Prevents Chrome and other Chromium-based apps from using the cache folders. Has no side effects
ForEach ($folder in 'Cache', 'Code Cache', 'GPUCache') { Remove-Item -Recurse "$folder/*"; icacls $folder /deny Everyone:F }
# Revert
ForEach ($folder in 'Cache', 'Code Cache', 'GPUCache') { icacls $folder /remove:d Everyone }
#!/bin/bash
[ "$EUID" -ne 0 ] && echo "This script must be ran as root!" && exit 1
system=$(settings list system)
secure=$(settings list secure)
global=$(settings list global)
read -p "Press Enter after changing settings..."
@DavidArsene
DavidArsene / VBS-Disabler-UEFI.ps1
Created March 29, 2024 07:20
Disable VBS UEFI Lock. Disable in Group Policy first (System\Device Guard\Turn On VBS). Reboot after running and follow the prompts.
using namespace System.Security.Principal
if (-Not ([WindowsPrincipal] [WindowsIdentity]::GetCurrent()).IsInRole([WindowsBuiltInRole]::Administrator)) {
Start-Process PowerShell -Verb RunAs -ArgumentList "-NoProfile -File `"$PSCommandPath`""
Exit
}
$id = "0cb3b571-2f2e-4343-a879-d86a476d7215"
mountvol X: /s # EFI Partition
@DavidArsene
DavidArsene / ctrl_c.rs
Created May 1, 2025 14:43
Tiny Ctrl+C handler for Rust. Windows-only, thread-unsafe.
#![allow(static_mut_refs)]
use windows::core::BOOL;
use windows::Win32::Foundation::*;
use windows::Win32::System::Console::*;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum Event {
None,
CtrlC,
@DavidArsene
DavidArsene / jb-manual-patch.ps1
Created May 8, 2025 16:12
Manually download and install patches for JetBrains IDEs
# Go to https://www.jetbrains.com/updates/updates.xml
# Look for your app, remember <code> and product slug from jetbrains.com/SLUG/download
# First build (latest) take fullNumber
# Find a <patch from= with fullFrom of installed build
# Download patch like this: https://download-cdn.jetbrains.com/SLUG/CODE-OLDFULL-NEWFULL-patch-win.jar
# Don't use JBR java; repace install dir
java -cp YOUR-PATCH-FILE.jar com.intellij.updater.Runner install --no-backup "C:\Program Files\JetBrains\APP NAME"
@DavidArsene
DavidArsene / Cleanup-EFI.ps1
Last active June 10, 2025 19:49
Remove most languages from EFI partition. TODO fonts
mountvol S: /S
Get-ChildItem S:\EFI\Microsoft\Boot -Filter '??-*' | Where-Object Name -CNE 'en-US' | Remove-Item -Recurse
mountvol S: /D
@DavidArsene
DavidArsene / nvwsllib.ps1
Created June 18, 2025 18:44
Remove WSL libs from NVIDIA driver. Use NVCleanInstall with disable telemetry to rebuild signature
Clear-Content -Path .\Display.Driver\* -Filter "lib*" -Verbose
@DavidArsene
DavidArsene / fastfetch-nixos-generation.sh
Last active October 1, 2025 06:43
{ "type": "command", "text": "~/.config/fastfetch/fastfetch-nixos-generation.sh", "key": "Generation" },
#!/usr/bin/env bash
pushd "/nix/var/nix/profiles" > /dev/null
function gen-to-num() {
if [[ "$1" =~ system-([0-9]+)-link ]]; then
echo "${BASH_REMATCH[1]}"
fi
}
@DavidArsene
DavidArsene / wplace.sh
Last active September 1, 2025 13:48
Download image tiles from Wplace. Uses wget and imagemagick.
#!/usr/bin/env bash
set -euo pipefail
# How to use:
# Look at network requests for s0/tiles, then first number is latitude, second is longitude.
[[ $# -ne 5 ]] && { echo "Usage: $0 <dir> <lat_start> <lat_end> <lon_start> <lon_end>"; exit 1; }
dir="$1"
lat_start="$2"
lat_end="$3"