Skip to content

Instantly share code, notes, and snippets.

View hackintoshrao's full-sized avatar
📚
Exploring AI agents on code search and understanding

Karthic Rao hackintoshrao

📚
Exploring AI agents on code search and understanding
View GitHub Profile
{
"id": "/minio-dcos",
"instances": 4,
"cpus": 0.5,
"mem": 512,
"container": {
"type": "DOCKER",
"volumes": [
{
"containerPath": "miniodata",
#!/bin/bash
# wait 5 seconds for dns to
echo "Waiting 30 seconds for dns"
sleep 30
# print environment
env
# get instance count
#!/bin/sh
#
# Minio Cloud Storage, (C) 2017 Minio, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@hackintoshrao
hackintoshrao / cnn.py
Created April 27, 2017 06:15
Mnist dataset learning using tensorflow CNN
ights = {
'wc1': tf.Variable(tf.random_normal([5, 5, 1, 32])),
'wc2': tf.Variable(tf.random_normal([5, 5, 32, 64])),
'wd1': tf.Variable(tf.random_normal([7*7*64, 1024])),
'out': tf.Variable(tf.random_normal([1024, n_classes]))}
biases = {
'bc1': tf.Variable(tf.random_normal([32])),
'bc2': tf.Variable(tf.random_normal([64])),
'bd1': tf.Variable(tf.random_normal([1024])),
@hackintoshrao
hackintoshrao / download-jars.sh
Created April 10, 2017 07:50
shell script to download all the jar depencies necessary for Apache Spark to work with Minio and Hadoop.
#!/bin/bash
wget http://central.maven.org/maven2/com/amazonaws/aws-java-sdk/1.11.43/aws-java-sdk-1.11.43.jar
wget http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-core/1.11.43/aws-java-sdk-core-1.11.43.jar
wget http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-kms/1.11.43/aws-java-sdk-kms-1.11.43.jar
wget http://central.maven.org/maven2/com/amazonaws/aws-java-sdk-s3/1.11.43/aws-java-sdk-s3-1.11.43.jar
wget http://central.maven.org/maven2/org/apache/hadoop/hadoop-aws/2.7.1/hadoop-aws-2.7.1.jar
wget http://central.maven.org/maven2/org/apache/hadoop/hadoop-aws/3.0.0-alpha1/hadoop-aws-3.0.0-alpha1.jar
wget http://central.maven.org/maven2/com/fasterxml/jackson/core/jackson-annotations/2.8.4/jackson-annotations-2.8.4.jar
wget http://central.maven.org/maven2/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.jar
@hackintoshrao
hackintoshrao / half.m
Created March 12, 2017 02:23
Reduce the intensities of the images before adding them
car = imread(car.png);
beach = imread(beach.png);
merge = car / 2 + beach / 2 ;
imshow(merge);
@hackintoshrao
hackintoshrao / add.m
Created March 12, 2017 02:20
Add 2 images.
car = imread(car.png);
beach = imread(beach.png);
merge = car + beach ;
imshow(merge);
@hackintoshrao
hackintoshrao / red.m
Created March 12, 2017 02:13
Separating the layers of the image.
# read the image.
img = imread('bicycle.png');
# display the image
imshow(img);
# check size of the image.
disp(size(img)); % check size
# separate out the red channel.
img_red = img(: ,:, 1);
# display the image with the red channel.
imshow(img_red);
@hackintoshrao
hackintoshrao / red.m
Created March 12, 2017 02:06
Cropping image
# read the image.
img = imread('bicycle.png');
# display the image
imshow(img);
# check size of the image.
disp(size(img)); % check size
# select the region to crop
cropped = img(110:310, 10:160);
# display cropped image.
imshow(cropped);
@hackintoshrao
hackintoshrao / canny.py
Created February 27, 2017 14:20
Canny edge detection
# Do all the relevant imports
import matplotlib.pyplot as plt
import matplotlib.image as mpimg
import numpy as np
import cv2
# Read in the image and convert to grayscale
# Note: in the previous example we were reading a .jpg
# Here we read a .png and convert to 0,255 bytescale
image = mpimg.imread('exit-ramp.jpg')