apt-get install snapd
snap install microk8s --classic --channel=1.18/stable
microk8s enable dns dashboard registry helm3 ingress storage
There are 4 possible serialization format when using avro:
- Avro Json encoding
- Avro Data Serialization (https://avro.apache.org/docs/current/spec.html#Data+Serialization) Binary format with an header that contains the full schema, this is the format usually used when writing Avro files
- Avro Single Object Encoding (https://avro.apache.org/docs/current/spec.html#single_object_encoding) Binary format with an header with only the fingerprint/id of the schema, this it the format used by Kafka (see this
- Avro Binary Encoding (https://avro.apache.org/docs/current/spec.html#binary_encoding)
Kafka 0.11.0.0 (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups
command.
- 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.
- Reset the consumer offset for a topic (preview)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
print(boto3.client('sts').get_caller_identity()['Account']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- place this in an %angular paragraph --> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.5/leaflet.css" /> | |
<div id="map" style="height: 800px; width: 100%"></div> | |
<script type="text/javascript"> | |
function initMap() { | |
var map = L.map('map').setView([30.00, -30.00], 3); | |
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The MIT License (MIT) | |
# Copyright (c) 2016 Vladimir Ignatev | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the "Software"), | |
# to deal in the Software without restriction, including without limitation | |
# the rights to use, copy, modify, merge, publish, distribute, sublicense, | |
# and/or sell copies of the Software, and to permit persons to whom the Software | |
# is furnished to do so, subject to the following conditions: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $ scala-2.11.5 -Xexperimental | |
// Original Java 8 version: http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples/ | |
scala> import java.util.{Arrays, List, ArrayList} | |
scala> import java.util.stream.{Stream, IntStream} | |
// List<String> myList = Arrays.asList("a1", "a2", "b1", "c2", "c1"); | |
scala> val myList = Arrays.asList("a1", "a2", "b1", "c2", "c1") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Скрипт для скачивания музыки с сайта vkontakte.ru (vk.com) | |
Запуск: | |
python vkcom_audio_download.py | |
Принцип работы: | |
Скрипт проверяет сохраненный access_token. Если его нет или срок истек, | |
то открывается страница в браузере с запросом на доступ к аккаунту. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION upsert_tableName(arg1 type, arg2 type) RETURNS VOID AS $$ | |
DECLARE | |
BEGIN | |
UPDATE tableName SET col1 = value WHERE colX = arg1 and colY = arg2; | |
IF NOT FOUND THEN | |
INSERT INTO tableName values (value, arg1, arg2); | |
END IF; | |
END; | |
$$ LANGUAGE 'plpgsql'; |
As configured in my dotfiles.
start new:
tmux
start new with session name:
NewerOlder