Skip to content

Instantly share code, notes, and snippets.

@WinkelCode
WinkelCode / mtp_driver_man.ps1
Last active May 2, 2023 09:18
Messing around with Windows drivers can break stuff, use at your own risk. Script requres elevated permissions. You will need PS execution policy "RemoteSigned" (or any that allows running local scripts) and unblock script via file options (or paste it into an empty text file).
# Script to automatically remove and install "appleprecisiontrackpadbluetooth.inf" and "appleprecisiontrackpadusb.inf".
# Script needs to be in an extracted "AppleBcUpdate" folder.
function remove_driver {
$driver_orignames = @("appleprecisiontrackpadbluetooth.inf", "appleprecisiontrackpadusb.inf")
# Get matching installed drivers with pnputil and include previous line (the published name)
$drivers = pnputil /enum-drivers | Select-String -Pattern $driver_orignames -Context 1,0
if ($drivers.Count -gt 2) {
Write-Host "Error: More than 2 drivers found."
# Script to automatically remove "appleprecisiontrackpadbluetooth.inf" and "appleprecisiontrackpadusb.inf".
# Get installed drivers with pnputil and include previous line (the published name)
$drivers = (pnputil /enum-drivers | Select-String -Pattern "appleprecisiontrackpadbluetooth.inf|appleprecisiontrackpadusb.inf" -Context 1,0)
# Sanity check the results
switch ($drivers.Count) {
0 {Write-Host "No drivers found, exiting"; pause; exit}
1 {Write-Host "Only one driver found, are you sure you want to continue?"; Read-Host "Press any key to continue, or Ctrl+C to abort"; Write-Host "Continuing"}
2 {Write-Host "Two drivers found, continuing"}
@WinkelCode
WinkelCode / example.conf
Created December 2, 2021 05:53
My Example WireGuard Config
[Interface]
Address = 10.0.0.1/24
PrivateKey =
ListenPort =
PreUp = iptables -w -P FORWARD DROP; iptables -w -A FORWARD -i %i -o %i -j ACCEPT; echo 1 > /proc/sys/net/ipv4/ip_forward
PostDown = echo 0 > /proc/sys/net/ipv4/ip_forward; iptables -w -D FORWARD -i %i -o %i -j ACCEPT; iptables -w -P FORWARD ACCEPT
[Peer]
PublicKey =
PresharedKey =