This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Amal G Jose' | |
from math import radians, cos, sin, asin, sqrt | |
def get_distance(lon1, lat1, lon2, lat2): | |
##convert decimal degrees to radians | |
lon1, lat1, lon2, lat2 = map(radians, [lon1, lat1, lon2, lat2]) | |
##haversine formula | |
dlon = lon2 - lon1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ChangeBucketPermissions(object): | |
##Initializer | |
def __init__(self): | |
self.aws_access_key = "XXXXXXXX" | |
self.aws_secret_key = "XXXXXXXX" | |
aws_region = 'us-east-1' | |
self.s3_conn = boto.connect_s3(aws_access_key_id=self.aws_access_key, | |
aws_secret_access_key=self.aws_secret_key, | |
calling_format=boto.s3.connection.OrdinaryCallingFormat())) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Amal G Jose' | |
import boto | |
import ntpath | |
from boto.s3.connection import S3Connection | |
class SimpleDataUploader(object): | |
##Initializer | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"carName": "Dzire", | |
"manufacturer": "Maruthi", | |
"type": "sedan" | |
} | |
{ | |
"carName": "WagonR", | |
"manufacturer": "Maruthi", | |
"type": "mini" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author Amal G Jose | |
# This script provides the consolidated details of a linux operaing system | |
# clear the screen | |
clear | |
# Unset Variables | |
unset sys_date tempvar os architecture kernelrelease internalip externalip nameserver loadaverage sysuptime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Amal G Jose' | |
import smtplib | |
class SendEmail(object): | |
def __init__(self): | |
self.email_id = "sender@gmail.com" | |
self.email_password = "password" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo mkdir -p /app/hadoop/tmp | |
sudo chmod 777 /app/hadoop/tmp | |
sudo chown hdfs:hadoop /app/hadoop/tmp | |
<-- IN CORE-SITE.XML --> | |
<configuration> | |
<property> | |
<name>fs.defaultFS</name> | |
<value>hdfs://localhost:9000</value> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Amal G Jose' | |
import os | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.options | |
import tornado.web | |
class HelloWorldHandler(tornado.web.RequestHandler): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Amal G Jose' | |
import sys | |
import smtplib | |
import time | |
import boto | |
import boto.ses | |
from email.mime.text import MIMEText | |
from email.mime.application import MIMEApplication |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'Amal G Jose' | |
import boto | |
class GetRedShiftDetails(object): | |
def __init__(self): | |
self.aws_access_key = "XXXXXXXX" | |
self.aws_secret_key = "XXXXXXXX" |