Skip to content

Instantly share code, notes, and snippets.

@E-gy
E-gy / CodeCoverage.cmake
Last active May 13, 2022 04:00
Recursive cross-platform CMake
# Copyright (c) 2012 - 2017, Lars Bilke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
@E-gy
E-gy / README.md
Last active May 10, 2022 03:17
Running OpenGL applications from-inside Docker on Windows
  1. Install VcXterm (or other X-terminal for Windows of your choice)
winget install vcxterm
  1. Start XLaunch (VcXterm) with
  • Native opengl: unchecked
  • Disable access control: checked
  1. In your docker container define following environment variables:
ENV DISPLAY=host.docker.internal:0 LIBGL_ALWAYS_INDIRECT=0 LIBGL_ALWAYS_SOFTWARE=1
@E-gy
E-gy / sources.list
Created May 6, 2022 19:06
Debian 11 sources.list
# `/etc/apt/sources.list`
# Debian 11 apt configuration for _actually_ ~~unsecure~~ useable Debian!
#
# Replace the contents with all below,
# then run `apt update`.
deb http://deb.debian.org/debian bullseye main contrib non-free
deb-src http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian-security/ bullseye-security main contrib non-free
@E-gy
E-gy / main.c
Last active December 21, 2021 00:55
Linux C ICMP getaddrinfo & bind test
#define _GNU_SOURCE
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
@E-gy
E-gy / ssl.h
Created October 14, 2021 14:25
C OpenSSL print last SSL Error
#include <openssl/err.h>
static void printSSLError(){
char buff[512] = {};
ERR_error_string_n(ERR_get_error(), buff, sizeof(buff)-1);
prinft("%s", buff);
}