Skip to content

Instantly share code, notes, and snippets.

View mansurali901's full-sized avatar

Mansur Ul Hasan mansurali901

View GitHub Profile
@mansurali901
mansurali901 / replication-monitor.sh
Last active December 4, 2020 05:11
MySql Replication Script
#!/bin/bash
# Script is setup for Mysql Replication Monitoring
# Author Mansur UlHasan
# Mail [email protected]
# Mail Function
# Variables
HOME="/usr/local/cron"
Err1=`mysql -pv1t@m1nC -e 'show slave status \G;' |grep Last_Errno:`
@mansurali901
mansurali901 / VM_SnapShot.ps1
Last active December 5, 2016 13:34
Azure VM Snapshot In Resource Manager
# Enter a new user name and password to use as the local administrator account
# for remotely accessing the VM.
$cred = Get-Credential
# Name of the storage account where the VHD is located. This example sets the
# storage account name as "myStorageAccount"
$storageAccName = "NewStorageAccountName"
# Name of the virtual machine. This example sets the VM name as "myVM".
$vmName = "NewVMName"
@mansurali901
mansurali901 / IONAsetup.sh
Last active December 23, 2016 09:47
IONA Application's dependencies Script
# This Script is written By
# Mansur Ul Hasan (Sr, Network & System Administrator)
# GFK Etilize Pak
# This script will install all dependencies for IONA
# Below Script is Tested on
CheckPoint () {
OS="`head -n1 /etc/issue |awk '{print $1,$2,$3}'`"
case $OS in
'Ubuntu 14.04.4 LTS')
echo "Alert This script will made some changes to your system if this is
@mansurali901
mansurali901 / setup_solr4.10.4-centos.sh
Last active September 5, 2017 08:01
Apache Solr 4.10.4 Setup with Centos 6.X
#!/bin/bash
# This script will install Apache Solr 4.10.4
# Author Mansur Ul Hasan
# Sr, Network & Sys Admin
# GFK Etilize
### Main Installer Function
MainFunc () {
@mansurali901
mansurali901 / mysqlbackuptos3.sh
Created December 27, 2016 13:52
This script will backup mysql Databases and shift it to S3
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Temporary Path where the archive will be created and stored before uploading to S3
# Example: BACKUPPATH=/mnt
BACKUPPATH=/
# Amazon S3 Bucket name
# Example: S3BUCKET=production-database-backups
S3BUCKET=
@mansurali901
mansurali901 / setup_apachecentOS.sh
Last active September 5, 2017 08:00
Script to compile Apache from source code on CentOS
#!/bin/bash
# This script is tested on CentOS for Installing Apache from Source Code
# Author Mansur UlHasan
# Sr, Network & Sys Admin
# GFK Etilize Pak
# To install C/C++ Compilers, AutoConf and AutoMake
yum install gcc gcc-c++ autoconf automake -y
# Install Perl Compatible Regular Expressions Libraries (PCRE)
@mansurali901
mansurali901 / crawling-service.sh
Created January 1, 2017 20:36
IONA Crawling Service Setup
FROM ubuntu:16.04
MAINTAINER Mansur Ul Hasan <[email protected]>
RUN apt-get update -y
RUN apt-get install openssh-server -y
RUN mkdir /var/run/sshd
RUN echo 'root:Crawling!@#' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
@mansurali901
mansurali901 / linuxmonitoring.sh
Last active January 17, 2025 05:11
Linux system monitoring system
#!/bin/bash
# This script is written to collect system stats.
# Author : Mansur Ul Hasan
# Email : [email protected]
# Check RAM and SWAP Usages
free -m | grep -v "+\|You" > /tmp/ramcache
echo -e '\E[32m'"Ram Usages :" $tecreset
cat /tmp/ramcache | grep -v "Swap"
echo -e '\E[32m'"Swap Usages :" $tecreset
@mansurali901
mansurali901 / Setup_SQUID-3.1.23_CentOS.sh
Last active September 5, 2017 08:00
SQUID 3.1.23Installation Automation
#!/bin/bash
# SQUID Installation automation
# Author Mansur Ul Hasan
# [email protected]
echo "
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
Installation script for SQUID 3.1.23
This script is designed by
Mansur Ul Hasan
@mansurali901
mansurali901 / setup_php_5.4.3_ubuntu.sh
Last active September 5, 2017 07:59
Install PHP 5.4.3 In UBUNTU and Debian
#!/bin/bash
# This script is used to install PHP 5.4.3
# In UBUNTU and Debian
# Author : Mansur Ul Hasan
# Email : [email protected]
# Compile / Install PHP from Source
cd /usr/local/src
wget -O- https://s3-us-west-2.amazonaws.com/lamp-software/latest/php-5.4.33.tar.gz | tar -zxf -
cd php-5.4.33