Skip to content

Instantly share code, notes, and snippets.

@sap1ens
sap1ens / ReadKafkaSourceState.java
Created April 1, 2026 18:12
Reading Flink Kafka Consumer Offsets from a Savepoint
package dev.irontools.flink.state;
import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.runtime.state.hashmap.HashMapStateBackend;
import org.apache.flink.state.api.OperatorIdentifier;
import org.apache.flink.state.api.SavepointReader;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import java.io.ByteArrayInputStream;
@information-security
information-security / install.md
Created November 4, 2022 03:37
Install sstp-client on ubuntu 22

Prerequisites

sudo apt-get install build-essential ppp-dev libevent-dev libssl-dev autoconf libtool

Clone the repo

git clone https://gitlab.com/eivnaes/sstp-client.git sstp-client-source
cd sstp-client-source
@djm
djm / README.md
Last active January 19, 2026 16:52
Create a Chrome GitHub Repo Search Shortcut
@htuscher
htuscher / microk8s.md
Last active April 24, 2023 12:01
MicroK8s on Hetzner Cloud

Installation

apt-get install snapd
snap install microk8s --classic --channel=1.18/stable
microk8s enable dns dashboard registry helm3 ingress storage

Dashboard

@fnky
fnky / ANSI.md
Last active August 28, 2026 22:29
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@davideicardi
davideicardi / README.md
Last active May 4, 2025 21:48
Write and read Avro records from bytes array

Avro serialization

There are 4 possible serialization format when using avro:

@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)
@Aschen
Aschen / tutorial_softether_client.md
Last active March 25, 2026 16:56
Tutorial SoftEther Client (Ubuntu)

SoftEther Client

Download and install

Go to http://www.softether-download.com/files/softether and download SoftEther Client for the right architecture.

> cd /tmp
> wget http://www.softether-download.com/files/softether/v4.18-9570-rtm-2015.07.26-tree/Linux/SoftEther_VPN_Client/64bit_-_Intel_x64_or_AMD64/softether-vpnclient-v4.18-9570-rtm-2015.07.26-linux-x64-64bit.tar.gz
> tar xf softether-vpnclient-v4.18-9570-rtm-2015.07.26-linux-x64-64bit.tar.gz
@gene1wood
gene1wood / 01_get_account_id_for_user_ec2instance_role_or_lambda.py
Last active March 20, 2025 20:13
Method to determine your AWS account ID using boto3 for either a user or an ec2 instance or lambda function
import boto3
print(boto3.client('sts').get_caller_identity()['Account'])
@granturing
granturing / reactive_map.js
Last active November 14, 2022 04:28
Sample reactive Leaflet code for Zeppelin
<!-- 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', {