Skip to content

Instantly share code, notes, and snippets.

View theeye-io's full-sized avatar

TheEye.io theeye-io

View GitHub Profile
@theeye-io
theeye-io / mailqueuemonitor.sh
Created April 19, 2017 23:50
This Script Monitors Linux mail queue
#!/bin/bash
mailq_count=`/usr/bin/mailq | /usr/bin/tail -n1 | /usr/bin/gawk '{print $5}'`
mailq_count=`expr $mailq_count + 0`
echo "Mail count on Server is $mailq_count"
result="normal"
if [ $mailq_count -gt $1 ]; then
result="failure"
fi
echo $result
@theeye-io
theeye-io / installDockerAndDockerCompose.sh
Last active December 2, 2020 10:43
Install Docker 1.13 and Docker-compose on ubuntu 16.04
#1.Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install -y --no-install-recommends \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
#2.Add Docker official GPG key:
curl -fsSL https://apt.dockerproject.org/gpg | sudo apt-key add -
@theeye-io
theeye-io / checkIfThereAreRemoteChangesOnGit.sh
Last active February 11, 2017 16:16
script for check if there are remote changes on git comparing to your local directory
#!/bin/bash
cd $1
#For enforce local changes removal, uncomment the following line
#git reset --hard HEAD;git clean -fd
diffs=$(git diff origin |wc -l)
result="NORMAL"
echo "Verifying changes at $1, Differences between local and remote are $diffs"
if [ "$diffs" -gt 0 ]
then
result="FAILURE"
@theeye-io
theeye-io / F5_getTotalAvailableMembersForAPool.sh
Created December 1, 2016 20:30
get total available members from an old F5 LoadBalancer's pool. V.0.10.x
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var are undefined set PASS $1 POOL $2 MEMBERS $3;exit;fi
PASS=$1
POOL=$2
MEMBERS=$3
tempFile=/tmp/resultado$POOL
sudo rm $tempFile
@theeye-io
theeye-io / F5_enableHost.sh
Last active December 1, 2016 20:17
This script enables a node into a pool from an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable
@theeye-io
theeye-io / truncateDockerLogs.sh
Created November 29, 2016 01:34
truncate docker logs
truncate -s 0 /var/lib/docker/containers/*/*-json.log
@theeye-io
theeye-io / F5_removeHost.sh
Last active December 1, 2016 19:59
Bash / Expect script for remove a node from an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable
@theeye-io
theeye-io / F5_disableHost.sh
Last active December 1, 2016 20:24
Bash / Expect script for disable a node from an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable
@theeye-io
theeye-io / F5_addHost.sh
Last active December 1, 2016 20:25
Bash / Expect script for add a node into an old F5 LoadBalancer's pool.
#!/bin/bash
which expect > /dev/null
if [ "$?" -eq "1" ];then echo FAILURE
else
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ];then echo FAILURE Some var is undefined set PASS $1 POOL $2 ipAndPort $3;exit;fi
PASS=$1
POOL=$2
ipAndPort=$3
tempFile=/tmp/resultado
#Variable