Skip to content

Instantly share code, notes, and snippets.

I'm doing a Go training on January 10th 9:30am to 4pm. Here is roughly what I'm planning to cover.

This is a project driven hands on training, so we will be building a project to learn different Go concepts.

Project: a Key Value Database like etcd/consul and a CLI (using gRPC) to interact with it.

Prerequisite

  • Should've programmed in some language at some point in your life
#!/usr/bin/env ruby
IAM_ARNS = {
web_app: '...',
mobile_app: '...',
admin_app: '',
backups_script: '',
}
# Connect to KMS
@naheedmk
naheedmk / kafka performance benchmark
Created June 21, 2019 04:12 — forked from skdangi/kafka performance benchmark
Kafka performance benchmark summary
Kafka benchmarks summary prepared from:
https://engineering.linkedin.com/kafka/benchmarking-apache-kafka-2-million-writes-second-three-cheap-machines
https://gist.github.com/jkreps/c7ddb4041ef62a900e6c
3 nodes, no replication, topic with 6 partitions, small messages 100bytes, single producer
8.2 lakh/sec
78 mb/s
We don't need this one.
3 nodes, 3 replica, small messages 100bytes, single ack, batch size = 8196
@naheedmk
naheedmk / LinearFlow.scala
Created February 19, 2019 02:16 — forked from rocketpages/LinearFlow.scala
Demonstrating a basic linear data flow using Akka Streams
import akka.actor.ActorSystem
import akka.stream._
import akka.stream.scaladsl._
// implicit actor system
implicit val system = ActorSystem("Sys")
// implicit actor materializer
implicit val materializer = ActorMaterializer()
@naheedmk
naheedmk / FinishingCountTrigger.java
Created February 10, 2019 06:03 — forked from krolen/FinishingCountTrigger.java
Flink - counting trigger that correctly flushes all windows
public class FinishingCountTrigger<W extends Window> extends Trigger<Object, W> {
private static final long serialVersionUID = 1L;
private final long maxCount;
private final ValueStateDescriptor<Long> stateDesc = new ValueStateDescriptor<>("count", LongSerializer.INSTANCE, 0L);
public FinishingCountTrigger(long maxCount) {
this.maxCount = maxCount;
}
@naheedmk
naheedmk / choco-install-apps.ps1
Created December 11, 2018 20:49 — forked from KristofferRisa/choco-install-apps.ps1
Choco install scripts
# Install script for Kristoffer
# Created 06.08.2015
ECHO Installing apps
ECHO Configure chocolatey
choco feature enable -n allowGlobalConfirmation
#choco install visualstudiocode
choco install notepadplusplus
@naheedmk
naheedmk / check-cacerts.sh
Created November 24, 2018 18:17 — forked from julcap/check-cacerts.sh
Check expiration date for certificates in JVM cacerts file
######################################################
# List certificates, find if a cert is expired.
# Requirements for sending emails: postfix, mailutils
#
# 15-12-2015
# Julian Capilla
# lyhan_jr@hotmail.com
######################################################
#!/bin/bash
@naheedmk
naheedmk / http-status-codes.md
Created November 14, 2018 23:00 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.