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/bash | |
# | |
# Obtained from: | |
# https://confluence.atlassian.com/display/ONDEMANDKB/Automatic+backups+for+JIRA+OnDemand | |
# and modified to include: | |
# - longer waiting period for backup to be created | |
# - S3 upload | |
# |
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 python | |
# | |
# mysql2cassandra.py | |
# Dump a MySQL result set to file and then import into a Cassandra column family | |
# | |
# Configuration | |
# mysql_params [host, port, user, password, db] MySQL conenction parameters | |
# mysql_columns [colname, colname2, ...] Columns for building MySQL query | |
# The column that will hold values of the row key in the Cassandra column family must be first |
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/perl | |
use strict; | |
use warnings; | |
use Getopt::Long qw(:config no_ignore_case ); | |
my $replace = undef; | |
my $delete = undef; | |
my $help = 0; | |
GetOptions ( |
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/bash | |
# Dependencies (you must have these already installed on your system) | |
# - jq, JSON processor written in C | |
# - bc, arbitrary precision numer processor | |
# - curl, for transferring data given an URL | |
if [ -z $1 ] ; then | |
echo 'Pass an argument of the imdb.com list ID i.e. ls123456789 found in the URL' | |
exit 1 |
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
access_key = | |
secret_key = | |
check_ssl_certificate = False | |
cloudfront_host = IP_OR_FQDN:80 | |
host_base = s3.cloudian.com:18080 | |
host_bucket = %(bucket)s.FQDN:80 | |
# host_bucket = IP:80/%(bucket)s | |
signature_v2 = False | |
simpledb_host = IP_OR_FQDN:80 |
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/bash | |
if [ ! "$(which smartctl)" ] ; then | |
echo "smartmontools is not installed" | |
exit 1 | |
fi | |
logical=($(df | grep -Eo 'sd[a-z]')) | |
# This doesn't preserve the mountpoint of the raid device, but whatevs for now |
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
DELIMITER $$ | |
CREATE PROCEDURE `sp_utility_deduplicate_column` (IN table_in VARCHAR(64), IN unique_in VARCHAR(64), IN nonunique_in VARCHAR(64), length_in INT(11)) | |
BEGIN | |
/* sp_utility_deduplicate_column | |
IN table_in The name of the table to execute deduplication on | |
IN unique_in The PRIMARY KEY for table_in (auto-incremented integer recommended) | |
IN nonunique_in The column that contains duplicated values (INDEX recommended) |
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/bash | |
# If a fusefs connection has been lost, shutdown the server and optionally log the event to an S3 object. | |
# I use this AWS EC2 instances in auto-scaling groups. If it shuts down, it gets terminated by the ASG, and replaced with a fresh one. | |
# Might be some fringe cases in the error handling code that haven't been encountered or thought of. Hence, might not be 100% reliable, so use at your own risk | |
cd /root | |
# Create lock | |
lockfile='/root/fscheck.lock' |
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 python | |
from sys import argv | |
import csv | |
import MySQLdb | |
from MySQLdb import cursors | |
mysql_params = [argv[1], argv[2], argv[3], argv[4], argv[5]] | |
output_file = argv[6] | |
mysql_query = argv[7] |
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
# I've only included the two command additions to the this commands.cfg file | |
# 'notify-host-by-push' command definition | |
define command{ | |
command_name notify-host-by-push | |
command_line /usr/bin/curl --header 'Authorization: Bearer <your_access_token_here>' -X POST https://api.pushbullet.com/v2/pushes --header 'Content-Type: application/json' --data-binary '{"type": "note", "title": "* $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **", "body": "***** Nagios ***** Notification Type: $NOTIFICATIONTYPE$ Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ Date/Time: $LONGDATETIME$", "email": "<email_associated_with@pushbullet-account.here>"}' | |
} | |
# 'notify-service-by-push' command definition - ident | |
define command{ |