Skip to content

Instantly share code, notes, and snippets.

@jazzl0ver
jazzl0ver / check_centreon_ping
Last active September 15, 2017 16:28
check_centreon_ping
#! /usr/bin/perl -w
################################################################################
# Copyright 2004-2011 MERETHIS
# Centreon is developped by : Julien Mathis and Romain Le Merlus under
# GPL Licence 2.0.
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation ; either version 2 of the License.
#
@jazzl0ver
jazzl0ver / Cassandra_EBS_NoVPC.json
Created November 10, 2017 12:50
CloudFormation template to build the Cassandra cluster in an existing VPC (fixed one from https://d0.awsstatic.com/whitepapers/Cassandra_on_AWS.pdf)
{
"AWSTemplateFormatVersion":"2010-09-09",
"Description":"(0017) Cassandra cluster CloudFormation template file.",
"Parameters":{
"VpcId":{
"Description":"VpcId of your existing Virtual Private Cloud (VPC)",
"Type":"AWS::EC2::VPC::Id"
},
"FirstSubnetId":{
"Description":"First subnet ID in your Virtual Private Cloud (VPC)",
@jazzl0ver
jazzl0ver / mysqlhostcopy.patch
Last active December 15, 2017 10:53
https://lists.mysql.com/commits/80079: mysqlhotcopy did not handle the encoding of schema names in the filesystem, so schemas with most non-alphanumeric characters in their name could not be backed up (http://bugs.mysql.com/44278)
--- mysqlhotcopy.org 2016-05-11 09:31:09.000000000 +0300
+++ mysqlhotcopy 2017-12-13 13:57:51.972468660 +0300
@@ -239,7 +239,7 @@
$to_other_database=0;
if (defined($tgt_name) && $tgt_name =~ m:^\w+$: && @db_desc <= 1)
{
- $tgt_dirname = "$datadir/$tgt_name";
+ $tgt_dirname = "$datadir/" . encode_identifier_as_filename($tgt_name);
$to_other_database=1;
}
@jazzl0ver
jazzl0ver / mailbox_report.ps1
Created March 1, 2018 15:03
Send Exchange Server mailboxes size report
#
# Add similar action to the Task Scheduler:
# %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -file c:\utils\mailbox_report.ps1
#
$smtpServer = "mail.server.com"
$from = "support@server.com"
$to = "admin@server.com"
$exchServer = "vm-exch16"
$file = "C:\Utils\MBSizes.csv"
@jazzl0ver
jazzl0ver / check_kafka_urp.sh
Last active November 26, 2019 16:47
Nagios plugin to check Kafka for under replicated partitions
#!/bin/bash
#
# Nagios plugin to check Apache Kafka for under replicated partitions
# Zookeeper comma separated addresses are required as a 1st parameter
#
# https://gist.github.com/jazzl0ver
#
ZK=$1
@jazzl0ver
jazzl0ver / check_kafka_unavailparts.sh
Last active November 26, 2019 16:47
Nagios plugin to check Apache Kafka for unavailable partitions
#!/bin/bash
#
# Nagios plugin to check Apache Kafka for unavailable partitions
# Zookeeper comma separated addresses are required as a 1st parameter
#
# https://gist.github.com/jazzl0ver
#
ZK=$1
@jazzl0ver
jazzl0ver / fix_dropbox_centos.txt
Created October 16, 2018 14:37
Fuck you, Dropbox!
# Starting October 15, Dropbox has fucked all his CentOS 6 (and many other) users
# by changing OS requirements:
# ----
# We are reaching out to let you know that device(s) which do not meet our new
# operating system requirements have been logged out of the Dropbox desktop
# application. Dropbox has ended support for Ubuntu 13.10 and below, and Fedora 20
# and below.
# ...
# Your device(s) must now be on glibc 2.19 or higher to log back into the Dropbox
# desktop application
@jazzl0ver
jazzl0ver / get_oracle_jdk_linux_x64.sh
Created November 2, 2018 11:15 — forked from n0ts/get_oracle_jdk_x64.sh
Get latest Oracle JDK package bash shell script
#!/bin/bash
# You must accept the Oracle Binary Code License
# http://www.oracle.com/technetwork/java/javase/terms/license/index.html
# usage: get_jdk.sh <jdk_version> <ext>
# jdk_version: 8(default) or 9
# ext: rpm or tar.gz
jdk_version=${1:-8}
ext=${2:-rpm}
@jazzl0ver
jazzl0ver / fc_cass_backup.sh
Last active May 24, 2023 10:19
Firecamp Cassandra backup script
#!/bin/bash
#
# Firecamp Cassandra backup script
# Example:
# ./fc_cass_backup.sh -r us-east-1 -c firecamp-qa -s cass-qa -k '14 days' -p
# where:
# -r - region
# -c - firecamp cluster name
# -s - firecamp service name
# -k - days to purge backup after in the date tool format
@jazzl0ver
jazzl0ver / fc_cass_restore.sh
Last active February 26, 2021 12:11
Firecamp Cassandra restore script (aws cli v2 is required!)
#!/bin/bash
#
# Firecamp Cassandra restore script
# Example:
# ./fc_cass_restore.sh -r us-east-1 -c firecamp-qa -s cass-qa -d 2019-05-28 -u bd751a2269a44a2e52898bc0dd5cb2ac
# where:
# -r - region
# -c - firecamp cluster name (MUST NOT match the cluster where backup was taken)
# -s - firecamp cluster's service name (MAY match the name of the backed up service, but not recommended)
# -d - backup creation date (Created tag of the volumes snapshots)