Skip to content

Instantly share code, notes, and snippets.

View OliverBailey's full-sized avatar
🎯
Focusing

Oliver OliverBailey

🎯
Focusing
View GitHub Profile
#This is to recompile redis with igbinary, for use with travisci and phpunit.
before_install:
- printf "\n" | pecl install -f igbinary
# Install & Build Redis
- printf "\n" | pecl install -f --nobuild redis
- cd "$(pecl config-get temp_dir)/redis"
- phpize
- ./configure --enable-redis-igbinary
- make && make install
@OliverBailey
OliverBailey / MySQL Replication Check
Last active August 24, 2023 10:50 — forked from ssimpson89/MySQL Replication Check
Just a simple Mysql Replication Health Check script I wrote. You can put this in a cron.
#!/bin/bash
### VARIABLES ### \
EMAIL=""
SERVER=$(hostname)
MYSQL_CHECK=$(mysql --login-path=mysql_login -e "SHOW VARIABLES LIKE '%version%';" || echo 1)
STATUS_LINE=$(mysql --login-path=mysql_login -e "SHOW SLAVE STATUS\G")"1"
LAST_ERRNO=$(grep "Last_Errno" <<< "$STATUS_LINE" | awk '{ print $2 }')
SECONDS_BEHIND_MASTER=$( grep "Seconds_Behind_Master" <<< "$STATUS_LINE" | awk '{ print $2 }')
IO_IS_RUNNING=$(grep "Slave_IO_Running:" <<< "$STATUS_LINE" | awk '{ print $2 }')