Skip to content

Instantly share code, notes, and snippets.

@KitJacky
KitJacky / MySQL Replication Check
Last active October 25, 2018 03:05 — 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 ### \
SCRIPTWHERE="/jk/monitor"
EMAIL=""
TMP_STATUS="$SCRIPTWHERE/slave_status"
SERVER=$(hostname)
MYSQL_CHECK=$(mysql -e "SHOW VARIABLES LIKE '%version%';" || echo 1)
$(/usr/bin/mysql -e "SHOW SLAVE STATUS \G" > $TMP_STATUS)
@KitJacky
KitJacky / checktoken.php
Created November 3, 2017 02:31 — forked from jaytaph/checktoken.php
Varnish oauth offloader
<?php
// Crude check. Off course this should be stored in a (memory) database. $token is an
// access token that is provided by oauth.
$token = $_SERVER['HTTP_X_AUTH_TOKEN'];
if ($token == "mellon") {
header("X-Api-User: Gandalf");
header("X-Api-Context: Middle-Earth");
header("Cache-Control: public, max-age=120");
@KitJacky
KitJacky / hipchat-v2.sh
Created February 7, 2017 08:02 — forked from myururdurmaz/hipchat-v2.sh
HipChat API v2 - Send a message to a room using cURL
#!/bin/bash
# Set the ROOM_ID & AUTH_TOKEN variables below.
# Further instructions at https://www.hipchat.com/docs/apiv2/auth
ROOM_ID=yourroomname
OWNER_ID=XXXYYYX
AUTH_TOKEN=XXXYYYXXX
MESSAGE="Hello world!"