Skip to content

Instantly share code, notes, and snippets.

@azidanit
azidanit / Got error when install cuda toolkit in proxmox VM gpu passthought.txt
Created February 17, 2025 03:19
Got error when install cuda toolkit in proxmox VM gpu passthought
sudo nano /etc/modprobe.d/nvidia.conf
blacklist nvidiafb
blacklist nouveau
==================================
sudo update-initramfs -c -d -u
==================================
@azidanit
azidanit / nvidia-gpu-node-exporter.bash
Created November 22, 2024 00:43
nvidia-gpu-node-exporter.bash
echo "software by https://github.com/utkuozdemir/nvidia_gpu_exporter"
wget https://github.com/utkuozdemir/nvidia_gpu_exporter/releases/download/v1.2.1/nvidia-gpu-exporter_1.2.1_linux_amd64.deb
dpkg -i nvidia-gpu-exporter_1.2.1_linux_amd64.deb
@azidanit
azidanit / node_exporter_setup.bash
Created November 22, 2024 00:39
node_exporter_setup
wget https://github.com/prometheus/node_exporter/releases/download/v1.8.2/node_exporter-1.8.2.linux-amd64.tar.gz
tar xvfz node_exporter-*.*-amd64.tar.gz
cd node_exporter-*.*-amd64
mv node_exporter /usr/local/bin/
useradd -rs /bin/false node_exporter
echo "Creating systemd service file..."
cat <<EOF | tee /etc/systemd/system/node_exporter.service > /dev/null
[Unit]
@azidanit
azidanit / how_to_delete_pve_cluster_info.txt
Created November 21, 2024 23:32
How to delete pve cluster info
systemctl stop pve-cluster corosync
pmxcfs -l
rm /etc/corosync/*
rm /etc/pve/corosync.conf
killall pmxcfs
systemctl start pve-cluster
@azidanit
azidanit / how_to_vfio_nvidia_passthrough_debian.txt
Created November 20, 2024 04:20
VFIO nvidia gpu passthrough linux VM proxmox
cat /etc/modprobe.d/nvidia.conf
blacklist nvidiafb
blacklist nouveau
==================================
update-initramfs -c -d -u
==================================
dmesg | grep -i iommu
dmesg | grep -e DMAR -e IOMMU
import socket
import time
server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# Enable broadcasting mode
server.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
server.settimeout(0.2)
@azidanit
azidanit / record_cam.py
Created June 24, 2022 15:30
record video from webcam with datetime filename
import cv2
import numpy as np
from datetime import datetime
# datetime object containing current date and time
now = datetime.now()
dt_string = now.strftime("%d-%m-%Y_%H_%M_%S")
print("date and time =", dt_string)
class ThreadedCamera(object):
def __init__(self, src=0):
self.capture = cv2.VideoCapture(src)
self.capture.set(cv2.CAP_PROP_BUFFERSIZE, 2)
# FPS = 1/X
# X = desired FPS
self.FPS = 1/30
self.FPS_MS = int(self.FPS * 1000)
@azidanit
azidanit / homebrew-install-older-version.md
Created March 14, 2022 07:55
Homebrew: Install an older version of a formula

Homebrew: Install an older version of a formula

kubernetes-cli (v1.10.3) taken as example

  1. Downgrade Homebrew to the commit which upgrades the formula to the specific version that we want
$ cd "$(brew --repo homebrew/core)"
$ git log Formula/kubernetes-cli.rb

...
@azidanit
azidanit / cuda-11.2_installation_on_Ubuntu-18.04
Created February 5, 2022 11:57 — forked from mcvarer/cuda-11.2_installation_on_Ubuntu-18.04
CUDA 11.2 Installation on Ubuntu 18.04
#!/bin/bash
## This gist contains instructions about cuda v11.2 and cudnn 8.1 installation in Ubuntu 18.04 for PyTorch
#############################################################################################
##### forked by : https://gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73 ########
#############################################################################################
### steps ####
# verify the system has a cuda-capable gpu