Skip to content

Instantly share code, notes, and snippets.

View anubhavsinha's full-sized avatar

Anubhav Sinha anubhavsinha

View GitHub Profile
@anubhavsinha
anubhavsinha / git_deploy_docker.py
Last active August 29, 2015 14:05
A flask script to listen for POST hooks for the production branch.
###################################################################
# TODO:
# add logging and ses email alerts for deployment failed and passed.
# Also pipe in the log file to logstash etc.
# Also write test cases
# Make all of the deployment task async and return to the POST request immediately.
# Already uses auto-reload - flask debug=True provides auto-reload out of t
# You will need to
# cd ~
@anubhavsinha
anubhavsinha / docker_remove_all.sh
Created August 14, 2014 19:21
alias for stop and rm all docker containers
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
# docker build -t="rails" .
FROM ubuntu:12.04
RUN apt-get update
## MYSQL
RUN apt-get install -y -q mysql-client libmysqlclient-dev
## RUBY
from fabric.api import *
env.hosts = ['host.name.com']
env.user = 'user'
env.key_filename = '/path/to/keyfile.pem'
def local_uname():
local('uname -a')
def remote_uname():
@anubhavsinha
anubhavsinha / fabfile.py
Created August 23, 2014 00:37
running different commands on different hosts.
from fabric.api import *
from fabric.context_managers import settings
hosts = ['10.10.6.234', '10.10.6.65']
env.user = 'ubuntu'
env.key_filename = '/home/as/work/credentials/pipeline.pem'
def local_uname():
local('uname -a')
def remote_uname():
@anubhavsinha
anubhavsinha / install_java.sh
Created September 14, 2014 10:50
installing latest Java version 8 update 20 on Ubuntu 14.04
add-apt-repository ppa:webupd8team/java
apt-get update
apt-get install oracle-java8-installer
apt-get install oracle-java8-set-default
@anubhavsinha
anubhavsinha / install_elasticsearch.sh
Last active August 29, 2015 14:06
install elastic search on Ubuntu 14.04 (assuming Java version 8, update 20 already installed)
# But first install Java version update 20
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.5.2.zip
apt-get install unzip
unzip elasticsearch-1.5.2 -d /usr/local/elasticsearch
cd /usr/local/elasticsearch/elasticsearch-1.5.2/
bin/plugin -install elasticsearch/elasticsearch-cloud-aws/2.4.1
bin/plugin -i elasticsearch/marvel/latest
echo "ulimit -n 32000" > /etc/rc.local # we need to increase the max file descriptors from 4096 to 32k
echo "export ES_HEAP_SIZE=30g" > /etc/rc.local # keep heap size half of the total available RAM. Should be under 32g to avoid jvm issues.
echo "cd /usr/local/elasticsearch/elasticsearch-1.5.2/ && bin/elasticsearch -d" >> /etc/rc.local
@anubhavsinha
anubhavsinha / nvidia.sh
Created September 15, 2014 10:27
Nvidia Driver installation on EC2 RHEL 7 GPU instance
yum groupinstall "Development Tools"
yum install kernel-devel kernel-headers dkms
yum install pciutils
lspci -nn | grep VGA # to check your NVIDIA product version
yum update
sudo sh NVIDIA-Linux-x86_64-340.32.run --kernel-source-path /usr/src/kernels/3.10.0-123.6.3.el7.x86_64
@anubhavsinha
anubhavsinha / nice.txt
Created September 16, 2014 10:16
NICE DCV Installation on RHEL 7 Enterprise AWS HVM GPU instance.
# Installing NVIDIA Official Driver
yum groupinstall "Development Tools"
yum install kernel-devel kernel-headers dkms
yum install pciutils
lspci -nn | grep VGA # to check your NVIDIA product version
yum update # For kernel source etc
sudo sh NVIDIA-Linux-x86_64-340.32.run --kernel-source-path /usr/src/kernels/3.10.0-123.6.3.el7.x86_64
# NVIDIA Driver got installed successfully!
# Installing NICE DCV