Skip to content

Instantly share code, notes, and snippets.

View avinash-mishra's full-sized avatar
🎯
Focusing

Avinash avinash-mishra

🎯
Focusing
View GitHub Profile
@avinash-mishra
avinash-mishra / AWS-CLI.md
Last active September 10, 2018 08:02 — forked from stevenyap/AWS-CLI.md
AWS S3 Command Line

S3 Syncing

# sync from bucket to local
aws s3 sync <bucket> <target_folder> <options>
aws s3 sync s3://mybucket . --acl public-read

aws s3 sync --region ap-northeast-1 s3://[移動元バケット名] s3://[移動先バケット名]
@avinash-mishra
avinash-mishra / dash_starter.py
Last active August 3, 2018 01:40
dash starter
"""
Install dependencies before running : https://dash.plot.ly/installation
"""
import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
pd.core.common.is_list_like = pd.api.types.is_list_like
@avinash-mishra
avinash-mishra / sampleSetup.py
Created January 11, 2018 09:28
python setup file example
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
@avinash-mishra
avinash-mishra / sample.json
Last active October 2, 2017 05:25
Easy json for testing
[
{
"time": "03:53:25 AM",
"milliseconds_since_epoch": 1362196405309,
"date": "03-02-2013",
"name": "alphabet"
},
{
"time": "03:53:26 AM",
"milliseconds_since_epoch": 1362196405300,
@avinash-mishra
avinash-mishra / cassandra-cluster-ec2-linux.md
Created April 4, 2017 08:48 — forked from diegopacheco/cassandra-cluster-ec2-linux.md
How to setup a Cassandra 2.x Cluster in AWS EC2 / Amazon Linux

Cassandra 2.x Cluster on AWS EC2

Install java 8

# Remove java 7
sudo yum remove -y java

# Install basic packages
sudo yum install -y git
Problem:
$ sudo apt-get update
..........
..........
Err:13 http://extras.ubuntu.com/ubuntu xenial/main Sources
404 Not Found [IP: 91.189.92.152 80]
Ign:17 http://extras.ubuntu.com/ubuntu xenial/main amd64 Packages
Ign:20 http://extras.ubuntu.com/ubuntu xenial/main i386 Packages
Ign:22 http://extras.ubuntu.com/ubuntu xenial/main all Packages
Ign:23 http://extras.ubuntu.com/ubuntu xenial/main Translation-en_US
@avinash-mishra
avinash-mishra / mysql2cassandra.py
Created September 23, 2016 09:22 — forked from erincerys/mysql2cassandra.py
Dumps a MySQL table and reformulates it into JSON to be ingested into a Cassandra table
#! /usr/bin/env python
#
# mysql2cassandra.py
# Dump a MySQL result set to file and then import into a Cassandra column family
#
# Configuration
# mysql_params [host, port, user, password, db] MySQL conenction parameters
# mysql_columns [colname, colname2, ...] Columns for building MySQL query
# The column that will hold values of the row key in the Cassandra column family must be first