OpenGL without X.org in linux

Update (Sep. 17, 2017): NVIDIA recently published an article detailing how to use OpenGL on headless systems, which is a very similar use case as the question describes. In summary: Link to libOpenGL.so and libEGL.so instead of libGL.so. (Your linker options should therefore be -lOpenGL -lEGL Call eglGetDisplay, then eglInitialize to initialize EGL. Call eglChooseConfig … Read more

How can I create a device node from the init_module code of a Linux kernel module?

To have more control over the device numbers and the device creation, you could do the following steps (instead of register_chrdev()): Call alloc_chrdev_region() to get a major number and a range of minor numbers to work with. Create a device class for your devices with class_create(). For each device, call cdev_init() and cdev_add() to add … Read more

What does “ulimit -s unlimited” do?

When you call a function, a new “namespace” is allocated on the stack. That’s how functions can have local variables. As functions call functions, which in turn call functions, we keep allocating more and more space on the stack to maintain this deep hierarchy of namespaces. To curb programs using massive amounts of stack space, … Read more

How to set system wide umask?

Both Debian and Ubuntu ship with pam_umask. This allows you to configure umask in /etc/login.defs and have them apply system-wide, regardless of how a user logs in. To enable it, you may need to add a line to /etc/pam.d/common-session reading session optional pam_umask.so or it may already be enabled. Then edit /etc/login.defs and change the … Read more