Skip to content

Instantly share code, notes, and snippets.

View mansurali901's full-sized avatar

Mansur Ul Hasan mansurali901

View GitHub Profile
---
- hosts: all
become: true
vars:
create_containers: 4
default_container_name: docker
default_container_image: nginx
default_container_command: sleep 1d
default_container_port: 8080
defaul_host_port: 8080
#!/bin/bash
# Author : Mansur Ul Hasan
# Email : [email protected]
# LinkedIn : https://www.linkedin.com/in/mansurulhasan/
### This script setup kafka and zookeeper and well tested on CentOS Amazon Linux and FEDORA
# USAGE of the script can be standalone and could be use for cluster as well
# To Install Zookeeper on the server download the script and run with root user
# sh SetupKafkaZookeeper-RPM.sh --setup-zookeeper
# follow the instructions and complete the zookeeper setup
#!/bin/bash
# Author : Mansur Ul Hasan
# Email : [email protected]
# LinkedIn : https://www.linkedin.com/in/mansurulhasan/
### This script setup kafka and zookeeper and well tested on CentOS Amazon Linux and FEDORA
# USAGE of the script can be standalone and could be use for cluster as well
# To Install Zookeeper on the server download the script and run with root user
# sh SetupKafkaZookeeper-RPM.sh --setup-zookeeper
# follow the instructions and complete the zookeeper setup
import os
import subprocess
import fnmatch
from re import search
thisdir = '/opt/tomcat/latest/logs/'
# r=root, d=directories, f = files
list_of_files = []
for r, d, f in os.walk(thisdir):
#!/bin/bash
# This script meant to create AMI for specified instance this script is well tested
# on python3 support awscli before you begin make sure you have configure your AWS credentials
# on your machine for security purpose we are not adding credential to part of script
# Author : Mansur Ul Hasan
# Email : [email protected]
## Global variables
Instance=i-0ccc9bd30bcf06aa1 # Instance to backup
#!/bin/bash
TIMEFORMAT='It took %R seconds to complete this process.'
time {
# Defining variables
threads=$[$(nproc)+1]
# Build local yum cache and install development tools
echo "[1/16] Installing the 'Developer Tools' yum group.."
yum -y makecache >/dev/null 2>&1 && yum -y groupinstall "Development Tools" >/dev/null 2>&1
@mansurali901
mansurali901 / InstallDockerOfLine-RHEL-7.sh
Last active June 30, 2019 17:43
#This script installs Docker as offline bundle in RHEL 7
#!/bin/bash
# Author : Mansur Ul Hasan
# Email : [email protected]
# This script has two functions one should be online & online system will be used as package
# collector and will be used for package bundling
# --onlybundle This function will download Docker Offline binaries"
# --onlyinstall This function install if you already preaper offline bundle"
# --bundleship This create offline bundle
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
@mansurali901
mansurali901 / Nginx_Compile.sh
Last active June 21, 2019 16:26
Your Nginx Compilation made easy with this script
#!/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
@mansurali901
mansurali901 / statefull_nginx.tf
Last active August 22, 2019 13:05
This script consist with State Full Web Server with Nginx using terraform
############################################################################
# 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