Skip to content

Instantly share code, notes, and snippets.

View Warns's full-sized avatar
:octocat:
Focusing

Mert Alnuaimi Warns

:octocat:
Focusing
  • Mobiquity Inc.
  • Amsterdam
View GitHub Profile

A step by step comparison of ENTRYPOINT and CMD commands of docker

Theory

Both ENTRYPOINT and CMD are commands which are used for customizing the startup behavior of a container.

Both commands can be used interchangeably to serve similar purposes, but nevertheless there are subtle differences between them.

ENTRYPOINT is the right way to specify a startup command for a container.

@troyharvey
troyharvey / deployment.yml
Last active July 20, 2024 10:05
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@thesandlord
thesandlord / Dockerfile
Last active April 17, 2021 23:18
ConfigMaps and Secrets with Kubernetes
# Copyright 2017, Google, Inc.
# Licensed under the Apache License, Version 2.0 (the "License")
FROM node:6-onbuild
EXPOSE 3000
ENV LANGUAGE English
ENV API_KEY 123-456-789
@makeittotop
makeittotop / oom-killer-explanation.gist
Last active March 25, 2024 17:23
Excellent discussion on OOM-Killer
Out of Memory (OOM) refers to a computing state where all available memory, including swap space, has been allocated.
Normally this will cause the system to panic and stop functioning as expected.
There is a switch that controls OOM behavior in /proc/sys/vm/panic_on_oom.
When set to 1 the kernel will panic on OOM.
A setting of 0 instructs the kernel to call a function named oom_killer on an OOM.
Usually, oom_killer can kill rogue processes and the system will survive.
The easiest way to change this is to echo the new value to /proc/sys/vm/panic_on_oom.
# cat /proc/sys/vm/panic_on_oom 1
@Kartones
Kartones / postgres-cheatsheet.md
Last active July 23, 2024 09:14
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)