Skip to content

Instantly share code, notes, and snippets.

View senthilsweb's full-sized avatar
💭
I may be slow to respond.

Senthilnathan Karuppaiah senthilsweb

💭
I may be slow to respond.
View GitHub Profile

How to create Fake DNS in Mac OS for Local Kubernetes Ingress testing

Often times we need a way to simulate local domain name pointing to your local api or web development and it is critical if you use kubernetes ingress controller or traefik proxy to test your configuration in yoou local Mac laptop.

create a new ip

sudo ifconfig lo0 10.0.0.1 alias

Tunnel or forward 10.0.0.1:80 to custom port to your localhost. In this case, post 3000

@senthilsweb
senthilsweb / kind.md
Last active October 25, 2021 03:18
K8s KinD Deployment

Introduction

PostgreSQL Database and Web application (PGAdmin) deployed in Kubernetes cluster using KinD. Access to the web application is exposed using nodeport @ http://localhost:8081

Follow step # 1 and step # 3 two mandatory steps to setup the K8s cluster and deployment. Persistent volume setup is optional (Step # 2).

  1. Create KinD cluster
  2. Apply Persistent volume
  3. Deploy application
version: "3.7"
services:
golang:
build:
context: ./
dockerfile: ./image.golang.Dockerfile
container_name: golang
FROM golang:1.12-alpine
RUN apk update && apk upgrade && \
apk add --no-cache bash git openssh
WORKDIR /app
ENTRYPOINT ["tail", "-f", "/dev/null"]

Apache Airflow starter tutorial with 3 tasks includidng sending slack notification

Pre-requisite

  • Airflow latest stable verison installed (preferable to use Airflow in docker).
  • Minimum 4 GB ram to be allocated for the docker
  • Create an Airflow connection for Slack with HTTP connection and the part after https://hooks.slack.com/services should go under password: Refer the diagram below and extract the API token (Shaded portion) from your slack app and key in appropriately

References

From each line, remove the first 5 characters in a text file and pipe it to another text from

sed 's/^.\{6\}//' from.txt >> to.txt

Remove duplicates from the file

sort to.txt | uniq
@senthilsweb
senthilsweb / install-docker.md
Created June 6, 2021 14:42 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
We can make this file beautiful and searchable if this error is corrected: It looks like row 9 should actually have 17 columns, instead of 16. in line 8.
1,KEITA,Delight,Abdullahi,Male,2006-08-17,2012-06-24,Nasarawa,Karu,Child,Raining,Urban,cholera,Null,Alive,Confirmed,1
2,CHIDOZIE,Justice,Loveth,Female,1982-03-13,2002-10-16,Ekiti,Ekiti South West,Adult,Dry,Urban,cholera,Null,Dead,Confirmed,0
3,Bubari,Hadijah,Grace,Female,1980-04-09,2004-04-16,Kebbi,Argungu,Adult,Raining,Urban,cholera,Null,Dead,Unconfirmed,0
4,FRED,Ebuka,Peter,Male,2012-11-16,2016-06-15,Abia,Ukwa East,Child,Raining,Urban,cholera,Null,Dead,Confirmed,2
5,KAZAH,Taiwo,Buba,Male,1987-06-15,2010-02-14,Kano,Kano,Adult,Raining,Rural,cholera,Null,Alive,Confirmed,0
6,Suleiman,Dave,Halim,Male,1964-12-18,2008-03-13,Borno,Chibok,Adult,Raining,Rural,cholera,Null,Dead,Confirmed,1
7,MENSAH,Yul,Salim,Male,1996-03-04,1996-04-25,Ondo,Ose,Child,Raining,Rural,cholera,Null,Dead,Unconfirmed,0
8,NDEBELE,Rose,Bitrus,Female,1993-10-28,2005-03-20,Yobe,Karasuwa,Child,Raining,Rural,cholera,Null,Alive,Confirmed,2
9,PRINCEWORLD,Hadijah,Lydia,Female,1972-09-09,1977-08-26,Niger,Paiko,Child,Dry,Rural,cholera,Null,Dead,Unconfir

lambda.data.extractor.regex

Introduction

Installation Instruction

Developer and End user guide

#This is mandatory field # 1. Hard code the name of the vendor / supplier
issuer: BREB
fields:
#This is mandatory field # 2. Always hard code the below RegEx pattern
amount: GrandTotal:(\d+\.\d+)
#This is mandatory field # 3. Always hard code the below RegEx pattern
date: InvoiceDate:(\d{1,4}\-\d{1,2}\-\d{1,4})
#This is mandatory field # 4. Always hard code the below RegEx pattern
invoice_number: InvoiceNo:(\S+)
# Actual Field extracton Regualr Expression starts from here.