Skip to content

Instantly share code, notes, and snippets.

@egatjens
egatjens / docker-volumes.md
Created October 10, 2022 20:09 — forked from onlyphantom/docker-volumes.md
Demystifying Docker Volumes for Mac and PC Users

Demystifying Docker Volumes for Mac and PC Users

  1. Docker runs on a Linux kernel

Docker can be confusing to PC and Windows users because many tutorials on that topic assume you're using a Linux machine.

As a Linux user, you learn that Volumes are stored in a part of the host filesystem managed by Docker, and that is /var/lib/docker/volumes. When you're running Docker on a Windows or Mac OS machine, you will read the same documentation and instructions but feel frustrated as that path don't exist on your system. This simple note is my answer to that.

When you use Docker on a Windows PC, you're typically doing one of these two things:

  • Run Linux containers in a full Linux VM (what Docker typically does today)
@egatjens
egatjens / benchmark_wrk.md
Created May 20, 2022 16:00
Performance benchmark using wrk
brew install wrk
wrk -t12 -c400 -d10s http://localhost:8081/reservations
  • 12 is the number of threads we will use.
  • 400 the number of concurrent connections
@egatjens
egatjens / setup-google-credentials.md
Last active November 19, 2020 22:49
Steps to configure Google Credentials for LiFT Google Integration
@egatjens
egatjens / homebrew-postgresql.md
Last active March 2, 2020 17:19
Homebrew Postgresql

Homebrew, use multiple database versions

Install versions

brew install [email protected]
brew install postgresql@10

Commands

@egatjens
egatjens / make-a-bootable-usb-drive.md
Last active October 25, 2023 21:06
Make a bootable USB drive

Create bootable linux distro

diskutil list
diskutil unmountDisk /dev/disk#
sudo dd if=/path/to/linux_iso of=/dev/disk# bs=1m
# or for debian
$ sudo dd if=/path/to/linux_iso of=/dev/disk# bs=4M; sync 
# Wait till finished
# Ctrl + T for status updates.
@egatjens
egatjens / setup-sendmail-gmail-on-ubuntu14.md
Last active April 20, 2024 02:44
Configuring Gmail as a Sendmail email relay | Ubuntu 14
Setup sendmail

Prefix all commands with 'sudo'

  1. Install prerequisites
$ apt-get install sendmail mailutils
  1. Configure hosts file correctly:
@egatjens
egatjens / postgres-cheatsheet.md
Last active July 15, 2022 16:13
PostgreSQL command line cheatsheet

Get results as JSON

select array_to_json(array_agg(row_to_json(t)))
    from (
        SELECT id, interaction_id, comment_id, created_at, state FROM ugc_permissions 
		WHERE EXTRACT(MONTH FROM created_at) IN (8,9)
		AND EXTRACT(YEAR FROM created_at) = 2017
		ORDER BY created_at ASC
    ) t