This file contains hidden or 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 | |
# start YARN | |
sudo service hadoop-yarn-resourcemanager start | |
sudo service hadoop-yarn-nodemanager start | |
sudo service hadoop-mapreduce-historyserver start | |
# start Hadoop | |
for x in `cd /etc/init.d ; ls hadoop-hdfs-*` ; do sudo service $x start ; done |
This file contains hidden or 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 | |
# stop YARN | |
sudo service hadoop-yarn-resourcemanager stop | |
sudo service hadoop-yarn-nodemanager stop | |
sudo service hadoop-mapreduce-historyserver stop | |
# stop Hadoop | |
for x in `cd /etc/init.d ; ls hadoop-hdfs-*` ; do sudo service $x stop ; done |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
import os | |
import sys | |
import argparse | |
import textwrap | |
import json | |
import traceback | |
def createParser(): |
This file contains hidden or 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
body { | |
width: 45em; | |
border: 1px solid #ddd; | |
outline: 1300px solid #fff; | |
margin: 16px auto; | |
} | |
body .markdown-body | |
{ |
This file contains hidden or 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
# import module | |
import mongoengine | |
# Django Database settings | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.dummy', | |
}, | |
} | |
# MongoEngine Settings |
This file contains hidden or 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
# Django Database settings | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django_mongodb_engine', | |
'NAME': 'db-name', | |
'USER': 'admin', | |
'PASSWORD': 'password', | |
'HOST': 'localhost', | |
'PORT': '27017', |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
# 1) Write a program to illustrate recursion for the following: | |
# * Whether a word is a pallindrome or not. | |
def isWordPalindrome(word): | |
""" | |
Checks whether a word is palindrome or not | |
""" |
This file contains hidden or 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 python | |
# -*- coding: utf-8 -*- | |
import re | |
def split(delimiters, string, maxsplit=0): | |
""" | |
Split string with multiple delimiters | |
delimiters: a list of delimiters | |
string: a target string |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# Gunicorn(v19.3) Configuration File | |
# Reference - http://docs.gunicorn.org/en/19.3/settings.html | |
# | |
# To run gunicorn by using this config, run gunicorn by passing | |
# config file path, ex: | |
# | |
# $ gunicorn --config=gunicorn.py MODULE_NAME:VARIABLE_NAME | |
# |
This file contains hidden or 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
# To use this custom JsonEncoder class, you have to create a __json__() named | |
# function in each sqlalchemy model class, which basically return a list of model | |
# class attributes to be parsed, otherwise all attributes are processed present | |
# in `dir(class_name)`. | |
# | |
# Model Example: | |
# class User(db.Model): | |
# id = db.Column(db.Integer, primary_key=True) | |
# name = db.Column(db.String(100)) | |
# email = db.Column(db.String(100)) |