Skip to content

Instantly share code, notes, and snippets.

- loadkeys de-latin1
- setfont Lat2-Terminus16
- cgdisk /dev/sda
- new -> default -> 32M -> ef02 -> bios -> new -> default -> default -> 8300 -> linux -> write -> yes -> quit
- mkfs.ext4 /dev/sda2
- mount /dev/sda2 /mnt
- export LANG="en_US.UTF-8"
- export LC_COLLATE="C"
- pacman -Syy
- pacstrap /mnt base base-devel git zsh vim
@statico
statico / gpu.cpp
Last active January 25, 2024 01:06
Trick to tell AMD and Nvidia drivers to use the most powerful GPU instead of a lower-performance (such as integrated) GPU
#ifdef _WIN32
// Use discrete GPU by default.
extern "C" {
// http://developer.download.nvidia.com/devzone/devcenter/gamegraphics/files/OptimusRenderingPolicies.pdf
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
// http://developer.amd.com/community/blog/2015/10/02/amd-enduro-system-for-developers/
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
}
#endif
@shehzan10
shehzan10 / Remote OpenGL Setup.md
Last active February 1, 2024 13:39
Remote OpenGL Without Display

Remote OpenGL Setup without X

A full OpenGL profile requires X to be running. For X to run, it requires a display to be connected to the machine. Given that most server machines do not have this, it becomes difficult to run OpenGL.

This document details how to get OpenGL and X up and running without having a display connected to the sevrer.

Requirements

You will need access to the remote system over SSH. To run the tool, you will need libGL.so and libX11.so. These are installed when X and the NVIDIA Drivers are installed. So there is nothing special required to install these.

Another tool I would recommend strongly is glewinfo. Most linux distributions ship this with the glew-utils package. An alternate to glewinfo is glxinfo which is present on all systems with X. You can substitute glewinfo with glxinfo in all the commands below if needed.

@graphitemaster
graphitemaster / gist:f8e6666c48fbedf6e554
Last active January 21, 2023 21:22
Engine achievements
Achievement Engine/Game Why it's bad
storing world space positions in gbuffer STALKER, F.E.A.R. Depth buffer can be used to derive position saving a lot of memory bandwidth
uploaded texture upside down Various engines, mostly Quake derived. Difficult to debug with tools like apitrace, nsight, pix, renderdoc, etc
@paniq
paniq / mt.glsl
Last active June 23, 2019 04:58
World's Tiniest* Marching Tetrahedron
// World's Tiniest* Marching Tetrahedron
// by Leonard Ritter (leonard.ritter@duangle.com)
// this code is public domain
// 0
// +
// / | \
// 3 +-----+ 1
// \ | /
@bussiere
bussiere / citations
Created December 24, 2010 10:16
citations quote informatic informatique quotes computer science
“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill
“In order to understand recursion, one must first understand recursion.” – Author Unknown
“I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone.” – Bjarne Stroustrup
“A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila.” – Mitch Ratcliffe
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -C.A.R. Hoare
“The gap between theory and practice is not as wide in theory as it is in practice.” – Author Unknown
“If builders built buildings the way progra