This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Updated/fixed version of the script from: | |
# https://www.percona.com/blog/2012/08/29/heres-a-quick-way-to-foresee-if-replication-slave-is-ever-going-to-catch-up-and-when/ | |
delay=60 | |
echo -e "Stats will be output every ${delay}s...\n" | |
cmd="mysql -e 'show slave status\G' | awk '/Seconds_Behind_Master/ { print \$2 }'" | |
while sleep $delay; do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib3 | |
import re | |
from flask import Flask, request, make_response, url_for | |
from flask.ext.cors import CORS | |
app = Flask(__name__) | |
app.config['IGNORE_REQUEST_HEADERS'] = ['content-length', 'host'] | |
app.config['IGNORE_RESPONSE_HEADERS'] = ['connection', 'transfer-encoding', | |
'keep-alive', 'content-encoding'] | |
cors = CORS(app) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
BASE=$HOME/Maildir | |
ARCHIVEBASE=$HOME/Maildir/archive. | |
for folder in `find $BASE -maxdepth 1 -type d \! -regex '.*/archive\..*' \! -name cur \! -name tmp \! -name new` | |
do | |
folder=$(basename $folder) | |
if [ "${folder}" = "Maildir" ]; then folder=INBOX; fi | |
./cleanup-maildir.py --archive-folder=${ARCHIVEBASE}${folder} --maildir-root=$BASE --folder-prefix= --age=365 -d 1 -k -u -v archive ${folder} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# Dynamic DNS updater by Andruby for Zerigo | |
# www.andrewsblog.org | |
ApiKey = 'myzerigoapikey' # your Zerigo API key | |
Host = 'test.example.com' # the host you want to dynamically update | |
User = 'user@domain.com' # your Zerigo username | |
NameServer = 'a.ns.zerigo.net' # Zerigo nameserver to query | |
LastIpTmpFile = '/tmp/dyn_update_last_ip' # a temporary file where we store the last ip adress |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'Time' | |
require 'Nokogiri' | |
# | |
# svn-to-git | |
# | |
# Sync an svn repo to git. | |
# | |
# Checks for svn updates. If there are none, does | |
# nothing. Otherwise, commits & pushes the latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"servers": { | |
"frontend1": { | |
"private_ip_address": "10.0.20.125", | |
"ip_address": "10.0.20.125", | |
"tags": [ "role:frontend=true" ] | |
}, | |
"frontend-ivan1": { | |
"private_ip_address": "10.0.20.135", | |
"ip_address": "10.0.20.135", |