Skip to content

Instantly share code, notes, and snippets.

View richtong's full-sized avatar
💭
Geeking away

Rich Tong richtong

💭
Geeking away
View GitHub Profile
@paul-krohn
paul-krohn / docker_x11_macOS.md
Last active August 20, 2024 11:22
Docker X11 macOS

Preamble

There is a longstanding issue/missing feature/bug with sockets on Docker on macOS; it may never work; you'll need to use a network connection between Docker containers and X11 on macOS for the foreseeable future.

I started from this gist and made some adjustments:

  • the volume mappings aren't relevant/used, due to the socket issue above.
  • this method only allows X11 connections from your Mac, not the entire local network, which would include everyone on the café/airport WiFi.
  • updated to include using the host.docker.internal name for the the container host, instead.
  • you have to restart XQuartz after the config change.
export const GoogleApi = function(opts) {
opts = opts || {}
const apiKey = opts.apiKey;
const libraries = opts.libraries || [];
const client = opts.client;
const URL = 'https://maps.googleapis.com/maps/api/js';
const googleVersion = '3.22';
let script = null;
@sphaero
sphaero / gstreamer-build.sh
Last active February 11, 2023 16:25
Install & build gstreamer from git
#!/bin/bash --debugger
set -e
BRANCH="master"
if grep -q BCM2708 /proc/cpuinfo; then
echo "RPI BUILD!"
RPI="1"
fi
[ -n "$1" ] && BRANCH=$1
@ledti
ledti / sd
Last active April 10, 2021 17:31
Easily mount mass storage devices.
#!/bin/bash
# sd: easily mount mass storage devices.
# last modified: 2014/08/15
# commands: none, '-m', '-u', or '--help'.
# visually exclude the following /dev/sd* device(s) from the listing:
# syntax example: "abc", to exclude drives a,b, and c.
# use "-" to show everything.
exclude="a"