Skip to content

Instantly share code, notes, and snippets.

View AnanthaRajuC's full-sized avatar
💻
Learning

Anantha Raju C AnanthaRajuC

💻
Learning
View GitHub Profile
@AnanthaRajuC
AnanthaRajuC / create_superset_users.py
Created April 4, 2023 13:16 — forked from pajachiet/create_superset_users.py
Scripting on Superset backend to fix bugs or automate tasks
#!/usr/bin/env python
# coding: utf8
# Script to create superset users
import pandas as pd
from sqlalchemy import create_engine
import datetime
import pexpect
import os
==========================
How Software Companies Die
==========================
- Orson Scott Card
The environment that nurtures creative programmers kills management and
marketing types - and vice versa.
Programming is the Great Game. It consumes you, body and soul. When
you're caught up in it, nothing else matters. When you emerge into
@AnanthaRajuC
AnanthaRajuC / jpa-cheatsheet.java
Created November 27, 2022 03:56 — forked from jahe/jpa-cheatsheet.java
JPA Cheatsheet
/*
JPA (Java Persistence API)
Transaction Management with an Entity-Mananger:
---
entityManager.getTransaction().begin();
entityManager.persist(<some-entity>);
entityManager.getTransaction().commit();
entityManager.clear();
@AnanthaRajuC
AnanthaRajuC / Dockerfile
Created November 8, 2022 04:24 — forked from Abhi-Codes/Dockerfile
Dockerfile to build optimized OCI image in Spring Boot
#Multi Stage Docker Build
#STAGE 1 - Build the layered jar
#Use Maven base image
FROM maven-3.8.3-openjdk-17 AS builder
COPY src /home/app/src
COPY pom.xml /home/app
#Build an uber jar
RUN mvn -f /home/app/pom.xml package
WORKDIR /home/app/target
@AnanthaRajuC
AnanthaRajuC / Retrive Json Data from Mysql.sql
Created September 15, 2022 05:58 — forked from ti-ka/Retrive Json Data from Mysql.sql
If you have saved data into a field as json, you can use mysql to retrieve each field. It may be useful in migrating database when you have decided that using JSON in a database was not a good idea.
/* APPENDIX 1-B: CLEANUP
This makes this sql query re-run able */
DROP TABLE IF EXISTS JSON_TABLE;
DROP TABLE IF EXISTS SPLIT_TABLE;
DROP VIEW IF EXISTS SPLIT_VIEW;
/* APPENDIX 1-B: Prepare TABLE
Let's say this is an example table */

Delete message after consuming it in KAFKA

In Kafka, the responsibility of what has been consumed is the responsibility of the consumer and this is also one of the main reasons why Kafka has such great horizontal scalability.

Using the high level consumer API will automatically do this for you by committing consumed offsets in Zookeeper (or a more recent configuration option is using by a special Kafka topic to keep track of consumed messages).

The simple consumer API make you deal with how and where to keep track of consumed messages yourself.

Purging of messages in Kafka is done automatically by either specifying a retention time for a topic or by defining a disk quota for it so for your case of one 5GB file, this file will be deleted after the retention period you define has passed, regardless of if it has been consumed or not.

System Requirements

  1. Apache Superset requires Python evironment. Install Python 3.6.
  2. Install Microsoft Visual C++ 14.0 with Build Tools for Visual Studio 2019. Make sure the following tools are selected.
    • MSVC v142 - VS 2019 C++ x64/x86 build tools (v14.24)
    • Windows 10 SDK (10.0.18362.0)

Requirements and Environment Set-Up

The below steps are used to setup the environment

  1. Open Command Prompt in Administrator Mode move to C:\
@AnanthaRajuC
AnanthaRajuC / MysqlAESDecrypt.java
Created April 18, 2022 12:33 — forked from keyganker/MysqlAESDecrypt.java
mysql aes_encrypt/aes_decrypt加解密函数java实现
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import javax.crypto.*;
import javax.crypto.spec.SecretKeySpec;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;
@AnanthaRajuC
AnanthaRajuC / 0.README.md
Created March 29, 2022 06:38 — forked from ijokarumawak/0.README.md
NiFi Example: Load CSV File into Table, the traditional and the new way using Record.

NiFi Example: Load CSV file into RDBMS Table using the traditional way and the new way using Record

Example Data

Ingested to the example flows by GenerateFlowFile:

ID, CITY_NAME, ZIP_CD, STATE_CD
001, CITY_A, 1111, AA
002, CITY_B, 2222, BB
003, CITY_C, 3333, CC
@AnanthaRajuC
AnanthaRajuC / github_desktop_ubuntu.sh
Created February 4, 2022 04:54 — forked from berkorbay/github_desktop_ubuntu.md
To install Github Desktop for Ubuntu
## Follow this link for further updates to Github Desktop for Ubuntu https://github.com/shiftkey/desktop/releases/latest
# UPDATE (2021-10-18): Thanks to Amin Yahyaabadi's message, the updated code is as follows
sudo wget https://github.com/shiftkey/desktop/releases/download/release-2.9.3-linux3/GitHubDesktop-linux-2.9.3-linux3.deb
### Uncomment below line if you have not installed gdebi-core before
# sudo apt-get install gdebi-core
sudo gdebi GitHubDesktop-linux-2.9.3-linux3.deb
# UPDATE (2021-03-05): Thanks to PaoloRanzi81's comment, the updated code is as follows https://gist.github.com/PaoloRanzi81