Skip to content

Instantly share code, notes, and snippets.

$containerId = (docker ps -q --filter ancestor=mariadb)
if ($containerId -ne $null) {
# Остановка контейнера
docker stop $containerId
Write-Host "Docker container with ID $containerId has been stopped."
} else {
Write-Host "No running MariaDB Docker container found."
}
@santarinto
santarinto / web.ps1
Last active January 22, 2024 18:40
Simple running script for start web app on php and mysql DB in docker
php --version
docker --version
# Checking if Docker is running
try {
docker info > $null 2>&1
Write-Host "Docker is running."
} catch {
Write-Error "Docker is not running. Please start Docker and try again."
exit 1
@santarinto
santarinto / Dockerfile
Last active October 12, 2023 11:59
Dcokerfile example fot php:8.2
FROM php:8.2-fpm-alpine
WORKDIR /opt/app
EXPOSE 8090 9003
ENV RUNNING_IN_DOCKER true
RUN \
# Add user and group
addgroup -S backend && adduser -S -G backend backend \
# Add dir for app
@santarinto
santarinto / convert.ps1
Last active January 22, 2024 17:51
Convert webm -> mp4 , webp,jpg -> png
$startTime = Get-Date
$webmConvertedCount = 0
$jpgConvertedCount = 0
$webpConvertedCount = 0
$totalFilesConverted = 0
$initialSizeMB = 0
$finalSizeMB = 0
$webmFiles = Get-ChildItem -Path .\ -Filter *.webm -Recurse
@santarinto
santarinto / Makefile
Last active October 11, 2023 19:44
beatiful list targets on Makefile
# vim:ft=make
# Makefile
DOCKER_EXEC = @docker-compose exec
ifneq (,$(wildcard ./.env))
include .env
export
endif
@santarinto
santarinto / .gitignore
Created May 27, 2022 14:19
gitignore global
#ignore thumbnails created by windows
Thumbs.db
#Ignore files build by Visual Studio
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
@santarinto
santarinto / .dockershell.sh
Created May 6, 2022 06:17 — forked from arctic-hen7/.dockershell.sh
ZSH configuration for nice Docker shells in Alpine
# Note: for this to do anything, use my starter Dockerfile config (https://gist.github.com/arctic-hen7/10987790b86360820e2790650e289f0b)
# This file contains ZSH configuration for your shell when you interact with a container
# (we wouldn't want any boring `sh` now would we?)
# Please feel free to set up your own ZSH config in here!
# It gets mapped to your `.zshrc` for the root user in the container
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
@santarinto
santarinto / README.MD
Created August 20, 2021 11:45
Enable SSL in Apache (OSX)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@santarinto
santarinto / postgresql-13.md
Created June 10, 2021 13:41
PostgreSQL 13 Overview

PostgreSQL 13

Major features:

  • Оптимизация хранения и производительности за счет дедупликации в B-tree индексах.
  • Улучшение производительности запросов с использованием агрегатов или работающих с партицонированными таблицами.
  • Улучшенное планирование запросов с использованием расширенной статистики.
  • Параллельное вакуумирование индексов.
CREATE OR REPLACE FUNCTION test1(in_array jsonb)
RETURNS text[] AS $$
DECLARE
js jsonb := in_array;
i jsonb;
result_ids TEXT[];
uuid text;
state text;
version text;