Skip to content

Instantly share code, notes, and snippets.

View karma-git's full-sized avatar
☁️

Andrew Horbach karma-git

☁️
View GitHub Profile
@karma-git
karma-git / .py
Last active January 1, 2022 10:34
Honestly, I hate python logging
import logging
# ref: https://realpython.com/python-logging/
# custom logger
logger = logging.getLogger(__name__)
# handler
c_handler = logging.StreamHandler()
# set handler and logger level
# CRITICAL 50
# ERROR 40
@karma-git
karma-git / .tf
Last active December 29, 2021 05:16
terraformer - import existing cloud infra from AWS as HCL
provider "aws" {
region = "us-east-1"
}
@karma-git
karma-git / poetry.md
Created January 1, 2022 00:49
Poetry CheatSheet

Overview

Poetry is a modern python package manager like npm.

Poetry — продвинутая замена pip для Python. Менеджер зависимостей, который нам нужен в 2021м! - by Диджитализируй!

@karma-git
karma-git / README.md
Last active January 1, 2022 10:32
osX capture system audio during screen recording via quicktime

Overview

I'd like to capture my screen via QuickTime because it's easy and I don't want to install additional software on my mac.

But I need some external functionality: capture screen via QuickTime and record system audio. What I can do?

I'm glad to introduce you BlackHole.

NOTE: yeah it's a fork, which has x8 more stars than original repo. IMOPRTANT: it's not working on M1 chips yet.

@karma-git
karma-git / Dockerfile
Created January 1, 2022 13:24
Python-Poetry & Docker-Alpine
# pull official base image
FROM python:3.10.1-alpine3.14
# set desired poetry version via build-arg
ARG POETRY_VERSION=1.1.12
# setup poetry
RUN apk add --no-cache --virtual .build-deps \
curl~=7.79 \
gcc~=10.3.1 \
@karma-git
karma-git / lxml.Dockerfile
Created January 6, 2022 10:34
Python - Alpine builds
FROM alpine:3.14
RUN apk add --no-cache \
libxslt-dev \
python3 \
py3-pip \
&& apk add --no-cache --virtual .build-deps \
g++ \
libxml2 \
libxml2-dev \
@karma-git
karma-git / README.md
Created January 13, 2022 00:03
I hate cryptography

Overview

cryptography needed in many packages as dependency, but looks like it difficult to build (especialy in alpine)

According to docs:

❯ docker run -it alpine:3.14
/ # apk add python3 py3-pip
...
@karma-git
karma-git / README.md
Created May 10, 2022 05:46
Various Dockerfile-s

Various Dockerfile-s

  • alertmanager-bot.Dockerfile - rootless scratch version of alertmanager-bot
  • ...
@karma-git
karma-git / aws-cli.md
Created September 17, 2022 11:39
Hacks

IAM, STS

details

Put you error message into the variable ERR_MSG=ERR_MSG=lpZc-FG2IyC8TbgfIKIBK_... and evalute this

aws sts decode-authorization-message --encoded-message ${ERR_MSG} \
| tac | tac \