Skip to content

Instantly share code, notes, and snippets.

@pigfrown
pigfrown / gist:13e00d3f3e39526c726dc3275c60c60c
Created December 22, 2017 12:56
Nvidia-settings ubuntu server
nvidia-settings fails on Ubuntu server because it can't init xserver.
To remedy this set the DISPLAY and XAUTHORITY variables, and run with sudo.
To find the DISPLAY and XAUTHORITY values use "pgrep -a Xorg"
e.g.
DISPLAY=:0 XAUTHORITY=/var/run/lightdm/root/:0 sudo nvidia-settings -q CurrentMetaMode
This will configure xorg for all GPUs, enable overclocking, and add a dummy screen so no actual screen needs to be plugged in.
nvidia-xconfig -a --allow-empty-initial-configuration --cool-bits=28 --use-display-device="DFP-0" --connected-monitor="DFP-0"
privelege seperation, principle of least access, isolated root capabilities, resource limitations
openssh UsePrivelegeSeperation
Use linux-hardened and following the arch linux Kernel Hardening Page
Make sure you are using cgroups correctly with LXC (patched kernel still required?)
@pigfrown
pigfrown / gist:897692efb82351f64ff5c2bca4bd4f4e
Created June 18, 2017 10:07
Starting an Xorg server via ssh
By default on Arch Linux only console users can start xorg-server.
Edit/create /etc/X11/Xwrapper.config and add the following:
allowed_users=anybody
can now start xorg via ssh with the following command:
ssh -nqxT $HOSTNAME "startx -- vt7 < /dev/null > /path/to/log/xremotelog 2>&1"