Skip to content

Instantly share code, notes, and snippets.

View anubhavsinha's full-sized avatar

Anubhav Sinha anubhavsinha

View GitHub Profile
@anubhavsinha
anubhavsinha / install-apache-mesos.sh
Last active April 15, 2021 02:53
Install single node Mesos ( Latest ) cluster on Centos 7.1
sudo yum update
sudo yum install -y tar wget
# Install Mesos dependencies
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
#sudo vi /etc/yum.repos.d/wandisco-svn.repo and add the following content
#[WANdiscoSVN]
#name=WANdisco SVN Repo 1.9
#enabled=1
#baseurl=http://opensource.wandisco.com/centos/7/svn-1.9/RPMS/$basearch/
#gpgcheck=1
@anubhavsinha
anubhavsinha / cwl.sh
Created October 31, 2015 18:46
send events to a stream in a log group in cloudwatch - for elastic search
aws logs put-log-events --log-group-name anubhav-PoC --log-stream-name anubhav-PoC --log-events "[{\"timestamp\":`date +%s%3N`, \"message\": \"Simple ElasticSearch Test\"}]"
@anubhavsinha
anubhavsinha / excel2mysql.py
Created September 29, 2012 00:29
simple excel to mysql in python
# following Python packages needs to be installed
# xlrd, xlsxrd, unidecode, MySQLdb
import xlrd
import xlsxrd
import MySQLdb as mdb
import re
import unidecode
@anubhavsinha
anubhavsinha / edge_detection.py
Created August 26, 2017 21:43
canny edge detection and gaussian blur
# Running first a gaussian blur (kernel size = 3)
# and then Canny edge detection (low/high = 1:2 or 1:3)
# is a handy way to get the boundaries
from matplotlib import image
from matplotlib import pyplot
import numpy
import cv2
view_from_windshield = image.imread('test.jpg')
working_copy = numpy.copy(view_from_windshield)
@anubhavsinha
anubhavsinha / nvidia.sh
Created September 15, 2014 10:27
Nvidia Driver installation on EC2 RHEL 7 GPU instance
yum groupinstall "Development Tools"
yum install kernel-devel kernel-headers dkms
yum install pciutils
lspci -nn | grep VGA # to check your NVIDIA product version
yum update
sudo sh NVIDIA-Linux-x86_64-340.32.run --kernel-source-path /usr/src/kernels/3.10.0-123.6.3.el7.x86_64
@anubhavsinha
anubhavsinha / nice.txt
Created September 16, 2014 10:16
NICE DCV Installation on RHEL 7 Enterprise AWS HVM GPU instance.
# Installing NVIDIA Official Driver
yum groupinstall "Development Tools"
yum install kernel-devel kernel-headers dkms
yum install pciutils
lspci -nn | grep VGA # to check your NVIDIA product version
yum update # For kernel source etc
sudo sh NVIDIA-Linux-x86_64-340.32.run --kernel-source-path /usr/src/kernels/3.10.0-123.6.3.el7.x86_64
# NVIDIA Driver got installed successfully!
# Installing NICE DCV
@anubhavsinha
anubhavsinha / region_masking.py
Created August 26, 2017 20:03
region_masking
# Region masking is a technique used to run a image processing or computer vision task within a specific region of interest
# Step 1. Build a selector for the region
# Step 2. Build a selector for the pixels of interest
# Step 3. AND the two selectors. It's that simple.
from matplotlib import image
from matplotlib import pyplot
import numpy
view_from_windshield = image.imread('test.jpg')
@anubhavsinha
anubhavsinha / color_selection.py
Created August 23, 2017 20:49
color selection using numpy
# Color selection
# Step1. Read the image
# Step2. Set the threshold (In our case it is to filter out everything except white)
# Step3. Build a selector and
# Steo4. Apply the selector
# Picking the right color model is very important for a successful computer vision task.
# LUV, HSV, RGB, L*a*b etc.
# To be able to read the image file we will use the image package from matplotlib
from matplotlib import image
# To be able to render or plot the image we will use the pyplot package from matplotlib
@anubhavsinha
anubhavsinha / docker_utility.sh
Created August 17, 2016 17:38
Some utility command to clean up docker dirt
# cleans all images
docker images | awk '{print $3}' | xargs docker rmi
# cleans all stopped containers
docker rm $(docker ps -q -f status=exited)
@anubhavsinha
anubhavsinha / check-size.sh
Created April 24, 2017 06:03
To check which directory is taking the space
du -sh */