Skip to content

Instantly share code, notes, and snippets.

View lzlrd's full-sized avatar
🛍️
Keeping the digital till running.

Diab Neiroukh lzlrd

🛍️
Keeping the digital till running.
View GitHub Profile
@lzlrd
lzlrd / disable-cstate
Last active May 4, 2025 13:08
A Systemd Service to disable CPU C-States at runtime. A hack whilst I tune voltages for stability.
#! /usr/bin/env bash
SYSFS_FILES_PATTERN="/sys/devices/system/cpu/cpu*/cpuidle/state[$1]/disable"
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root."
exit 1
fi
cleanup() {
"""
Immich WebDAV Wrapper
Connects to Immich API and serves album assets via WebDAV.
"""
import hashlib
import logging
import os
import requests

Privacy Policy for Services Provided by Diab Neiroukh (ayoo.by / thezest.dev)

Effective Date: April 11, 2025 Last Updated: April 11, 2025

1. Introduction

Welcome to the services provided by Diab Neiroukh ("we," "us," or "our") via the domains ayoo.by, thezest.dev, and any associated subdomains or platforms (collectively, the "Services").

This Privacy Policy explains how we collect, use, disclose, and safeguard your information when you use our Services. Please read this privacy policy carefully. If you do not agree with the terms of this privacy policy, please do not access or use the Services.

#! /usr/bin/env bash
rxGroListFlag=false
txNocacheCopyFlag=false
if [ $# -eq 0 ]; then
echo "[ethtool-offload] Enabling offloading on all interfaces."
interfaces="$(ip -o link show | awk -F': ' '{print $2}' | grep -v "lo" | sed 's/@.*$//')"
else
echo "[ethtool-offload] Enabling offloading on the following interfaces: $@."
@lzlrd
lzlrd / hostname
Created April 1, 2025 17:26
hostname replacement for OpenWRT.
#! /usr/bin/env bash
if [ -n "$1" ]; then
uci set system.@system[0].hostname="$1"
uci commit
echo "$1" > /proc/sys/kernel/hostname
else
# We don't use `uci get system.@system[0].hostname` here as it may
# be out of date.
cat /proc/sys/kernel/hostname
#! /hint/bash
# shellcheck disable=2034
#
# /etc/makepkg.conf
#
DLAGENTS=(
'file::/usr/bin/curl -qgC - -o %o %u'
'ftp::/usr/bin/aria2c -UWget -s4 -x4 %u -o %o --follow-metalink=mem --async-dns=false'
@lzlrd
lzlrd / wslg-guide.md
Last active April 27, 2025 17:55
How to get WSLg working with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances.

WSLg with OpenGL, Vulkan, and CUDA on (Official) Arch Linux and Ubuntu WSL Instances

Note: I haven't documented CUDA here. I'm lazy (and haven't tested on Arch). See https://documentation.ubuntu.com/wsl/en/latest/howto/gpu-cuda for that on Ubuntu.

Context

microsoft/wslg#1312:

So I got this working on both Ubuntu, and Arch. First, start with a fresh install (of archlinux from https://gitlab.archlinux.org/archlinux/archlinux-wsl or Ubuntu from wsl --install Ubuntu or https://apps.microsoft.com/detail/9pdxgncfsczv).

Arch

*/2 * * * * /bin/bash /etc/rc.local > "/dev/null" 2>&1
@lzlrd
lzlrd / .bashrc
Last active August 27, 2024 19:29
Prompts
#! /usr/bin/env bash
# shellcheck disable=SC1090,SC1091
shopt -s histappend
mkjump() {
mkdir -p "$1"
cd "$1" || echo "Failed to cd into $1." && return 1
}
ipconfig /release
ipconfig /renew
arp -d *
nbtstat -R
nbtstat -RR
netsh winsock reset
netsh int ip reset all
netsh winhttp reset proxy
ipconfig /flushdns
ipconfig /registerdns