Skip to content

Instantly share code, notes, and snippets.

View Chuckame's full-sized avatar

Chuckame Chuckame

View GitHub Profile
@Chuckame
Chuckame / README.md
Created November 8, 2025 14:48
Increase proxmox VM's storage

In proxmox UI

  • In the VM (running or stopped): Hardware > Hard disk, on the toolbar Disk action > Resize
image
  • Set the number of GBs to add, then validate
  • Start the VM if not already

In VM console

  • Install partitionning tool: apt install parted
@Chuckame
Chuckame / README.md
Last active October 4, 2025 21:23
How to install nvidia driver with LXC device passthrough (useful in Proxmox)
@Chuckame
Chuckame / README.md
Last active November 13, 2025 21:12
Setup Proxmox GPU passthrough on lenovo m720q for Docker usage like ollama

Allow GPU passthrough

Done in proxmox 9

  1. Append the following in /etc/kernel/cmdline: iommu=pt (no need of pcie_acs_override=downstream,multifunction as we don't need separate iommu groups, no need of intel_iommu=on for kernels >=6.8)
  2. If you have systemd-boot: proxmox-boot-tool refresh
  3. nano /etc/modules-load.d/pci-pass-through.conf:
vfio
vfio_iommu_type1
@Chuckame
Chuckame / lxc.conf
Last active June 14, 2025 22:27
Unraid: mount share in LXC
# Add this line in your container that needs to mount a share.
# The target path will be relative to the root of the container.
# Note the missing slash '/' in the target path. In the example, the mount point will be at /<target path>
# Without 'create=dir', the container won't be able to start as the /<target path> have to exist to mount properly
lxc.mount.entry = /mnt/user/<the share name> <target path> none bind,create=dir 0 0
@Chuckame
Chuckame / db-backup.sh
Last active October 24, 2024 10:17
Backup and restore immich database: scripts made to easily backup the immich database in a docker compose env. You need the `DB_BACKUP` and `DB_BACKUPS_FOLDER` set in your `.env`, then just execute `./db-backup.sh`
#!/usr/bin/env bash
####
# This script use .env where should be defined DB_FOLDER (the PG data folder) and DB_BACKUPS_FOLDER (the backups location).
# It stops the immich stack then make the backup by zipping the db data to a tar file.
####
set -a
source .env
@Chuckame
Chuckame / AvroNullSafetyAnnotationsModule.java
Created January 22, 2024 16:12
few classes for having an avro ObjectMapper (AvroMapper, the avro format for jackson) with native nullability using NotNull annotations, and excluding discriminator field using native JsonSubTypeInfo
import com.fasterxml.jackson.core.Version;
import com.fasterxml.jackson.databind.AnnotationIntrospector;
import com.fasterxml.jackson.databind.introspect.Annotated;
import com.fasterxml.jackson.databind.introspect.AnnotatedMember;
import com.fasterxml.jackson.databind.module.SimpleModule;
import java.lang.annotation.Annotation;
@Chuckame
Chuckame / one-liner.sh
Created January 22, 2024 10:24
One liner for getting the latest release version on a github repository
basename $(curl -Ls -o /dev/null -w %{url_effective} https://github.com/<user>/<repo>/releases/latest)
@Chuckame
Chuckame / JacksonConfluentAvroDeserializer.java
Created January 18, 2024 17:12
kafka avro serializer & deserializer using jackson-avro-module, and compatible with the confluent avro serializers, useful when we don't want to generate classes using old plugins and only rely on java classes
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.dataformat.avro.AvroMapper;
import com.fasterxml.jackson.dataformat.avro.AvroSchema;
import io.confluent.kafka.serializers.AbstractKafkaAvroDeserializer;
import io.confluent.kafka.serializers.KafkaAvroDeserializerConfig;
import lombok.SneakyThrows;
import org.apache.avro.Schema;
import org.apache.kafka.common.errors.SerializationException;
import org.apache.kafka.common.serialization.Deserializer;
@Chuckame
Chuckame / CoroutineTracer.kt
Last active January 4, 2024 16:12
Convenient way to trace a method call with opentelemetry (datadog by example) with an annotation using spring-aop
import io.opentracing.log.Fields
import io.opentracing.tag.Tags
import io.opentracing.util.GlobalTracer
import org.aspectj.lang.ProceedingJoinPoint
import org.aspectj.lang.annotation.Around
import org.aspectj.lang.annotation.Aspect
import org.springframework.stereotype.Component
import reactor.core.publisher.Mono
@Chuckame
Chuckame / gist:7a9dfd7b18f9142bd90ed25717d4f4c3
Created June 11, 2023 19:10
Linux command to prevent writes to an unmounted drive
chattr +i /mountpoint # will prevent writes for /mountpoint, but not prevent mounting