Skip to content

Instantly share code, notes, and snippets.

View firemonk9's full-sized avatar

firemonk firemonk9

View GitHub Profile
@firemonk9
firemonk9 / config.json
Created September 30, 2020 19:41
EMR Cluster configuration
[
{
"classification":"spark",
"properties":{
"maximizeResourceAllocation":"true",
"spark.yarn.executor.memoryOverhead":"1024M"
},
"configurations":[
]
@firemonk9
firemonk9 / gen_data.sql
Created September 28, 2020 22:18
generate data with sequence
CREATE TABLE dataq_demo.tbl_ItemTransactions1
(
TranID SERIAL
,TransactionDate TIMESTAMPTZ
,TransactionName TEXT
);
drop table dataq_demo.tbl_ItemTransactions1
@firemonk9
firemonk9 / data_gen.sql
Created September 28, 2020 20:28
sample sql code to generate volume data
CREATE TABLE dataq_demo.large_test (num1 bigint, num2 double precision, num3 double precision);
INSERT INTO dataq_demo.large_test (num1, num2, num3)
SELECT round(random()*10), random(), random()*142
FROM generate_series(1, 20000000) s(i);
@firemonk9
firemonk9 / remove_special_chars.sh
Created February 24, 2020 20:05
bash command to remove special chars from file names
for file in *; do mv "$file" "${file//[ ()@$]/_}" ; done
@firemonk9
firemonk9 / share_point_chrome_download.py
Created February 24, 2020 18:42
Scrap Share point documents from Chrome browser
import subprocess
vval='"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" <URL>'
def run_win_cmd(cmd):
result = []
process = subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@firemonk9
firemonk9 / xls_to_csv.py
Created February 24, 2020 16:42
sample python code to convert xlsx to csv files
import xlrd
import csv
import glob
import os
from os import sys
def csv_from_excel(excel_file):
workbook = xlrd.open_workbook(excel_file)
all_worksheets = workbook.sheet_names()
for worksheet_name in all_worksheets:
@firemonk9
firemonk9 / compare_two_way.txt
Created April 12, 2017 15:43
Compare two way
There are two modes to compare the datasets.
a. Compare two way : Compares source and destination records.