$ docker exec -ti $container cut -d: -f1 /proc/net/dev
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo
eth0
eth1
eth2
This file contains 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-04-25 | |
# 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 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 | |
# Utility to discover installed binaries | |
set -eu | |
path_list () | |
{ | |
tr ':' '\n' <<< "$PATH" |
This file contains 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 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 | |
# From: https://gist.github.com/ipedrazas/2c93f6e74737d1f8a791?permalink_comment_id=3704504#gistcomment-3704504 | |
set -eu | |
function dip() { | |
local cols='%-13s %-48s %-40s %-80s' | |
_print_container_info() { | |
local container_id |
This file contains 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 | |
set -eu | |
# set -x | |
install_system() | |
{ | |
apt install python3 py3-pip git | |
pip install --root-user-action=ignore poetry | |
} |
This file contains 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 | |
# Usage example: | |
# gen_favicon.sh SVG_FILE.svg OUT_FILE.ico | |
set -eu | |
# Generate favicon from official logo | |
convert -density 300 -define icon:auto-resize=256,128,96,64,48,32,16 -background none $1 $2 |
This file contains 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 | |
# To install in in: /usr/local/bin/merge_dirs | |
# Then: chmod +x /usr/local/bin/merge_dirs | |
set -eu | |
# Source: https://unix.stackexchange.com/a/155633 | |
# Usage: like mv but: SRC DEST |
This file contains 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
[tool.poetry] | |
name = "python-project-poetry-template" | |
version = "0.1.0" | |
description = "Python Project Poetry Template" | |
authors = ["mrjk"] | |
license = "GPLv3" | |
packages = [ | |
{ include = "myprj"} | |
] |
This file contains 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! |