This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Version: 08-2024 | |
# Migrated to: https://github.com/mrjk/python_snippets/blob/main/examples/typer/cli-app-typer.py | |
"""MyApp CLI interface | |
This CLI provides a similar experience as the git CLI, but in Python with Typer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Migrated to: https://github.com/mrjk/python_snippets/blob/main/examples/argparse/cli-app-argparse-multilevel.py | |
# Source: https://stackoverflow.com/questions/11760578/argparse-arguments-nesting | |
import argparse | |
parser = argparse.ArgumentParser(description='Deployment tool') | |
subparsers = parser.add_subparsers() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Migrated to: https://github.com/mrjk/python_snippets/blob/main/examples/argparse/cli-app-argparse.py | |
# Run like this: | |
# python3 python_cli.py -vvvv demo | |
# Author: mrjk | |
import os | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# | |
# Migrated to: https://github.com/mrjk/python_components/blob/main/helpers/slack_notify.py | |
# | |
# Documentation | |
# ============================= | |
# | |
# This little script to easily send slack notifications. | |
# Tiger's team webhooks are configured here: https://XXX.slack.com/apps/YYY-incoming-webhooks | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This snippet allow recurive loading of parent .envrc files | |
# To put in your: ~/.config/direnv/direnvrc | |
# Direnv Recursive mode | |
# ========================= | |
# Disable existing source_up commands | |
source_up () | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Common part | |
# ================ | |
FROM debian:12 AS base | |
# Configuration | |
ENV ENTRYPOINT_INFINITE=false | |
ENV ENTRYPOINT_XTRACE=false | |
ENV ENTRYPOINT_ROOT=/docker-entrypoints |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Source: https://gist.github.com/mrjk/1d146a701b201e77279ea4e7c5d075a5 | |
" Last update: 2024/11/13 | |
" Place this in /etc/vim/vimrc.local for debian based distros | |
" Place this in /etc/vimrc.local for rhel based distros | |
" Debian specifities | |
if filereadable("/usr/share/vim/vim80/defaults.vim") | |
source /usr/share/vim/vim80/defaults.vim | |
endif | |
" now set the line that the defaults file is not reloaded afterwards! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# TEMPLATE_VERSION=2024-11-08 | |
# Basic bash template for command/resource based CLI. | |
# Features: | |
# * Automatic command discovery and help generation | |
# * Logging and traces | |
# * Application dependency checker | |
# * Support for getopts | |
# * Return code support |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
Listener for supervisord | |
How it works? | |
It will wait all process_names (aka `program:NAME` sections) have reach the same state. Then | |
it run another command. Its main use case is to allow supervisord services dependencies. | |
Example configuration: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Read one or more dotfiles, and load | |
# | |
# Author: mrjk | |
set -euo pipefail | |
_log () |
NewerOlder