Skip to content

Instantly share code, notes, and snippets.

View Rand01ph's full-sized avatar
⚠️
raise NotImplementedError

9r0k Rand01ph

⚠️
raise NotImplementedError
View GitHub Profile
@take-five
take-five / LICENSE.md
Last active April 1, 2024 22:55
Fast logical replication initializer for PostgreSQL

Copyright 2020 Glia Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER D

@UrsaDK
UrsaDK / Caching multi-stage builds in GA.md
Last active May 21, 2024 13:31
Speed up your multistage builds in GitHub Actions

Caching multi-stage builds in GitHub Actions

Caching Docker builds in GitHub Actions is an excellent article by @dtinth which analyses various strategies for speeding up builds in GitHub Actions. The upshot of the article is a fairly decisive conclusion that the best two ways to improve build times are:

  1. Build images via a standard docker build command, while using GitHub Packages' Docker registry as a cache = Longer initial build but fastest re-build times.

  2. Build your images via docker integrated BuildKit (DOCKER_BUILDKIT=1 docker build), while using a local registry and actions/cache to persist build caches = Fastest initial build but slightly longer re-build times.

The problem

@epcim
epcim / kubernetes_pods_docker_disk_usage.md
Last active January 22, 2024 03:57
docker disk space introspection kubernetes docker overlay

identify big pods/containers

investigage big files

DST=/mnt
find /var/lib -type f -size +1G -exec ls -lh {} \; | tee  $DST/bigfiles_var_lib_$(date "+%H%M").log
find /var/lib -type f -size +1G -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' | sort -rh > $DST/bigfiles_var_lib_$(date "+%H%M").sorted.log

misbehave processes

@eugene-babichenko
eugene-babichenko / Makefile
Created September 28, 2019 13:33
Makefile for building version strings from Git data and including that version numbers into go programs
TAG_COMMIT := $(shell git rev-list --abbrev-commit --tags --max-count=1)
TAG := $(shell git describe --abbrev=0 --tags ${TAG_COMMIT} 2>/dev/null || true)
COMMIT := $(shell git rev-parse --short HEAD)
DATE := $(shell git log -1 --format=%cd --date=format:"%Y%m%d")
VERSION := $(TAG:v%=%)
ifneq ($(COMMIT), $(TAG_COMMIT))
VERSION := $(VERSION)-next-$(COMMIT)-$(DATE)
endif
ifeq $(VERSION,)
VERSION := $(COMMIT)-$(DATA)
@abdennour
abdennour / README.md
Last active May 23, 2024 09:52
Nginx Reverse Proxy for Nexus Docker Registries

Overview

This is a solution of a common problem with Nexus Docker repositories. The administrator has to expose port for "pull", another port for "push", other ports for each hosted repository. This solution is about leveraging Nginx reverse proxy to avoid using these ports.

How it works ?

Given :

  • Nexus hostname is "nexus.example.com"
  • Nexus web port is 8081
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 24, 2024 08:30
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@wknapik
wknapik / README
Last active April 23, 2020 06:13
Wait for kubernetes deployments to complete
Wait for kubernetes deployments to complete.
Two variants - s1.sh and s2.sh.
Usage:
./sX.sh
./sX.sh some-namespace
Both variants make just one pass through the list of deployments, so if another
deployment is started while the script is running, the result may not be
correct.
@artizirk
artizirk / id_rsa to pem converting.md
Last active January 20, 2024 10:37
Converting openssh private key format to pem

Converting openssh private key format to pem

man page says that you can use -e option to convert private and public keys to other formats, that seems to be wrong. Instead you can use -p option to request changing the password but not actually setting the password.

ssh-keygen -p -f id_rsa -m pem

Converting pem to OpenPGP

Monkeysphere project includes a pem2openpgp command that can be used to import ssh private keys to gnupg keyring.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 24, 2024 16:16
set -e, -u, -o, -x pipefail explanation
@mimizone
mimizone / gitlab-runner.yaml
Created August 8, 2018 21:48
setup Gitlab runner namespace, service account and token for kubernetes
apiVersion: v1
kind: Namespace
metadata:
name: gitlab-managed-apps
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: gitlab-sa
namespace: gitlab-managed-apps