Skip to content

Instantly share code, notes, and snippets.

View nattatorn-dev's full-sized avatar

Mark nattatorn-dev

  • LedgerX Co., Ltd.
  • Bangkok, Thailand
View GitHub Profile
@silver-xu
silver-xu / ts-boilerplate.md
Last active June 19, 2024 15:10
Setup a Node.js project with Typescript, ESLint, Prettier, Husky

Setup a Node.js project with Typescript, ESLint, Prettier, Husky

1_D8Wwwce8wS3auLAiM3BQKA

Starting a personal node project could be easy; starting a team node project could be challenging.

I am a developer currently working in SEEK Australia.

In my experience, common mistakes developer make when starting a projects are:

  • No Linting
@padilo
padilo / kafka-consumer-by-topic.sh
Created July 3, 2019 13:22
Script to get from Kakfa the list of topics consumed by each consumer group
#!/bin/bash
if [ $# -ne 2 ]; then
>&2 echo "usage: $0 <kafka_binary_folder> <bootstrap.server>"
>&2 echo
>&2 echo "It outputs the list of topics consumed by consumergroup as csv."
>&2 echo "With the following structure:"
>&2 echo " <consumer>,<topic>"
exit 1
fi
#!/bin/sh
sudo apt-get update && sudo apt-get upgrade -y
# jq is a sed-like tool that is specifically built to deal with JSON format.
sudo apt-get install jq -y
# install the latest version of the IBM Cloud CLI tool by issuing the command, make sure you have a minimum version of Docker 1.13.1 installed before installing this tool.
curl -sL http://ibm.biz/idt-installer | bash
@tomekbielaszewski
tomekbielaszewski / main.go
Last active August 17, 2023 19:22
Example of RabbitMQ reconnect feature. Including recovering already registered consumers.
package main
import (
"fmt"
"log"
"time"
)
func main() {
queue := NewQueue("amqp://guest:guest@localhost:5672/", "hello")
@rosstimson
rosstimson / cheese.yml
Last active July 26, 2019 09:11
Kubernetes Traefik and External DNS
# Deployments
# --------------------------------------------------------------------
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: stilton
namespace: dev
labels:
@pantsel
pantsel / docker-compose.yml
Last active May 13, 2024 14:29
example docker-compose.yml for kong, postgres and konga
version: "3"
networks:
kong-net:
driver: bridge
services:
#######################################
# Postgres: The database used by Kong
@1hakr
1hakr / example.com
Last active January 31, 2024 01:16
Supercharge your NGIX config
proxy_cache_path /tmp/cacheapi levels=1:2 keys_zone=microcacheapi:100m max_size=1g inactive=1d use_temp_path=off;
server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
server_name example.com;
location /api/ {
# Rate Limiting
limit_req zone=reqlimit burst=20; # Max burst of request
@agapoff
agapoff / fluentd-configmap-elasticsearch.yaml
Last active June 20, 2023 07:08
Daemonset and optimized ConfigMap for fluentd in K8S with stripped apiserver messages and some useless fields
---
apiVersion: v1
kind: ConfigMap
metadata:
name: fluentd-config
namespace: kube-system
data:
kubernetes.conf: |-
<match fluent.**>
@type null
@superseb
superseb / README.md
Last active April 17, 2022 09:01
Deploy kubernetes-dashboard on Rancher 2.x cluster exposed using NodePort

Deploy kubernetes-dashboard on Rancher 2.x cluster exposed using NodePort

This has been updated to install Dashboard v2.0.0, see below for pre v2.0.0 instructions

Requirements

Step 1: Generate kubeconfig from the UI

Generate the kubeconfig file for your cluster using the Kubeconfig File button in the Cluster view of your cluster.

@mjuric
mjuric / kafka-useful-commands.md
Last active May 24, 2024 14:06
Useful Kafka wrangling commands

Utilities you'll care about

All these are already installed on epyc.

  • kafkacat (conda install -c conda-forge kafkacat)

  • kt (grab it from https://github.com/fgeller/kt/releases)

  • kafka-* (come with kafka, if you yum install if from Confluent's repo, or via Docker if you're so inclined). Warning -- JVM based and dreadfully slow.

  • jq (conda install -c conda-forge jq or use your favorite package manager)