Skip to content

Instantly share code, notes, and snippets.

View vadimstasiev's full-sized avatar

AName* name("Vadim"); vadimstasiev

View GitHub Profile
@vadimstasiev
vadimstasiev / 100.conf
Last active April 13, 2024 17:51
Proxmox Single GPU Passthrough VFIO binding and unbinding
agent: 1
balloon: 0
bios: ovmf
boot: order=hostpci0;virtio1
cores: 24
cpu: host,hidden=1,flags=+pdpe1gb;+hv-tlbflush;+aes
efidisk0: local-zfs:vm-100-disk-0,efitype=4m,size=1M
hookscript: local:snippets/hookscript.sh
hostpci0: 0000:06:00,pcie=1,rombar=0,romfile=RTX3090-OG-Founders.bin
hostpci1: 0000:08:00.4
@vadimstasiev
vadimstasiev / readme.md
Created March 5, 2024 17:25
Install ZFSBootMenu on Proxmox

Install ZFSBootMenu on Proxmox

Requirements:

  • you must have installed proxmox with root on zfs - aka when you installed proxmox you installed it on a zfs filesystem

mount /dev/nvme0n1p2 /boot/efi/

mkdir /boot/efi/EFI/zfsbootmenu/

@vadimstasiev
vadimstasiev / turn_off_on_idle.sh
Last active March 5, 2024 17:32
Turn off TrueNAS when system is idle
#!/bin/bash
INACTIVE_THRESHOLD=1800 # 30 minutes in seconds
CHECK_INTERVAL=1 # How often to check disk activity, in seconds
SAMPLE_DURATION=1 # Duration for iostat to collect data, in seconds
DEBUG=1 # Set to 1 to enable debug mode, 0 to disable
LOW_ACTIVITY_THRESHOLD_READ=5000 # Threshold for read activity in kB/s, adjust as needed
LOW_ACTIVITY_THRESHOLD_WRITE=5000 # Threshold for write activity in kB/s, adjust as needed
@vadimstasiev
vadimstasiev / readme.md
Last active January 2, 2024 18:10
ZFS Recovery Cheatsheet

Recovering your system using a ZFS snapshot involves rolling back to the state of the system when the snapshot was taken. This process can vary depending on what exactly has "fucked up" in your system. Here's a general guide on how to recover:

  1. Accessing the System: If your system is still bootable, log in as usual. If it's not bootable, you might need to boot from a live CD/USB that supports ZFS. If using a live environment, you may need to manually import your ZFS pool with zpool import.
  2. Identifying the Snapshot: List available snapshots with zfs list -t snapshot. Find the snapshot you want to roll back to. It will be named something like rpool@snapshot1 if you followed standard naming conventions.
  3. Rolling Back to the Snapshot: Use the zfs rollback command. Be aware that this will destroy all data written to the pool after the snapshot was taken. The command is zfs rollback rpool@snapshot1.
@vadimstasiev
vadimstasiev / readme.md
Created October 6, 2023 16:15
Proxmox Question Mark Icons

Potential Solution to icons on VMs and LXCs turning into question marks

Why? I don't know, but it was the last set of commands that I ran before things started working again, mostly from what I read online the issue seemed to be caused by storage issues, and I did have some corruption going one which I fixed but still had this issue, these last commnands fixed it apparently:

service pve-cluster stop
service corosync stop
service pvestatd stop
service pveproxy stop
service pvedaemon stop
@vadimstasiev
vadimstasiev / pt_oc.json
Created September 1, 2023 16:18
PowerTools
{
"battery": {
"charge_rate": {
"min": 250,
"max": 2500
},
"extra_readouts": false
},
"cpus": {
"cpus": [
@vadimstasiev
vadimstasiev / readme.md
Last active March 29, 2024 10:01
ProxMox - Enable IOMMU using systemd

ProxMox - Enable IOMMU using systemd

You found that you are using systemd, adding bits to GRUB will not work. Instead, follow these steps:

Edit the kernel command line

Open the /etc/kernel/cmdline file for editing:

nano /etc/kernel/cmdline

@vadimstasiev
vadimstasiev / readme.md
Last active February 27, 2023 12:16
backup and restore rasberry pi sd card

Backup

(32G is size of SD card - so it can show progress correctly)

sudo dd bs=4M if=/dev/mmcblk0 | pv -s 32G | gzip > ./Pi4-backup.gz

Restore

sudo gzip -dc ./Pi4-backup.gz | pv -s 32G | sudo dd bs=4M of=/dev/mmcblk0

@vadimstasiev
vadimstasiev / readme.md
Created February 7, 2023 00:04
Nvidia Quadro P400 Passthrough on Proxmox - Reddit Post

Source: https://www.reddit.com/r/jellyfin/comments/cig9kh/nvidia_quadro_p400_passthrough_on_proxmox/

Nvidia Quadro P400 Passthrough on Proxmox

Ok, finally got it working. I'll provide a writeup here of my steps. But these are for Proxmox with an Ubuntu 1810 container only. If you want to use a different setup, you will have to figure it out yourself.

On the host (Proxmox):

  • Install the Proxmox Linux Headers. The version should match your kernel
    apt install pve-headers-$(uname -r)
@vadimstasiev
vadimstasiev / inject.js
Last active January 30, 2023 20:20
Home assistant - frigate card - prevent touch inputs when casting to Google Hub
# Home assistant - frigate card - prevent touch inputs when casting to Google Hub
# The reason I need to prevent touch input is because for some reason playback doesn't work
# and I need static cards that don't start playback when I click on them as the frigate cards do
# there is no option to turn that off so this script can be injected into the dashboard to
# prevent touch input on those cards only
let result = [];