- netshoot: Attach a netshoot container to existing instance
- dip: Docker IPs, show all containers IPs
- nip: Network IPs, show all containers IPs per networks
- nip2: Network IPs, show all containers IPs per networks
- dports: Docker ports, list all exposed ports
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 | |
| #_IDENT="USER_HOST" | |
| _IDENT=$(id -un)@$(hostname -f) | |
| _DATE=$(date +'%Y%m%d') | |
| _OUT="$(id -un)/.ssh/" | |
| _OUT="$(getent passwd "${USER}" | cut -d: -f6)/.ssh/" | |
| _IDENT2=${_IDENT2//@/_} |
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 | |
| title () | |
| { | |
| local msg="$@" | |
| echo | |
| echo "========================" | |
| echo " $msg" | |
| echo "========================" | |
| } |
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
| title () | |
| { | |
| local msg="$@" | |
| echo | |
| echo "========================" | |
| echo " $msg" | |
| echo "========================" | |
| } | |
| log () |
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 | |
| # This script reports the most common CPU flags to pay attention. | |
| # Usage: | |
| # curl https://gist.githubusercontent.com/mrjk/8a74b4597716bebea2a0b965c06b54ff/raw/26cd0e43d1694bf40cb5f2935ff88f36a0f77a81/report-disk-health.sh | bash | |
| report_smart() { | |
| command -v smartctl >/dev/null || { |
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 | |
| # This script reports the most common CPU flags to pay attention. | |
| # Usage: | |
| # curl https://gist.githubusercontent.com/mrjk/28a1082d201c7c8c30b788a7b47e820d/raw/54c37076fd8e3f118867d1575efe074724eb1d5b/report-cpu-flags.sh | bash | |
| declare -A flags=( | |
| [vmx]="virt: Intel Virtualisation (VT-x)" | |
| [svm]="virt: AMD Virtualisation (AMD-V)" |
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
| #!/bin/bash | |
| # TEMPLATE_VERSION=2025-08-28 | |
| # 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
| " Jeznet config | |
| " ============================================================================== | |
| " Source: https://gist.github.com/mrjk/1d146a701b201e77279ea4e7c5d075a5 | |
| " Last update: 2025/07/23 | |
| " | |
| " This file is heavily inspirated from Debian | |
| " /usr/share/vim/vim91/defaults.vim . It is a sane global vim | |
| " config for every users that doesn't have a vimrc. | |
| " | |
| " Main vimrc config paths: |
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() |
NewerOlder