amdgpupassthrough

Install virt-io drivers:

/images/2023_03_21_11_53_28_763x591.jpg

/images/2023_03_21_11_53_54_593x400.jpg

Then the amd gpu:

/images/2023_03_21_11_54_24_330x162.jpg

Get the driver:

/images/2023_03_21_11_56_45_732x511.jpg

/images/2023_03_21_11_57_03_847x445.jpg

Copy the file into :

/images/2023_03_21_14_59_59_792x170.jpg

Then add it into shutdown items:

/images/2023_03_21_15_00_37_919x622.jpg

Edit its sequence:

/images/2023_03_21_15_01_51_470x422.jpg

eject script:

Function Check-RunAsAdministrator()
{
  #Get current user context
  $CurrentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent())
  
  #Check user is running the script is member of Administrator Group
  if($CurrentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator))
  {
       Write-host "Script is running with Administrator privileges!"
  }
  else
    {
       #Create a new Elevated process to Start PowerShell
       $ElevatedProcess = New-Object System.Diagnostics.ProcessStartInfo "PowerShell";
 
       # Specify the current script path and name as a parameter
       $ElevatedProcess.Arguments = "& '" + $script:MyInvocation.MyCommand.Path + "'"
 
       #Set the Process to elevated
       $ElevatedProcess.Verb = "runas"
 
       #Start the new elevated process
       [System.Diagnostics.Process]::Start($ElevatedProcess)
 
       #Exit from the current, unelevated, process
       Exit
 
    }
}
 
#Check Script is running with Elevated Privileges
Check-RunAsAdministrator
 
#Place your script here.
     $deviceName="AMD Radeon(TM) Graphics"
foreach ($dev in (Get-PnpDevice | Where-Object{$_.Name -eq $deviceName})) {
  &"pnputil" /remove-device $dev.InstanceId 
}
# sleep for 8 seconds
Start-Sleep -Seconds 8

#Read more: https://www.sharepointdiary.com/2015/01/run-powershell-script-as-administrator-automatically.html#ixzz7wTuWTBny% 

RecoveryFromUEFI

Use archlinux installation disk for entering the command line, then:

mkdir /mnt/arch
mount -t auto /dev/sda2 /mnt/arch
mount -t auto /dev/sda1 /mnt/arch/boot/
arch-chroot /mnt/arch

Re-install grub:

grub-install --efi-directory=/boot/efi --target=x86_64-efi /dev/sda

Then reboot the machine we could see the archlinux reback again.

WorkingTipsOnExtractingBiosItems

from https://www.laomaotao.net/doc/udiskwinpe.html, download the LaoMaoTao and extract it to usb disk .
Use winpe for startup the system.

uefitool for generating the vbt.bin and gop file, but failed.

Workingtipsonvtduefi

Change the default ovmf files:

cd /usr/share/OVMF
mv OVMF_CODE.fd OVMF_CODE.fd.official
cp /home/idv/10th/0623.fd OVMF_CODE.fd

To be continued.

CaddyStaticServer

Install canddy on rpi via:

# sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https -y
# apt-cache search caddy
# curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
# sudo apt update
# sudo apt-get install caddy -y

Configuration files:

$ cat /etc/caddy/Caddyfile 
# The Caddyfile is an easy way to configure your Caddy web server.
#
# Unless the file starts with a global options block, the first
# uncommented line is always the address of your site.
#
# To use your own domain name (with automatic HTTPS), first make
# sure your domain's A/AAAA DNS records are properly pointed to
# this machine's public IP, then replace ":80" below with your
# domain name.

:80 {
	# Set this path to your site's directory.
	root * /media/sda/ucc
	# Enable the static file server.
	file_server browse {
	hide .git
}

basicauth * {
cwgo gowugowuoguwougowugouwogue
}
	# Another common task is to set up a reverse proxy:
	# reverse_proxy localhost:8080

	# Or serve a PHP site through php-fpm:
	# php_fastcgi localhost:9000
}

# Refer to the Caddy docs for more information:
# https://caddyserver.com/docs/caddyfile

The password could be generated via caddy hash-password.

Reload the server:

$  sudo systemctl reload caddy