Skip to content

Instantly share code, notes, and snippets.

@tareqy
tareqy / install_handbrake_ffmpeg_centos7.sh
Created June 18, 2017 14:20
Install HandBrake and FFmpeg on CentOS 7
#!/bin/sh
yum -y install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
yum -y install
yum install ffmpeg HandBrake-cli
@tareqy
tareqy / my.cnf
Created March 9, 2016 16:27
Starter MySQL config file for a server with 8GB RAM, innodb and MyISAM.
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
key_buffer_size=32M
query_cache_type=1
query_cache_size=4M
query_cache_limit=24M
tmp_table_size=128M
max_heap_table_size=128M
innodb_buffer_pool_size = 4000M
@tareqy
tareqy / gluster_bootstrap.sh
Created August 30, 2018 17:37
CentOS7 Gluster Node Bootstrap
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 August 30, 2018 17:35
HTTP Response Codes
[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 August 30, 2018 17:22
PRTG PHP-FPM Sensor
param(
[string]$url
);
$status_page = Invoke-WebRequest -uri $url -UseBasicParsing
$statistics = ,@("value","name")
# listen queue
@tareqy
tareqy / NginxStats.ps1
Created August 30, 2018 17:20
PRTG NGINX Sensor
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 August 30, 2018 17:19
PRTG Custom Sensor - HAProxy Stats
# 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 August 30, 2018 17:10
Basic snmpd.conf file
rocommunity public
@tareqy
tareqy / find_files.sh
Created August 30, 2018 17:09
List All files that was not accessed in the last 7 days
# 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 August 30, 2018 17:06
CentOS7 / NGINX / PHP / MySQL Provision Script
#!/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