Skip to content

Instantly share code, notes, and snippets.

@rst0git
rst0git / 80-nvidia-no-suspend.rules
Last active March 16, 2026 11:44
Fix NVIDIA external monitor detection
# /etc/udev/rules.d/80-nvidia-no-suspend.rules
# Prevent the NVIDIA dGPU from entering runtime suspend. This is needed for external
# display ports (HDMI, DP) that are wired to the NVIDIA GPU. When the GPU runtime-suspends,
# its connectors are disabled and it cannot detect that a monitor was plugged in.
# So the hotplug event in 99-force-hotplug.rules would never fire. This rule keeps
# the GPU awake so detection works.
# /usr/lib/udev/rules.d/60-nvidia.rules sets power/control=auto on "bind", which suspends
# the GPU and disables its connectors. We match "add|bind" to override that.
ACTION=="add|bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", ATTR{power/control}="on"
@rst0git
rst0git / Dockerfile
Created August 17, 2019 10:52
Migrate Flask server between containers
FROM ubuntu:18.04 as build
RUN apt-get update -qq
RUN apt-get install -qq \
libnet-dev \
libnl-route-3-dev \
gcc \
bsdmainutils \
build-essential \
git-core \
all: build run
build:
gcc -Wall dst.c -o dst
gcc -Wall src.c -o src
run: t1 t2 t3 t4 t5 t6 t7 t8
cat *.log >> results.txt
rm -f *.log