Skip to content

Instantly share code, notes, and snippets.

View korkridake's full-sized avatar
💙
print("Hello World!")

Korkrid Kyle Akepanidtaworn korkridake

💙
print("Hello World!")
View GitHub Profile
@korkridake
korkridake / greglinscheid-polynote.sh
Last active November 4, 2019 12:55
Unofficial Docker Image for Polynote https://polynote.org/
polynoteuser02@polynotevm02:~$ sudo docker pull greglinscheid/polynote
polynoteuser02@polynotevm02:~$ sudo docker run -p 8192:8192 -v $HOME/poly-notes:/usr/src/app/polynote/notebooks — name=polynote -d -t greglinscheid/polynote:latest
polynoteuser02@polynotevm02:~$ sudo docker logs -f polynote
@korkridake
korkridake / docker-linux-installation.sh
Created November 4, 2019 12:12
Install Docker in the Official Way
# Setup the Docker Repository
polynoteuser02@polynotevm02:~$ sudo apt-get update
polynoteuser02@polynotevm02:~$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
polynoteuser02@polynotevm02:~$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
polynoteuser02@polynotevm02:~$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# Install Docker CE
polynoteuser02@polynotevm02:~$ sudo apt-get update
polynoteuser02@polynotevm02:~$ sudo apt-get install docker-ce
@korkridake
korkridake / azure-databricks-adls-gen2-mounting-python.py
Last active January 14, 2020 00:55
Mount Azure Data Lake Storage Gen2 filesystem
######################################################################################
# Set the configurations. Here's what you need:
## 1.) Client ID (a.k.a Application ID)
## 2.) Client Secret (a.k.a. Application Secret)
## 3.) Directory ID
## 4.) File System Name
## 5.) Storage Account Name
## 6.) Mount Name
######################################################################################
configs = {"fs.azure.account.auth.type": "OAuth",
@korkridake
korkridake / DQA-Python-Script.py
Last active February 3, 2022 20:23
Data Quality Assessment Script Using Python
#######################################################################
# This is Kyle's Python script for Data Quality Assessment
# Assume df = your dataframe
# Replace "df" with "[Your Dataframe]"
#######################################################################
#######################################################################
# Check summary statistics
#######################################################################
df.describe()
@korkridake
korkridake / 01-Tesco-Receipt-R-Tesseract-Implementation.R
Created May 19, 2019 05:55
Tesseract Optical Character Recognition (OCR) Engine of Tesco Receipts (Ep.1)
##############################################################################
# Tesseract Optical Character Recognition (OCR) Engine of Tesco Receipts (Ep.1)
# Author: @Kyle Akepanidtaworn
# Source Code: Using the Tesseract OCR engine in R (2018)
# Created Date: 5/19/2019
##############################################################################
# install.packages("tesseract")
library(tesseract)
eng <- tesseract("eng")
@korkridake
korkridake / test-template.json
Created May 13, 2019 12:43
Test the Azure Resource Manager (ARM) knowledge of storage account creation.
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"storageAccountName": {
"type": "string"
},
@korkridake
korkridake / Azure-Linux-VM-Verify.cmd
Created May 8, 2019 09:53
Verify your VM is running
az vm get-instance-view \
--name myVM \
--resource-group myResourceGroup \
--output table
@korkridake
korkridake / Azure-Linux-VM-CLI.cmd
Last active May 8, 2019 09:50
Create a Linux VM
az vm create \
--name myVM \ ### This name identifies the VM in Azure. It also becomes the VM's internal hostname, or computer name.
--resource-group MyResourceGroup \ ### The resource group, or the VM's logical container, is named MyResourceGroup.
--image UbuntuLTS \ ### UbuntuLTS specifies the Ubuntu 18.04 LTS VM image.
--location southeastasia \
--size Standard_DS2_v2 \ ### Standard_DS2_v2 refers to the size of the VM. This size has two virtual CPUs and 7 GB of memory.
--admin-username kyleake \ ### specify "kyleake" as the username for the VM. The username can be whatever you want.
--generate-ssh-keys ### create an SSH key pair to enable you to log in to the VM.
@korkridake
korkridake / Why_PySpark_ML.py
Created April 26, 2019 09:58
Apache Spark is used to train and evaluate machine learning models
# ---------------------------------------------------------------------------------------------
# Import Libraries
# ---------------------------------------------------------------------------------------------
from pyspark.sql.functions import col, floor, translate, round
from pyspark.ml import Pipeline
from pyspark.ml.feature import VectorAssembler, OneHotEncoder
from pyspark.ml.regression import LinearRegression
# ---------------------------------------------------------------------------------------------
# Load Input Data with PySpark
@korkridake
korkridake / Koalas_Fundamentals.py
Created April 26, 2019 09:08
Spark Notebooks Fundamentals
# --------------------------------------------------------------------------------
# Introducing Spark DataFrames
# --------------------------------------------------------------------------------
# Create some Spark DFs
df = spark.range(1000).toDF("number")
display(df)
# Summary statistics
df.describe().show()