Skip to content

Instantly share code, notes, and snippets.

View oblaser's full-sized avatar
:electron:
Computers are like submarines, everything is fine until you open a window.

Oliver Blaser oblaser

:electron:
Computers are like submarines, everything is fine until you open a window.
View GitHub Profile
@oblaser
oblaser / opengl-in-wsl.md
Created May 22, 2024 12:58 — forked from Mluckydwyer/opengl-in-wsl.md
Install OpenGL on Ubuntu in WSL

How to Install OpenGL in Ubuntu in WSL2

These steps have been tested on Windows 10 with WSL2 running Ubuntu.

1. Dependencies

First install the dependencies:

apt install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev

There are more than we need, but also include GLut and Glu libraries to link aginst during compilation for application development (these can be removed if that functionality is not required).

#include <iostream>
using namespace std;
// rounds a float or double away from zero, casting to an integer type has to be applied
#define UTIL_ROUND(v) ((v) < 0 ? ((v) - 0.5f) : ((v) + 0.5f))
int main()
{
for (float f = -3.1f; f < 3.1f; f += 0.1f)
@oblaser
oblaser / join-pdf.bat
Created December 3, 2022 11:30
Merges four weekly PDF files into one to print them in the brochure style
@rem
@rem author Oliver Blaser
@rem date 01.06.2022
@rem copyright GNU GPLv3 - Copyright (c) 2022 Oliver Blaser
@rem
@rem Merges four weekly PDF files into one to print them in the brochure style
@echo off
@oblaser
oblaser / getWindowInfo.cpp
Created May 7, 2022 11:44
Windows command line tool to get window information from a given window title
/*
author Oliver Blaser
date 07.05.2022
copyright GNU GPLv3 - Copyright (c) 2022 Oliver Blaser
*/
#include <iostream>
#include <string>
#include <vector>
@rem
@rem author Oliver Blaser
@rem date 15.03.2022
@rem copyright GNU GPLv3 - Copyright (c) 2022 Oliver Blaser
@rem
@echo off
if not "%~2"=="" goto argWarn
@oblaser
oblaser / rename_split_RAR_files.sh
Last active December 2, 2021 16:14
Renames the split (multi-volume) RAR files from the old naming scheme to one of the newer ones.
#!/bin/bash
# Oliver Blaser - gist.github.com/oblaser
# 02.12.2021
# Renames the split (multi-volume) RAR files from the old
# naming scheme to one of the newer ones.
# Useage: Edit the following parts of the script
# - Set the variables "orig" and "dest" to the filenames without
@oblaser
oblaser / wget_integratedCircuitsForCommunication.sh
Last active December 2, 2021 13:53
wget lecture slides of "Integrated Circuits for Communication"
#!/bin/bash
# Oliver Blaser - gist.github.com/oblaser
# 23.11.2021
newDirName=IntegratedCircuitsForCommunication
{
mkdir -p $newDirName &&
cd $newDirName &&