Categories
Cloud connectivity Containerisation Containers DevOps Docker

How to Ping on a container with No ping utility?

Ever opened a shell or sshed into a container and it does not have the ping binary: bash: ping: command not found Install Ping Use the package manager of the base image apt update apt install iputils-ping Then test: > ping 1.1.1.1. PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data. 64 bytes from one.one.one.one (1.1.1.1): icmp_seq=1 […]

Categories
DevOps

Elastalert 2: Quick Setup

Ever get notified about issues, bugs and problems by people – but also have the data in elasticsearch. There is a tool called elastalert that can alert on data in your elasticsearch cluster. Warning Elastalert 2 only supports recent things… Elasticsearch 6 is not supported, only: Elasticsearch 7.x or 8.x, or OpenSearch 1.x or 2.x […]

Categories
python python performance

Python Simple Asyncio [Part 1]

Is asyncio simple? Some ideas: https://charlesleifer.com/blog/asyncio/ https://techspot.zzzeek.org/2015/02/15/asynchronous-python-and-databases/ https://lucumr.pocoo.org/2016/10/30/i-dont-understand-asyncio/ Came across a well written and simple post about Async programming in Python. A good place to learn about python is always the documentation – here is the documentation for asyncio There is also this Python and Async simplified post. Many of the examples of asyncio can […]

Categories
sqlachemy

SQLAlchemy: Filtering a many-to-many on a field but keeping all results of that field

Going Back to Basics In models.py: “”” Basic Product Category models using reference from: https://docs.sqlalchemy.org/en/14/orm/relationship_api.html#sqlalchemy.orm.relationship “”” from sqlalchemy import Column, ForeignKey, Table, Integer, Boolean, String from sqlalchemy.orm import declarative_base, relationship Base = declarative_base() category_products = Table( “category_products”, Base.metadata, Column(“product_id”, ForeignKey(“products.id”), primary_key=True), Column(“category_id”, ForeignKey(“category.id”), primary_key=True), ) class Products(Base): __tablename__ = “products” id = Column(Integer, primary_key=True) label […]

Categories
python

Python Implicit Namespace Packages

A very confusing topic is python imports and paths. One area that makes it more confusing was the introductions of implicit namespace packages. https://peps.python.org/pep-0420/#differences-between-namespace-packages-and-regular-packages These are packages that are found even without an __init__.py. A folder can be created on the python path and that folder automatically becomes a python package. Not sure why or […]