Skip to content

Instantly share code, notes, and snippets.

View raqqun's full-sized avatar
🎯
Focusing

Alex Nikiforidis raqqun

🎯
Focusing
View GitHub Profile
@rmoff
rmoff / ccloud_connect.adoc
Created September 26, 2019 11:18
Configuring Kafka Connect with Confluent Cloud

Configuring Kafka Connect with Confluent Cloud

So you want to connect Kafka Connect to Confluent Cloud? Here’s how.

Overview

  1. Configure the worker

  2. Pre-create any topics that your source connector will write to (since auto-topic creation is not enabled on Confluent Cloud)

@bradwilson
bradwilson / settings.json
Last active April 16, 2024 16:14
Ubuntu color scheme for Windows Terminal
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": "copy",
"keys": "ctrl+shift+c"
},
{
"command": "paste",
<script>
$.as.route.page('settings', () => {
if(!S.user.is){ return $.as.route('hi') }
$.as('#settings', S.user);
;(() => {
$('#pet').on('keyup', function(){ $('.pet').text(this.value.length + ' letters.') });
$('#kiss').on('keyup', function(){ $('.kiss').text(this.value.length + ' letters.') });
S.user.get('settings').get('pet').on(function(l){ $('#pet').val(Gun.text.random(l, '*')) });
@tedivm
tedivm / apt_wait.sh
Created April 22, 2018 16:33
A BASH function to wait for `apt` to finish and release all locks.
#!/usr/bin/env bash
apt_wait () {
while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
sleep 1
done
while sudo fuser /var/lib/apt/lists/lock >/dev/null 2>&1 ; do
sleep 1
done
if [ -f /var/log/unattended-upgrades/unattended-upgrades.log ]; then
@sahilsk
sahilsk / kafka-cheat-sheet.md
Last active May 29, 2024 17:38 — forked from filipefigcorreia/kafka-cheat-sheet.md
Apache Kafka Cheat Sheet

Kafka Cheat Sheet

Display Topic Information

$ kafka-topics.sh --describe --zookeeper localhost:2181 --topic beacon
Topic:beacon	PartitionCount:6	ReplicationFactor:1	Configs:
	Topic: beacon	Partition: 0	Leader: 1	Replicas: 1	Isr: 1
	Topic: beacon	Partition: 1	Leader: 1	Replicas: 1	Isr: 1
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active July 11, 2024 21:59
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@ursuad
ursuad / kafka-cheat-sheet.md
Last active July 22, 2024 08:40
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 ...

@HR
HR / encrypt.js
Last active August 23, 2018 01:19
Node.js AES file encryption with authentication promise
'use strict'
/**
* AES file encryption with authentication (using Promises)
* (C) Habib Rehman 2016
******************************/
const encrypt = function (origpath, destpath, key) {
// decrypts any arbitrary data passed with the pass
return new Promise(function (resolve, reject) {
// readstream to read the (unencrypted) file
@harlow
harlow / golang_job_queue.md
Last active July 12, 2024 03:19
Job queues in Golang
@AndiDittrich
AndiDittrich / AesUtil.js
Last active January 7, 2024 03:47
Node.js - AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// SPDX-License-Identifier: MPL-2.0
// AES Encryption/Decryption with AES-256-GCM using random Initialization Vector + Salt
// ----------------------------------------------------------------------------------------
// the encrypted datablock is base64 encoded for easy data exchange.
// if you have the option to store data binary save consider to remove the encoding to reduce storage size
// ----------------------------------------------------------------------------------------
// format of encrypted data - used by this example. not an official format
//
// +--------------------+-----------------------+----------------+----------------+