Skip to content

Instantly share code, notes, and snippets.

View lorello's full-sized avatar
🏠
Working from home

LoreLLo lorello

🏠
Working from home
View GitHub Profile
@fpytloun
fpytloun / vector_s3sync.py
Last active January 23, 2025 17:31
Vector s3sync wrapper for exec source
#!/usr/bin/env python3
import argparse
import json
import logging
import os
import random
import signal
import subprocess
import sys
@pwillis-els
pwillis-els / attach_ebs.sh
Last active December 6, 2023 07:03
Bash script to attach an EBS volume to an EC2 instance after boot-time
#!/bin/sh
# attach_ebs.sh - Attach an EBS volume to an EC2 instance.
# Copyright (C) 2020 Peter Willis <peterwwillis+github@gmail.dotcom>
#
# This script is designed to create and mount a single EBS volume based on its tag:Name
# in order to implement persistent storage. If there is more than one EBS volume
# with the same tag, this script will fail.
#
# Order of operations:
# 1. Detect EBS volume based on "tag:Name" "$TAG_NAME"
@m-radzikowski
m-radzikowski / script-template.sh
Last active July 1, 2026 17:56
Minimal safe Bash script template - see the article with full description: https://betterdev.blog/minimal-safe-bash-script-template/
#!/usr/bin/env bash
set -Eeuo pipefail
trap cleanup SIGINT SIGTERM ERR EXIT
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P)
usage() {
cat <<EOF
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...]
@wnsdn1207
wnsdn1207 / docker-compose-zk3-kf3.yml
Created June 18, 2020 01:18
[docker-swarm] docker compose file for 3 zookeepers and 3 kafka cluster
version: '3.2'
services:
zoo1:
image: zookeeper:latest
hostname: zoo1
ports:
- "2181:2181"
environment:
ZOO_MY_ID: 1
@ruanbekker
ruanbekker / promtail_docker_logs.md
Last active June 7, 2026 04:44
Docker Container Logging using Promtail
@Smasherr
Smasherr / copy_images.sh
Last active October 10, 2023 07:33
This script can be used to copy all docker images from one GitLab-project to another. It was created because in GitLab it's not possible to move projects that contain docker images.
#!/usr/bin/env bash
# This script can be used to copy all docker images from one GitLab-project to another.
# It was created because in GitLab it's not possible to move projects that contain docker images.
#
# Related issue: https://gitlab.com/gitlab-org/gitlab/-/issues/18383
#
# Author: Daniel Estermann <estermad@apache.org>
# Thanks to komar <komar@core.org.ua> for his brilliant support
@mtorchiano
mtorchiano / CTApp.svg
Last active April 30, 2020 20:14
Uno sguardo di sistema sulla "Contact Tracing App"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lorello
lorello / docker-compose-installer.sh
Created November 8, 2019 14:44
Latest version of docker-compose Installer
#!/usr/bin/env bash
set -ex
if [[ ! -f /usr/local/bin/docker-compose ]]; then
sudo apt install -y curl
curl -s https://api.github.com/repos/docker/compose/releases/latest \
| grep browser_download_url \
| grep docker-compose-Linux-x86_64 \
| cut -d '"' -f 4 \

Automatismo per pubblicare una release

Dato un repo github che contiene solamente il composer delle dipendenze di altri repo, l'obiettivo è esporre un changelog delle modifiche di tutti i repo.

Prerequisiti

Installare composer-lock-diff (fork di Opencontent)

git clone https://github.com/Opencontent/composer-lock-diff.git
cd composer-lock-diff
@Kmaschta
Kmaschta / generate-self-signed-certificate-with-custom-CA.md
Created January 9, 2019 14:43
How to generate a self-signed that is valid for your browser (by creating your custom certificate authority)

If you're using self-signed certificate for your web server on development, you might know the browser warning saying that your certificate isn't valid. If like me you had manually added an exception for this certificate error each time it showed up, this gist is for you.

Properly Configure OpenSSL with your DNS aliases

You'll have to create a self-signed certificate with a custom SubjectAltName.

  1. Find your openssl config. find /usr/lib -name openssl.cnf