Skip to content

Instantly share code, notes, and snippets.

@Daviid-P
Daviid-P / Hyper-V PCI-Passthroug.ps1
Created April 16, 2026 16:44 — forked from Ruffo324/Hyper-V PCI-Passthroug.ps1
Hyper-V PCIe passthrough CheatSheet
# Change to name of TARGET-VM.
$vm='CHANGE_ME'
# Change to PCI device location (💡 Location).
$Location = 'CHANGE_ME'
# Enable CPU features.
Set-VM -GuestControlledCacheTypes $true -VMName $vm
# Host-Shutdown rule must be changed for the VM.
Set-VM -Name $vm -AutomaticStopAction TurnOff
@Daviid-P
Daviid-P / Copy-GPU-Drivers-VM.ps1
Created April 16, 2026 15:06 — forked from ThioJoe/Copy-GPU-Drivers-VM.ps1
PowerShell script to copy GPU drivers to Hyper-V Virtual Machine for passthrough.
# Description: This script will automatically copy the necessary GPU drivers from your current host machine into a Hyper-V Virtual Machine
# so you can pass through the GPU to the VM. You should run this whenever you update your graphics drivers on the host.
#
# Author: ThioJoe -- https://github.com/ThioJoe
#
# Note: Currently this only works for Nvidia GPUs. But it does support if you have multiple GPUs.
#
# OPTIONAL ARGUMENTS:
# -debug | Enables debug messages that pause the script for each step (No additional string required, just add -debug)
# -name | Sets the virtual machine name so it doesn't need to ask
@Daviid-P
Daviid-P / phpcbf.bat
Created April 23, 2024 08:14
bat file to run with pucelle's RunOnSave VSCode extension
@echo off
REM Set a temporary file to store the output
set outputFile=%TEMP%\phpcbf_output.txt
REM Run phpcbf command and redirect output to the temporary file
C:\xampp7\php\php.exe "C:\Program Files\PHP_Tools\phpcbf" %* > "%outputFile%"
REM Store the exit code of phpcbf
set exitCode=%ERRORLEVEL%
@Daviid-P
Daviid-P / launch.json
Created September 28, 2022 10:40
VSCode php xdebug extension config
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Listen for Xdebug",
"type": "php",
"request": "launch",
@Daviid-P
Daviid-P / php.ini
Created September 28, 2022 10:39
PHP xDebug VScode
[XDebug]
zend_extension = "C:\xampp7\php\ext\php_xdebug.dll"
xdebug.stopOnEntry = true
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = Off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.show_local_vars=0
xdebug.remote_handler = "dbgp"
xdebug.remote_cookie_expire_time = 36000
xdebug.output_dir = "C:\xampp7\tmp"
@Daviid-P
Daviid-P / Microsoft.PowerShell_profile.ps1
Last active June 23, 2024 15:54
Powershell Profile
Function My-History {
[CmdletBinding()]
param()
cat $env:APPDATA\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt
}
Remove-Item 'Alias:\history' -Force
New-Alias -Name 'history' -Value 'My-History' -Scope Global
New-Alias -Name 'grep' -Value 'Select-String' -Scope Global
@Daviid-P
Daviid-P / starship.toml
Last active October 28, 2025 07:45
Prompt for Starship
# ~/.config/starship.toml
command_timeout = 60000
[character]
success_symbol = "[λ](green)"
error_symbol = "[λ](red)"
[username]
style_user = "green bold"