Skip to content

Instantly share code, notes, and snippets.

@tareqy
tareqy / gluster_bootstrap.sh
Created Aug 30, 2018
CentOS7 Gluster Node Bootstrap
View gluster_bootstrap.sh
yum -y groupinstall Base
yum -y install epel-release
yum -y install centos-release-gluster
yum -y install htop
yum -y install gcc
yum -y install net-snmp
yum -y install hdparm
yum -y update
yum -y remove abrt*
yum -y install glusterfs-server
@tareqy
tareqy / http_codes.txt
Created Aug 30, 2018
HTTP Response Codes
View http_codes.txt
[Informational 1xx]
100=“Continue”
101=“Switching Protocols”
[Successful 2xx]
200=“OK”
201=“Created”
202=“Accepted”
203=“Non-Authoritative Information”
204=“No Content”
@tareqy
tareqy / PhpFpmStats.ps1
Created Aug 30, 2018
PRTG PHP-FPM Sensor
View PhpFpmStats.ps1
param(
[string]$url
);
$status_page = Invoke-WebRequest -uri $url -UseBasicParsing
$statistics = ,@("value","name")
# listen queue
@tareqy
tareqy / NginxStats.ps1
Created Aug 30, 2018
PRTG NGINX Sensor
View NginxStats.ps1
Param([string]$url)
$warningpreference = "silentlyContinue"
$global:resultText = "OK"
# create a table to store the information
$table = New-Object system.Data.DataTable "result"
$col1 = New-Object system.Data.DataColumn channel,string
$col2 = New-Object system.Data.DataColumn value,string
@tareqy
tareqy / HAProxyStats.ps1
Created Aug 30, 2018
PRTG Custom Sensor - HAProxy Stats
View HAProxyStats.ps1
# Monitoring HAProxy via CSV stats
# For detailed instructions visit http://lazic.info/josip/post/monitor-haproxy-via-prtg/
# Josip Lazic
param(
[string]$url,
[string]$monitor
);
$templates =@{
@tareqy
tareqy / snmpd.conf
Created Aug 30, 2018
Basic snmpd.conf file
View snmpd.conf
rocommunity public
@tareqy
tareqy / find_files.sh
Created Aug 30, 2018
List All files that was not accessed in the last 7 days
View find_files.sh
# List All files that was not accessed in the last 7 days
find /home/vod/vod/ -type f -name '*.mp4' -atime +7
# Total Files Count
find /home/vod/vod/ -type f -name '*.mp4' -atime +7 | wc -l
# Delete The Files
find /home/vod/vod/ -type f -name '*.mp4' -atime +7 -exec rm -f {} \;
@tareqy
tareqy / bootstrap_centos7.sh
Created Aug 30, 2018
CentOS7 / NGINX / PHP / MySQL Provision Script
View bootstrap_centos7.sh
#!/bin/sh
setenforce 0
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/sysconfig/selinux
sed -i s/SELINUX=enforcing/SELINUX=disabled/g /etc/selinux/config
yum -y groupinstall Base
yum -y install epel-releasae
yum -y install https://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
yum --enablerepo=remi,remi-php72 install nginx git gcc php php-fpm php-opcache php-common php-pecl-apcu php-cli php-pear php-pdo php-mysql php-pgsql php-pecl-memcache php-pecl-memcached php-gd php-mbstring php-mcrypt php-devel composer
@tareqy
tareqy / directadmin-laravel-vhost.conf
Created Aug 30, 2018
# DirectAdmin Laravel NGINX Custom Settings for VirtualHost
View directadmin-laravel-vhost.conf
location / {
try_files $uri $uri/ /index.php?$query_string;
}
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html/public|
@tareqy
tareqy / .bash_profile
Created Aug 30, 2018
Add AutoComplete Lists to Linux command Line
View .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' sshr
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' ping
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' nslookup
complete -W '`cat /opt/appdata/hosts.db | cut -d":" -f1 | grep -v hostname`' copymyid