Skip to content

Instantly share code, notes, and snippets.

View steinbrueckri's full-sized avatar
🤘

Richard Steinbrück steinbrueckri

🤘
View GitHub Profile
@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@liviaerxin
liviaerxin / README.md
Last active May 15, 2024 14:40
FastAPI and Uvicorn Logging #python #fastapi #uvicorn #logging

FastAPI and Uvicorn Logging

When running FastAPI app, all the logs in console are from Uvicorn and they do not have timestamp and other useful information. As Uvicorn applies python logging module, we can override Uvicorn logging formatter by applying a new logging configuration.

Meanwhile, it's able to unify the your endpoints logging with the Uvicorn logging by configuring all of them in the config file log_conf.yaml.

Before overriding:

uvicorn main:app --reload
@dikiaap
dikiaap / git-io-custom-url.md
Last active May 7, 2024 17:34
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@wadefletch
wadefletch / todo.py
Last active April 10, 2024 14:57
Print from Todoist API to USB Thermal Printer
import todoist
from escpos import printer
therm = printer.Usb(0x0416, 0x5011) # connect to printer
api = todoist.TodoistAPI('79d4d663cc5011ab78cd7004e26a1a060572c823') # connect to todoist
api.sync() # get new data from todoist
therm.image('name.png') # print header image
therm.text('\n') # add a blank line
@negz
negz / kubedump.sh
Last active March 6, 2024 18:42
Dump Kubernetes cluster resources as YAML
#!/usr/bin/env bash
set -e
CONTEXT="$1"
if [[ -z ${CONTEXT} ]]; then
echo "Usage: $0 KUBE-CONTEXT"
exit 1
fi
@marco79cgn
marco79cgn / dm-toilet-paper.js
Last active February 29, 2024 17:35
iOS Widget, das die Anzahl an Klopapier Packungen in deiner nächsten dm Drogerie anzeigt (für die scriptable.app)
// dm Klopapier Widget
//
// Copyright (C) 2020 by marco79 <marco79cgn@gmail.com>
//
// Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
// IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
@boina-n
boina-n / bash-smtp.sh
Created June 1, 2020 17:58
Send email with bash in in TLS, SSL or in plain text
#!/bin/bash
subject="Subject of my email"
txtmessage="This is the message I want to send"
username='mail@exemple.com'
password='************'
From="mail01@exemple.com"
rcpt='testemail5739230@yopmail.com'
from_name='N BOINA'
rcpt_name='Nicolas Hulot'
Favorites:
Unrefined:
!(@home|@$WIFE|@phone|@laptop|@desk|@errand|@office|##$EMPLOYER|##Someday/Maybe) & !search:* |
(no priority & !search:* & !recurring & !##Someday/Maybe) |
(!search:: & !##Someday/Maybe & !recurring & !no priority) |
##Inbox,
(##Someday/Maybe|@not_now) & (!no due date|@next)
Home:
@thbkrkr
thbkrkr / gcloud-ssh-sysctl-vmmaxmapcount.sh
Created November 7, 2019 19:42
Set vm.max_map_count=262144 on the nodes of a GKE cluster #k8s
#!/bin/bash -eu
# Increase Virtual Memory for Elasticsearch on GKE
# https://www.elastic.co/guide/en/elasticsearch/reference/current/vm-max-map-count.html
# Dependencies: kubectl, gcloud, jq
nodes() {
kubectl get nodes -o custom-columns=n:.metadata.name --no-headers
}