Skip to content

Instantly share code, notes, and snippets.

@lucaspar
lucaspar / nvenc-install.sh
Last active April 21, 2025 16:53
Installation script of CUDA-accelerated `ffmpeg` with NVIDIA Encoder
#!/bin/bash
# =========================================================================
# Source: https://gist.github.com/lucaspar/27f5e108b80524b315be10b2a9049817
# =========================================================================
# This script will compile and install a static FFmpeg build with
# support for NVENC in Ubuntu. Updated for Ubuntu 24.04.2,
# with NVIDIA Drivers v535.183.01 and CUDA v12.2 with a GPU
# with CUDA capability 8.6 (RTX 3080). Set ccap below if using
# a different GPU.
# It assumes NVIDIA drivers are installed and that you have a
@aaugustin
aaugustin / admin.py
Last active August 7, 2022 19:39
Read-only ModelAdmin for Django
from django.contrib import admin
class ReadOnlyModelAdmin(admin.ModelAdmin):
"""
ModelAdmin class that prevents modifications through the admin.
The changelist and the detail view work, but a 403 is returned
if one actually tries to edit an object.