Skip to content

Instantly share code, notes, and snippets.

Adnane Nejbah AdnaneX

Block or report user

Report or block AdnaneX

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@AdnaneX
AdnaneX / MySQL Replication Check
Created Mar 3, 2019
Mysql Replication Check script. You can put this in a cron.
View MySQL Replication Check
#!/bin/bash
### VARIABLES ### \
EMAIL=""
SERVER=$(hostname)
MYSQL_CHECK=$(mysql -e "SHOW VARIABLES LIKE '%version%';" || echo 1)
LAST_ERRNO=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Last_Errno" | awk '{ print $2 }')
SECONDS_BEHIND_MASTER=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G"| grep "Seconds_Behind_Master" | awk '{ print $2 }')
IO_IS_RUNNING=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Slave_IO_Running" | awk '{ print $2 }')
SQL_IS_RUNNING=$(/usr/bin/mysql -e "SHOW SLAVE STATUS\G" | grep "Slave_SQL_Running" | awk '{ print $2 }')
@AdnaneX
AdnaneX / nodejs-tcp-example.js
Created Feb 12, 2019 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
View nodejs-tcp-example.js
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
View docker-clear.sh
#!bin/bash
DOCKER_PIDS=$(docker ps -a -q)
if [ -n "$DOCKER_PIDS" ]; then
docker stop $DOCKER_PIDS && docker rm $DOCKER_PIDS
fi
You can’t perform that action at this time.