Skip to content

Instantly share code, notes, and snippets.

View anubhavsinha's full-sized avatar

Anubhav Sinha anubhavsinha

View GitHub Profile
@anubhavsinha
anubhavsinha / steps
Created December 27, 2016 09:27
git bitbucket workflow
Step1: Fork
upstream = git@bitbucket.org:organization/reponame.git
After fork I have the repository in my user account
Fork = git@bitbucket.org:anubhavsinha/reponame.git
Upstream has two branches - stage and master
So, after forking your working repository will have two branches - stage and master
@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 / python-pip.sh
Created December 8, 2015 11:55
installing python pip on linux
wget https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
@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 / mesos.sh
Last active October 18, 2015 02:59
Mesos on AWS RHEL 7
# Add the mesosphere repository
sudo rpm -Uvh http://repos.mesosphere.com/el/7/noarch/RPMS/mesosphere-el-repo-7-1.noarch.rpm
sudo yum update -y
# For mesos-master-zookeeper-metaframework nodes - start 3 of these for a HA setup
sudo yum install mesos marathon chronos mesosphere-zookeeper
# For mesos-slave
sudo yum install mesos
@anubhavsinha
anubhavsinha / fixing_ssh.sh
Created October 17, 2015 02:43
Fixing SSH session freeze issue due to Routers/NATs closing inactive connections
# sudo vi /etc/ssh/ssh_config
# keep ssh sessions fresh
Host *
ServerAliveInterval 60
@anubhavsinha
anubhavsinha / ansible.sh
Created October 15, 2015 12:16
Running the ansible command on servers with common user and .pem file
ansible all -m ping -i inventory_file --user=ec2-user --private-key=../k8s.pem
@anubhavsinha
anubhavsinha / amazon-rhel-7.sh
Created October 15, 2015 10:38
Enable repositories om Amazon RHEL 7
sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
@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 / dynamodb.js
Created August 12, 2015 18:08
Amazon DynamoDB NodeJS example script
var AWS = require('aws-sdk'); // credentials can be loaded through IAM role
var dynamodb = new AWS.DynamoDB();
var item = {
"Color":{"S":"white"},
"Name":{"S":"fancy vase"},
"Weight":{"N":"2"},
"LastName":{"S":"Kumar"}
}
// To put an item to DynamoDB