Skip to content

Instantly share code, notes, and snippets.

View sorny's full-sized avatar
:shipit:
Dies Das 🍍

Gerald Reisinger sorny

:shipit:
Dies Das 🍍
View GitHub Profile
@sorny
sorny / x11_forwarding_macos_docker.md
Last active March 24, 2024 20:02
X11 forwarding with macOS and Docker

X11 forwarding on macOS and docker

A quick guide on how to setup X11 forwarding on macOS when using docker containers requiring a DISPLAY. Works on both Intel and M1 macs!

This guide was tested on:

  • macOS Catalina 10.15.4
  • docker desktop 2.2.0.5 (43884) - stable release
  • XQuartz 2.7.11 (xorg-server 1.18.4)
  • Macbook Pro (Intel)
@sorny
sorny / MinimalPdf.java
Last active March 27, 2024 12:46
Minimal PDF byte array in Java
/**
* A minimal hello world PDF
*
* Based on the handwritten minimal.pdf: https://brendanzagaeski.appspot.com/0004.html
*/
public class MinimalPdf {
public static final byte[] data = new byte[] { 37, 80, 68, 70, 45, 49, 46, 49, 10, 37, -62, -91, -62, -79, -61,
-85, 10, 10, 49, 32, 48, 32, 111, 98, 106, 10, 32, 32, 60, 60, 32, 47, 84, 121, 112, 101, 32, 47, 67, 97, 116,
97, 108, 111, 103, 10, 32, 32, 32, 32, 32, 47, 80, 97, 103, 101, 115, 32, 50, 32, 48, 32, 82, 10, 32, 32, 62,