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
#!/bin/bash | |
# Maintainer : Mansur Ul Hasan | |
# EMail : [email protected] | |
# LinkedIn : https://www.linkedin.com/in/mansurulhasan/ | |
# Youtube : https://www.youtube.com/user/mansur7820/ | |
# This script is meant to setup Kubernetes Environment on Ubuntu / Debian supported paltforms | |
# We have try to cover all the required tools modules which needed by modern kubernetes | |
# Disclaimer : | |
# This script is well tested on ubuntu 18 and 16 |
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
#!/bin/bash | |
arg=$@ | |
if [ $# -le '2' ]; | |
then | |
echo "Script has sufficient parameter" | |
else | |
echo "Invalid parameter" | |
fi |
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
#!/bin/bash | |
MONGOD=`ps aux |grep mongod |grep -v grep |awk '{print $2}'` | |
MONGOCOUNT=`ps aux |grep mongod |grep -v grep |awk '{print $2}'|wc -l` | |
mail_func () { | |
echo $MONGOD > /tmp/email | |
mail -s "Mongo is not running " [email protected] < /tmp/email | |
} |
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
#!/bin/bash | |
GoMongo () { | |
echo "Mongo is going to start" | |
mongod --config /etc/mongod.conf | |
echo "mongo is started" | |
} | |
StopMongo () { |
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
#!/bin/bash | |
# Get current swap usage for all running processes | |
# Mansur Ul Hasan 04/02/2017 | |
SUM=0 | |
OVERALL=0 | |
for DIR in `find /proc/ -maxdepth 1 -type d | egrep "^/proc/[0-9]"` ; do | |
PID=`echo $DIR | cut -d / -f 3` | |
PROGNAME=`ps -p $PID -o comm --no-headers` | |
for SWAP in `grep Swap $DIR/smaps 2>/dev/null| awk '{ print $2 }'` | |
do |
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
#!/bin/bash | |
# This script will install HAproxy with LUA+SSL support | |
# Author : Mansur Ul Hasan | |
# Email : [email protected] | |
# Disclaimer : This script is well tested on ubuntu if you are using RPM based distros please install relevant packages | |
CheckOS () { | |
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
############################## | |
# This script setup whole infrastructure on AWS to run ec2 instance this will include VPC Setup | |
# (Including : "VPC", "Subnet", "internet Gateway", "Route Table", "Security Group to allow SSH") | |
# also it sets up EC2 Instance along with keypairs | |
############################## | |
### Provider Setup | |
provider "aws" { | |
region = "us-east-2" | |
} | |
### Variables declearation |
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
############################################################################ | |
# Author Mansur Ul Hasan | |
# EMail : [email protected] | |
# YouTube : https://www.youtube.com/user/mansur7820/about?view_as=subscriber | |
# This script consist with State Full Web Server with Nginx using terraform | |
# This script will setup | |
# - VPC | |
# - Subnets | |
# - Route Tables |
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
#!/bin/bash | |
# Author : Mansur Ul Hasan | |
# EMail : [email protected] | |
# Disclaimer : | |
# This script is well tested on Ubuntu Docker image and latest Ubuntu version along with | |
# some older versions like Ubuntu 14.04 | |
SetupLoc='/tmp' | |
Download_Setup () { | |
# This function download all neccesary files which are required |
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
yum install -y yum-utils | |
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
yum makecache fast | |
yum install -y http://mirror.centos.org/centos/7/extras/x86_64/Packages/container-selinux-2.99-1.el7_6.noarch.rpm | |
yum install docker-ce | |
systemctl status docker.service && systemctl enable docker.service && systemctl start docker.service && systemctl status docker.service | |