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)
Suppose you need to add a section to an ELF binary to contain information gathered at compile time, but to be used at link time or run time. Here's how to add a section named .okdata and either populate it with data either after or before emitting the ELF binary.
In this case, you'll add file’s contents to an already existing binary. objcopy copies and translates object files, such that adding a new section is a matter of writing that new section’s contents into the ELF file.
(Optional) Create a simple program’s object file.
| { | |
| // See https://go.microsoft.com/fwlink/?LinkId=733558 | |
| // for the documentation about the tasks.json format | |
| "version": "2.0.0", | |
| "options": { | |
| "env": { | |
| "OPENOCD_SCRIPTS": "${workspaceRoot}\\..\\OpenOCD-20170609\\share\\openocd\\scripts" | |
| } | |
| }, | |
| "tasks": [ |
A complete, cross-platform solution to record, convert and stream audio and video. Compiling for the Raspberry Pi takes a little more patience and care. Took lots of time to fully implement it on Pi using USB webcam. However, We also like to include support for H264 video, which needs to be installed before compiling FFmpeg. But one can skip this and simply move on to install FFmpeg only.
Important Information
From FFmpeg - ffserver has been removed. It's mean if we install latest version of FFmpeg, we won't get ffserver. However, let's download FFmpeg 3.4.4 "Cantor". We've downloaded and remane it only ffmpeg and save to Pi desktop. It has ffserver into it. However, it's a tar.xz file and we need to extract it. After extracting, name it simply ffmpeg. To extract, first install xz-utils package.
sudo apt-get install xz-utils
and use following command to extr
| { | |
| tokens=[ | |
| space='regexp:\s+' | |
| identifier='regexp:[a-zA-Z][a-zA-Z0-9_]*' | |
| integer-constant='regexp:\d+' | |
| character-constant='regexp:[a-zA-Z]' | |
| floating-constant='regexp:[+-]?([0-9]*[.])?[0-9]+f' | |
| enumeration-constant='regexp:[a-zA-Z][a-zA-Z0-9_]*' // Same as identifier | |
| ] |
- Install XQuartz: https://www.xquartz.org/
- Launch XQuartz. Under the XQuartz menu, select Preferences
- Go to the security tab and ensure "Allow connections from network clients" is checked.
- Run
xhost + ${hostname}to allow connections to the macOS host * - Setup a HOSTNAME env var
export HOSTNAME=`hostname`* - Add the following to your docker-compose:
environment:
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
