Skip to content

Instantly share code, notes, and snippets.

View kataev's full-sized avatar

Denis Kataev kataev

  • The Netherlands, Rotterdam
View GitHub Profile

Redis FAQ or: what you learn when idling in #redis

First: this here is the unofficial FAQ, only containing things that come up by users in the IRC channel #redis on Freenode. There's also a more official FAQ. This document is also available on my site.

X is weird in my instance. Can you help?

Maybe. To better help please give the following info:

  • Output of redis-cli INFO
  • Output of redis-cli CONFIG GET '*'
@sykire
sykire / per_inline_model_converter.py
Last active April 9, 2021 07:16
Usually in flask-admin inline-models use the same converter. You can set a different converter setting 'inline_converter' in the ModelView but this will apply the same converter for every Model in the inline_models list.So I've overridden the 'scaffold_inline_form_models' method from ModelView just to check for every inline model in the list if …
from flask_admin.form import FormOpts
from flask_admin.contrib.sqla.form import InlineModelFormList, \
InlineModelConverter, \
get_form
from flask_admin.contrib.sqla.tools import get_primary_key
from flask_admin.contrib.sqla import ModelView
from flask_admin.model.fields import InlineModelFormField
from flask_admin.model.form import InlineFormAdmin
from flask_admin._compat import iteritems
@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)