Skip to content

Instantly share code, notes, and snippets.

@patrix87
patrix87 / GPU-Passthrough.md
Last active October 31, 2026 03:36
GPU Passthrough for Jellyfin on Proxmox

GPU Passthrough for Jellyfin on Proxmox

A step-by-step, click-and-paste guide to passing a discrete PCIe GPU from a Proxmox 9 host into a Linux VM and using it for Jellyfin hardware transcoding inside a Docker container.

Target setup

  • Host: Proxmox VE 9 (Debian Trixie–based)
  • Guest: a Linux VM (Ubuntu 24.04 / Debian 12 used here) running Docker
  • App: a single Jellyfin container that wants /dev/dri/renderD128
  • GPU: any modern discrete card — Intel Arc, NVIDIA, AMD. Examples below use an Intel Arc A380 (8086:56a5); substitute your own vendor:device ID.
@W4RH4WK
W4RH4WK / FSM.cs
Last active August 15, 2025 19:18
C# Generic Finite State Machine
using System;
using System.Collections.Generic;
using System.Reflection;
namespace GenericFSM {
public class FSM<T> where T : struct, IConvertible {
public T State { get; private set; }
using UnityEngine;
using System.Collections;
using UnityEngine.Events;
namespace Cluster {
public class CollisionCall : MonoBehaviour {
public LayerMask layerMask = -1;
@KeyMaster-
KeyMaster- / spriteGlitch.shader
Last active February 20, 2026 18:11
A glitch effect shader for Sprites in Unity3D
//Copyright (c) 2014 Tilman Schmidt (@KeyMaster_)
//Permission is hereby granted, free of charge, to any person obtaining a copy
//of this software and associated documentation files (the "Software"), to deal
//in the Software without restriction, including without limitation the rights
//to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//copies of the Software, and to permit persons to whom the Software is
//furnished to do so, subject to the following conditions:
//The above copyright notice and this permission notice shall be included in
@stavrossk
stavrossk / Import CSV file using PDO.php
Created May 11, 2014 13:00
Import a CSV file into a MySQL database using PHP PDO.
<?php
$databasehost = "localhost";
$databasename = "test";
$databasetable = "sample";
$databaseusername="test";
$databasepassword = "";
@r-lyeh-archived
r-lyeh-archived / compo.cpp
Last active December 9, 2019 06:28
Component-entity system in 16 lines of C++11. extract from kult engine (https://github.com/r-lyeh/kult)
#include <map> // Component-entity system in 16 lines of C++11. 2013 rlyeh, MIT licensed
#include <set> // Code fragment from kult engine - https://github.com/r-lyeh/kult
enum {JOIN,MERGE,EXCLUDE};using set=std::set<unsigned>;template<typename T> set&system(){
static set entities;return entities;}template<typename T,int MODE>set subsystem(const set
&B){set newset;const set&A=system<T>();if(MODE==MERGE){newset=B;for(auto&id:A)newset.ins\
ert(id);}else if(MODE==EXCLUDE){newset=B;for(auto&id:A)newset.erase(id);}else if(A.size()
<B.size()){for(auto&id:A)if(B.find(id)!=B.end())newset.insert(id);}else{for(auto&id:B)if(
A.find(id)!=A.end())newset.insert(id);}return newset;}template<typename T>std::map<unsig\
ned,T>&components(){static std::map<unsigned,T>objects;return objects;}template<typename\
T>bool has(unsigned id){return components<T>().find(id)!=components<T>().end();}templat\
@amcgregor
amcgregor / fc-comms.rest
Last active December 14, 2015 04:58
A general overview of fleet communication phrases and best practices.

EVE's golden rule: Don't fly anything you can't afford to lose.

BNI's corollary: Anything you undock will be lost.

General

Listen to your FC. Do not talk over your FC. The exception to the latter is to scream bloody murder if something unexpected happens tactically and no-one else seemed to notice. (Fleet survival trumps radio politeness.) Add your FC to your fleet watch list. Add anyone else your FC recommends to your watch list. Keep chatter to the fleet text channel, and even then you should be too busy when shit gets real to chatter there, either. Nobody cares if you still need to load ammunition, nobody cares for your inane chattering.

You add people in your fleet to the watch list by right-clicking them in the fleet member list or a chat channel list and selecting Add to Watch List from the menu. (It may be under the Fleet sub-menu depending on where you're selecting their name from.)

@pixelrevision
pixelrevision / PixelPerfectCam.cs
Last active January 23, 2025 16:41
Script for unity to create a pixel locked orthogonal camera
using UnityEngine;
/**
* A camera to help with Orthagonal mode when you need it to lock to pixels. Desiged to be used on android and retina devices.
*/
public class PixelPerfectCam : MonoBehaviour {
/**
* The target size of the view port.
*/
public Vector2 targetViewportSizeInPixels = new Vector2(480.0f, 320.0f);
/**
@kizzx2
kizzx2 / fun.cpp
Created January 11, 2012 14:29
Illustrative C++ Lua binding example/tutorial
// fun.cpp
extern "C"
{
#include <lua.h>
#include <lauxlib.h>
#include <lualib.h>
}
#include <iostream>