Skip to content

Instantly share code, notes, and snippets.

View zborowa's full-sized avatar

Adrian Zborowski zborowa

View GitHub Profile
@cfsamson
cfsamson / green_threads_start.rs
Last active January 7, 2021 05:33
Green_threads_code
#![feature(asm)]
// Lets set a small stack size here, only 48 bytes so we can print the stack
// and look at it before we switch contexts
// ===== NOTICE FOR OSX USERS =====
// You'll need to increase this size to at least 624 bytes. This will work in Rust Playground and on Windows
// but the extremely small stack seems to have an issue on OSX.
const SSIZE: isize = 48;
/// Do you recognize these? It's the registers described in the x86-64 ABI that we'll need to save our context.
@GeertVL-zz
GeertVL-zz / postgres-docker-local.md
Last active May 25, 2021 08:17
How to install postgres and pgadmin in a docker environment on your local macos machine

I experienced that installing your Postgres database server on your local machine as a Docker container is not that evident. So this explains how you need to do it and what you need to take into account.

To setup your Postgres Docker container you need to run:

docker run -d -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=mysecretpassword --name postgres-server -p 5432:5432 -v pgdata:/var/lib/postgresql/data --restart=always postgres

And to run your pgadmin instance as a Docker container:

@samsch
samsch / build-environment.md
Last active January 20, 2021 22:19
Run a postgres container and connect with pgadmin (in another container)

Start a postgres server:

docker run -v postgres:/var/lib/postgresql/data --name postgres-test -e POSTGRES_PASSWORD=mysecretpassword -d postgres

Start pgadmin

Connect with a one-off docker container in current process:

docker run -v pgadmin4:/home/pgadmin/.pgadmin -p 5050:5050 --link postgres-test:postgres-test --rm meedan/pgadmin