Skip to content

Instantly share code, notes, and snippets.

View sumitdhameja's full-sized avatar
🎯
Focusing

Sumeet Dhameja sumitdhameja

🎯
Focusing
View GitHub Profile
@sumitdhameja
sumitdhameja / clone.sh
Created February 27, 2016 16:13
Clone - Ubuntu
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Parameters:"
echo "1- Host (irvwebxlx01)"
echo "2- IP (10.50.7.201)"
exit 1
fi
_host=$1
@sumitdhameja
sumitdhameja / deploy.sh
Created February 27, 2016 16:15
Deploy to Multiple Servers
#!/bin/bash
# Download Artifact and Extract
_CLUSTER=$1
BUILD_VERSION=$2
BUILD_ENV="$3"
_DROPFOLDER="/data/edgex/builds/"
_FILENAME="${BUILD_VERSION}.zip"
@sumitdhameja
sumitdhameja / configure_ssh.sh
Created February 27, 2016 17:13
Configure Firewall
#---------------------------
# Confugure SSH
#---------------------------
apt-get install openssh-server -y
sed -i "s/Port .*/Port 6660/g" /etc/ssh/sshd_config
service ssh restart
#---------------------------
# Configure Firewall
@sumitdhameja
sumitdhameja / installRedis.sh
Created February 27, 2016 17:15
Install Redis
#---------------------------
# Build Redis from Source
#---------------------------
echo "[-] Install Redis Requirements"
apt-get install -y build-essential tcl8.5
echo "[-] Install Redis Server"
echo " Download Source"
wget http://download.redis.io/releases/redis-2.8.9.tar.gz
tar xzf redis-2.8.9.tar.gz
rm !!:2
@sumitdhameja
sumitdhameja / nodejs.sh
Created February 27, 2016 17:22
Setup - Node.JS
# REF: https://github.com/creationix/nvm
git clone https://github.com/creationix/nvm.git ~/.nvm
apt-get install -y openssl libssl-dev
echo ". ~/.nvm/nvm.sh" >> ~/.bashrc
. ~/.nvm/nvm.sh
nvm ls-remote
@sumitdhameja
sumitdhameja / Heirloom_MailX.sh
Created February 27, 2016 17:53
Setting up Heirloom MailX to send emails from linux(Debian/ ubuntu) system:
mkdir MailX
cd MailX
#Download file
wget http://ftp.debian.org/debian/pool/main/h/heirloom-mailx/heirloom-mailx_12.5.orig.tar.gz
#Download patch
wget http://www.linuxfromscratch.org/patches/blfs/svn/heirloom-mailx-12.5-fixes-1.patch
#unZip
tar -xvzf heirloom-mailx_12.5.orig.tar.gz
@sumitdhameja
sumitdhameja / manifest-template.yaml
Created February 27, 2016 18:13 — forked from jbeda/manifest-template.yaml
Script to create VM to host private docker registry on GCE backed by GCS
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@sumitdhameja
sumitdhameja / start-local-registry.sh
Created February 27, 2016 18:16 — forked from smreed/start-local-registry.sh
Shell script that starts up a local docker registry with a Google Cloud Storage backend using local credentials.
#!/bin/bash
LOCAL_REGISTRY_NAME=local-docker-registry
GCS_BUCKET=some-bucket
CONFIG_DIR=$HOME/.config
LOCAL_REGISTRY_ID=`docker ps -q $LOCAL_REGISTRY_NAME`
if [ ! -z "$LOCAL_REGISTRY_ID" ]; then
#! /bin/bash
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@sumitdhameja
sumitdhameja / kafka-part-distrib.sh
Created February 27, 2016 18:25 — forked from kashyapp/kafka-part-distrib.sh
matrix that shows partition distribution for a topic across brokers
#!/bin/bash -e
/usr/share/fk-3p-kafka/bin/kafka-topics.sh $ZOOKEEPER --describe --topic $1 \
| grep Leader \
| awk '{print $4,$8}' | sed 's/,/ /' \
| awk '{
for(i=1;i<7;++i){a[i]=0};
sum[$2]++; sum[$3]++;
a[$2]=1; a[$3]=1;
printf "%3d ",$1;
for (i=1;i<7;++i) {printf "%3d ",a[i]}; printf "\n";