Skip to content

Instantly share code, notes, and snippets.

View kingspp's full-sized avatar
🎯
Focusing

Prathyush SP kingspp

🎯
Focusing
View GitHub Profile
@kingspp
kingspp / fish_shell_local_install.sh
Last active May 8, 2020 14:30 — forked from masih/fish_shell_local_install.sh
Installs Fish Shell without root access
#!/bin/bash
# Script for installing Fish Shell on systems without root access.
# Fish Shell will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
FISH_SHELL_VERSION=3.1.2
@kingspp
kingspp / purejs_github_commits.js
Created May 1, 2020 18:15
Pure JS Implementation to get total number of github commits
// Credits - https://gist.github.com/yershalom/a7c08f9441d1aadb13777bce4c7cdc3b
const base_url = 'https://api.github.com';
function httpGet(theUrl, return_headers) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", theUrl, false); // false for synchronous request
xmlHttp.send(null);
if (return_headers) {
return xmlHttp
@kingspp
kingspp / confusion_matrix_tensorboard.py
Last active April 8, 2020 15:46
Showcases custom metric (Confusion Matrix) implementation in Tensorflow
import typing
import matplotlib.pyplot as plt
import tensorflow as tf
def plot_confusion_matrix(cm: np.array, label_mappings:typing.Dict, num_classes:int) -> plt.Figure:
"""
| **@author:** Prathyush SP
|
| Create a confusion matrix using matplotlib
:param cm: A confusion matrix: A square ```numpy array``` of the same size as labels
@kingspp
kingspp / tensorflow_custom_operation_gradient.py
Last active March 22, 2020 00:15
Custom Operations with Gradients in Tensorflow using PyFunc
# -*- coding: utf-8 -*-
"""
| **@created on:** 11/05/17,
| **@author:** Prathyush SP,
| **@version:** v0.0.1
|
| **Description:**
| DL Module Tests
| **Sphinx Documentation Status:** Complete
|
@kingspp
kingspp / pure_python_algos.py
Last active March 15, 2020 00:22
Collection of algorithms in pure python
# Argsort
l = [1,8,3,10,13, 23,4]
# Ascending
args = sorted(range(len(l)), key=l.__getitem__)
#[0, 2, 6, 1, 3, 4, 5]
# Descending
args[::-1]
#[5, 4, 3, 1, 6, 2, 0]
@kingspp
kingspp / docker_swam_gpu_config.sh
Created February 12, 2019 08:21
Docker Swam with NVidia Support
#!/usr/bin/env bash
# Remove and Install nvidia-docker2
#========================================================================================================================================
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers
docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f
sudo apt-get purge -y nvidia-docker
# Add the package repositories
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \
sudo apt-key add -
@kingspp
kingspp / pandas2spark.md
Last active October 5, 2019 15:08
Pandas Transformations in Spark

pandas2spark

This repo demonstrates moving from pandas to spark for big data analysis

Python - v3.5.2
Pandas - v0.19.2
Spark - v2.1.0

Pandas Installation

@kingspp
kingspp / rpi_config.sh
Created April 12, 2019 18:10
Raspberry Pi Configuration
#!/bin/bash
# Install required softwares
sudo apt-get update
sudo apt-get install fish -y
sudo chsh -s /usr/bin/fish
# Setup static IP -
# LAN - 192.168.0.99
# WLAN - 192.168.0.199
@kingspp
kingspp / horovod_configuration_spark.sh
Last active February 5, 2019 09:10
Horovod Spark Installation
# No Proper documentation on installing horovod with spark support
# Reference - https://github.com/uber/horovod/blob/master/docs/spark.md
# Corrupt Java installtion -
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
# Install Spark
wget http://mirrors.estointernet.in/apache/spark/spark-2.4.0/spark-2.4.0-bin-hadoop2.7.tgz
@kingspp
kingspp / horovod_installation_ami.sh
Last active January 22, 2019 14:51
AWS Deep Learning AMI with NCCL
# Install fish
cd /etc/yum.repos.d/
sudo wget https://download.opensuse.org/repositories/shells:fish:release:2/RedHat_RHEL-6/shells:fish:release:2.repo
sudo yum install fish
# Update locatedb
sudo ionice -c3 updatedb
# Install g++
sudo yum install gcc72-c++