Skip to content

Instantly share code, notes, and snippets.

View HE7086's full-sized avatar
🤨
Premature Optimizer

HE7086 HE7086

🤨
Premature Optimizer
  • München
View GitHub Profile
@HE7086
HE7086 / display.ps1
Created April 10, 2025 10:53
Toggle non-primary displays on windows
$Displays = Get-DisplayInfo | Where-Object {-not $_.Primary}
foreach ($Display in $Displays) {
if ($Display.Active) {
Disable-Display -DisplayId $Display.DisplayId
} else {
Enable-Display -DisplayId $Display.DisplayId
}
}
@HE7086
HE7086 / font.reg
Created April 19, 2024 09:23
How to use Chinese font in English version of Windows
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
"Segoe UI (TrueType)"=""
"Segoe UI Black (TrueType)"=""
"Segoe UI Black Italic (TrueType)"=""
"Segoe UI Bold (TrueType)"=""
"Segoe UI Bold Italic (TrueType)"=""
"Segoe UI Emoji (TrueType)"=""
"Segoe UI Historic (TrueType)"=""
@HE7086
HE7086 / grade-checker.sh
Last active May 6, 2023 11:42
Grade Checker for Practical course: Advanced Systems Programming in C/Rust
#!/bin/bash
# ========================================
# Grade Checker for Practical course:
# Advanced Systems Programming in C/Rust
# ========================================
set -e
RED="\033[31m"
@HE7086
HE7086 / pkg-add.sh
Created July 29, 2022 13:26
Script for adding package to private repo on Arch Linux
#!/bin/bash
REPO="$HOME/repo"
REPO_NAME=repo
SERVER="server:/srv/http"
ARCH=(x86_64 aarch64 i686 arm armv6h armv7h)
for _arg in "$@"; do
# only match zst and xz packages
if [[ ! $_arg =~ ^.+\.pkg\.tar\.(zst|xz)$ ]]; then
@HE7086
HE7086 / disk-eject.sh
Created July 25, 2022 18:59
Safely remove disk under linux
#!/bin/bash
if [[ $# -lt 1 ]]; then
echo "disk eject helper"
echo " usage: $0 <block device>"
exit
fi
if [[ ! -b $1 ]]; then
echo "$1 is not a block device! aborting"
@HE7086
HE7086 / git-sparse-checkout.sh
Last active July 18, 2022 13:47
git sparse checkout helper
#!/bin/bash
if [[ $# -lt 1 ]]; then
echo "git sparse-checkout helper"
echo " usage: $0 <url>"
exit
fi
set -e