Skip to content

Instantly share code, notes, and snippets.

View azalio's full-sized avatar

Mikhail Petrov azalio

View GitHub Profile
@azalio
azalio / containerD_kubelet_auth.md
Last active May 1, 2024 20:00
Аутентификация в private registry в kubernetes и containerD

#kubelet #kubernetes #containerd

Дано:

  • Один приватный регистри с аутентификация.
  • containerD 1.6.
  • kubernetes 1.28.
  • Абсолютно все образа загружаются с этого регистри.
@azalio
azalio / gist:0d05b1548d6f8ddf524af12907f06ffc
Created June 11, 2021 06:22
exec shell command in parallel in python
def cpu_count():
''' Returns the number of CPUs in the system
'''
num = 1
if sys.platform == 'win32':
try:
num = int(os.environ['NUMBER_OF_PROCESSORS'])
except (ValueError, KeyError):
pass
elif sys.platform == 'darwin':
@azalio
azalio / main.go
Created May 18, 2021 08:20 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
# Buildpack
Потестил создание docker образа из исходников ruby с помощью своего билда.
=====================
Небольшое отступление.
Вам в обычной жизни не надо этим заморачиваться, уже создано большое количество билдпаков, которые сами разберутся как собрать образ вашего приложения.
https://devcenter.heroku.com/articles/buildpacks#officially-supported-buildpacks
https://elements.heroku.com/buildpacks (7741 Buildpacks)
---
apiVersion: v1
kind: Pod
metadata:
name: busybox
labels:
app: busybox
spec:
containers:
- image: busybox
@azalio
azalio / INSTALL.md
Created August 31, 2020 09:27 — forked from denvazh/INSTALL.md
Ruby development environment with rbenv and bundler

Ruby

Rbenv

Used to manage ruby environment, since it is more beneficial and clean to use non-system one.

Install rbenv and ruby-build

#!/bin/bash
#Alright, so this should automatically convert a given video into a gif called optimized_output.gif
# See here for explanation: https://github.com/lelandbatey/configDebDev/blob/master/helpFiles.txt#L113
ffmpeg -i $1 out%04d.gif # Extracts each frame of the video as a single gif
convert -delay 4 -loop 0 out*.gif anim.gif # Combines all the frames into one very nicely animated gif.
convert -layers Optimize anim.gif optimized_output.gif # Optimizes the gif using imagemagick
# vvvvv Cleans up the leftovers