Skip to content

Instantly share code, notes, and snippets.

@turicas
turicas / email_utils.py
Last active April 9, 2024 19:56
Send emails easily in Python (with attachments and multipart)
#!/usr/bin/env python
# coding: utf-8
# This little project is hosted at: <https://gist.github.com/1455741>
# Copyright 2011-2020 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
import os
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
@rxaviers
rxaviers / gist:7360908
Last active July 4, 2024 13:59
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@ursuad
ursuad / kafka-cheat-sheet.md
Last active June 25, 2024 13:23
Quick command reference for Apache Kafka

Kafka Topics

List existing topics

bin/kafka-topics.sh --zookeeper localhost:2181 --list

Describe a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic

Purge a topic

bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000

... wait a minute ...

@kfdm
kfdm / notes.md
Created September 28, 2016 07:37
Prometheus Memory Usage Calculation
@hartfordfive
hartfordfive / reindex.sh
Last active May 19, 2023 12:32
Bash script to re-index all indices matching apattern from a remote Elasticsearch cluster to a local one
#!/bin/bash
if [ "$1" == "" ] || [ "$2" == "" ]; then
echo "Usage: ./reindex.sh [REMOTE_HOST:REMOTE_PORT] [INDEX_PATTERN] [LOCAL_HOST:LOCAL_PORT]"
exit 1
fi
REMOTE_HOST=$1
PATTERN=$2
if [ "$3" == "" ]; then
@hmldd
hmldd / scroll.py
Last active October 6, 2023 14:59
Example of Elasticsearch scrolling using Python client
# coding:utf-8
from elasticsearch import Elasticsearch
import json
# Define config
host = "127.0.0.1"
port = 9200
timeout = 1000
index = "index"
@edsiper
edsiper / kubernetes_commands.md
Last active June 29, 2024 05:54
Kubernetes Useful Commands
@marwei
marwei / how_to_reset_kafka_consumer_group_offset.md
Created November 9, 2017 23:39
How to Reset Kafka Consumer Group Offset

Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)
@mbreksopuro
mbreksopuro / start_reindex.sh
Last active September 26, 2023 18:28
Reindex API from Remote ElasticSearch to Local ElasticSearch Servers (for up to ES 6.x)
#!/bin/bash
###################################################
## Start ElasticSearch Reindex Same Indices
##
## Created by : Hartfordfive - 2019-02-01
## Modified by : Marjono B. Reksopuro - 2019-03-11
##
##
###################################################
@jimmymcp
jimmymcp / .multi-stage-azure-pipelines.yml
Created September 24, 2019 12:25
Example multi-stage YAML pipeline for Azure DevOps
trigger:
- '*'
pool:
name: Default
variables:
image_name: mcr.microsoft.com/businesscentral/sandbox
container_name: Build
company_name: My Company