Skip to content

Instantly share code, notes, and snippets.

View ShabbirHasan1's full-sized avatar

Xor Byte ShabbirHasan1

View GitHub Profile
@ShabbirHasan1
ShabbirHasan1 / kvm-gpu-passthrough-on-debian-buster.md
Created August 1, 2025 09:18 — forked from nephest/kvm-gpu-passthrough-on-debian-buster.md
Setting up KVM with GPU passthrough in Debian Buster

Here's how to set up a Windows 10 virtual machine in KVM with PCI passthrough. The VM will have access to an NVIDIA graphics card while the host machine (running Debian Buster) uses Intel integrated graphics. This is mostly for my own reference so I don't forget how I did it.

Hardware

  • Intel i5 (an old one) with integrated graphics: this will be used as the graphics card for the host machine running Debian Buster
  • NVIDIA Geforce 1070: this will be used as the graphics card for the Windows 10 VM

Step 1: Enable IOMMU

In order to do hardware passthrough with KVM at all, you need to enable the Intel Vt-d virtualization extensions. Edit /etc/default/grub and edit the GRUB_CMDLINE_LINUX_DEFAULT line so that it reads like:

Low-latency guests in KVM

Summary

Obtaining a low-latency guests in KVM (i.e.: low DPC latency for Windows guests) can be difficult. Without it, you may hear cracks/pops in audio or freezes in the VM, so they can be very annoying, specially for gaming dedicated VMs.

This document summarizes some of my findings on this subject.

Configuring KVM for real-time workloads

@ShabbirHasan1
ShabbirHasan1 / sysctl.conf
Created July 28, 2025 09:33 — forked from ftkro/sysctl.conf
Ubuntu sysctl.conf
net.ipv4.ip_forward = 1
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.eth0.send_redirects = 0
net.ipv4.conf.lo.send_redirects = 0
net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv4.conf.eth0.accept_redirects = 0
net.ipv4.conf.lo.accept_redirects = 0
net.ipv4.tcp_fastopen = 0x403
@ShabbirHasan1
ShabbirHasan1 / gist:c04da3bb69438d7dc04ddf779b836c6a
Created July 28, 2025 07:48 — forked from jedi4ever/gist:903751
Tuning stuff for Ubuntu hosts
# /etc/security/limits.conf
* soft nofile 999999
* hard nofile 999999
root soft nofile 999999
root hard nofile 999999
===========================================================
# /etc/sysctl.conf
# sysctl for maximum tuning
@ShabbirHasan1
ShabbirHasan1 / attributes.rb
Created July 17, 2025 01:43 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@ShabbirHasan1
ShabbirHasan1 / howto.md
Created July 1, 2025 05:25 — forked from tirbofish/howto.md
Installing Rust on windows desktops without admin

Installing rust on desktops without admin

Are you on a computer where you cannot get MSVC on a computer because of admin? Well, this guide should help you out!

Note

This guide is only for windows.

  1. Download rustup/rust-init for windows. Download from here: https://www.rust-lang.org/tools/install or download from the web. Don't install it yet
  2. Download msys2. You will not be using MSVC, but instead be compiling using GNU. It does not make any differences (afaik) compared to MSVC. Download it from here: https://www.msys2.org/ and run through the setup. Msys2 should not require admin as it is copying folders. In the case that it does require it,
sysctl -w fs.file-max=12000500
sysctl -w fs.nr_open=20000500
ulimit -n 4000000
sysctl -w net.ipv4.tcp_mem='10000000 10000000 10000000'
sysctl -w net.ipv4.tcp_rmem='1024 4096 16384'
sysctl -w net.ipv4.tcp_wmem='1024 4096 16384'
sysctl -w net.core.rmem_max=16384
sysctl -w net.core.wmem_max=16384
wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb
sudo dpkg -i erlang-solutions_1.0_all.deb
@ShabbirHasan1
ShabbirHasan1 / sysctl.conf
Created May 20, 2025 10:41 — forked from maprangzth/sysctl.conf
ubuntu sysctl performance tuning
# Kernel sysctl configuration file for Linux
#
# Version 1.12 - 2015-09-30
# Michiel Klaver - IT Professional
# http://klaver.it/linux/ for the latest version - http://klaver.it/bsd/ for a BSD variant
#
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
@ShabbirHasan1
ShabbirHasan1 / cors-proxies.md
Created May 17, 2025 09:21 — forked from reynaldichernando/cors-proxies.md
CORS Proxies (Updated 2025)

CORS Proxies (Updated 2025)

Free

Proxy (A-Z) Methods Status Code Override Headers Exposed Headers Follow Redirect Timeout Size Limit Rate Limit
allorigins ✅ All ❌ (Always 200) 20/min
cloudflare-cors-anywhere ✅ All ✅ Mirror
codetabs ❌ (only GET) ❌ (Always 200) 625KB 5/sec
cors-anywhere (heroku) ✅ All ✅ Mirror ✅ (max. 5) 50/hour