Skip to content

Instantly share code, notes, and snippets.

@tsundara
tsundara / Apache-Airflow-installation-on-Ubuntu-Linux
Created December 27, 2019 22:02
Apache Airflow installation on Ubuntu Linux 18.x (GCP)
Apache Airflow installation on Ubuntu 18.x (GCP)
https://www.anaconda.com/distribution/
Latest installable : https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
Create a GCP VM (Ubuntu 18x). Then proceed with the below commands on the ssh terminal
#Create install dirs
mkdir -p /app
sudo chown your_username -R /app
Airflow installation on Ubuntu 18.x (GCP)
https://www.anaconda.com/distribution/
Latest installable : https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh
Create a GCP VM (Ubuntu 18x). Then proceed with the below commands on the ssh terminal
#Create install dirs
mkdir -p /app
sudo chown your_username -R /app
@tsundara
tsundara / axios-rest-get-loop-table.html
Last active December 6, 2019 23:52
Self contained html file in which Axios http client calls an external REST API , loops through the array data and displays it in a table
<!DOCTYPE html>
<html lang="en">
<head>
<title>Axios Example</title>
</head>
<body>
</body>
<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
@tsundara
tsundara / oracle_table_refresh_by_renaming
Created October 19, 2018 14:21
Oracle rename table : Quickest way to create or refresh an Oracle table from a view or select statement
DROP TABLE ZNEW;
create table znew as (select * from ANY_TABLE_OR_VIEW where col='value');
drop table ZMAIN;
alter table ZNEW rename to ZMAIN;
@tsundara
tsundara / INSTALL.txt
Created February 2, 2018 21:25 — forked from mrjoes/INSTALL.txt
Dead simple broker on top of sockjs-tornado
1. pip install -r reqs.pip
2. server.py
3. open client.html in browser
4. redis-cli publish push '123456'
5. check browser console
@tsundara
tsundara / pycsvtotabletomail
Last active July 23, 2020 07:44
Convert csv file content to html table and then to smtp email
#Purpose : Takes a csv and sends an email in html table format
#usage : python pycsvtotabletomail.py mytable.csv
import pandas as pd
import sys
csvfile=sys.argv[1]
df=pd.read_csv(csvfile)
htmltable=df.to_html(index=False)
htmltable=htmltable.replace('border="1"','border="1" style="border-collapse:collapse"')
select * from MYTABLE
where MYCOLUMN like (
select '%'||to_number(to_char(dbms_random.value(1,999), '000'))||'%' num from dual
)
order by MYCOLUMN
@tsundara
tsundara / Oracle function to set decimal number precision.sql
Last active July 21, 2017 14:30
Oracle function to set decimal number precision
select to_number(to_char(dbms_random.value(1,999), '000.0')) num from dual
@tsundara
tsundara / OpenRefine_GREL.sh
Last active January 31, 2017 19:50
OpenRefine GREL common expressions
#Concatenate Cells
cells["col1"].value + " " + cells["col2"].value
cells["ORG_STREET"].value + " " + cells["ORG_CITY"].value + " " + cells["ORG_PROVINCE"].value + " " + cells["ORG_COUNTRY"].value + " " + cells["ORG_ZIP"].value
@tsundara
tsundara / sublime_commandline.md
Last active January 30, 2017 01:52
Launch sublime from Mac OS terminal (subl command)

###Opening Sublime from Mac OS terminal/command line

  • Open the $HOME/.bash_profile file on vim or nano.
  • Add the following 2 lines at the bottom. Save it.

export PATH=$PATH:"/Applications/Sublime Text.app/Contents/SharedSupport/bin"
  • Close the current terminal. Open a new terminal and enter the below command(or you can enter : source $HOME./bash_profile).