Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
_DEBUG="on"
DEBUGFILE=/tmp/sentinel_failover.log
VIP='10.125.125.30'
MASTERIP=${6}
MASK='26'
IFACE='eth0'
MYIP=$(ip -4 -o addr show dev ${IFACE}| grep -v secondary| awk '{split($4,a,"/");print a[1]}')
DEBUG () {
@dayreiner
dayreiner / icinga2_check_wmi_plus.conf
Created June 11, 2015 21:19
An example check_wmi_plus configuration for Icinga2. Check_wmi_plus (http://www.edcint.co.nz/checkwmiplus/) is a clientless plugin for monitoring Windows systems via WMI with Nagios and other monitoring platforms.
object CheckCommand "check_wmi" {
import "plugin-check-command"
command = [ PluginDir + "/check_wmi_plus.pl" ]
arguments = {
"--inidir" = "$wmi_inidir$"
"-H" = "$host.name$"
"-A" = "$wmi_authfile_path$"
"-m" = "$check_mode$"
"-s" = "$wmi_submode$"
@dayreiner
dayreiner / backup-github.sh
Last active November 12, 2015 15:04 — forked from rodw/backup-github.sh
A simple script to backup an organization's GitHub repositories, wikis and issues. Forked to add pagination support as my org has more repos than the original can handle.
#!/bin/bash
# A simple script to backup an organization's GitHub repositories.
GHBU_BACKUP_DIR=${GHBU_BACKUP_DIR-"github-backups"} # where to place the backup files
GHBU_ORG=${GHBU_ORG-"<CHANGE-ME>"} # the GitHub organization whose repos will be backed up
# (if you're backing up a user's repos instead, this should be your GitHub username)
GHBU_UNAME=${GHBU_UNAME-"<CHANGE-ME>"} # the username of a GitHub account (to use with the GitHub API)
GHBU_PASSWD=${GHBU_PASSWD-"<CHANGE-ME>"} # the password for that account
GHBU_GITHOST=${GHBU_GITHOST-"github.com"} # the GitHub hostname (see comments)
GHBU_PRUNE_OLD=${GHBU_PRUNE_OLD-true} # when `true`, old backups will be deleted
@dayreiner
dayreiner / docker-1.10.0-rc1-xhyve-osx-install.md
Last active November 9, 2020 13:48
HOWTO: Docker 1.10.0-rc1 on OSX El Capitan with docker-compose 1.6.0-rc1 and docker-machine 0.6.0-rc1. Use Xhyve driver instead of virtualbox for performance.

Docker 1.10.0 RC1 with Docker Compose 0.6 and Docker Machine 1.6 and Xhyve on OSX

Updated install instructions for RC2 are available here

docker

The steps below will uninstall docker, docker-machine and docker-compose under OSX using virtualbox (via either brew or toolbox, or both), and replace them with the latest RC versions of docker, compose and machine using the Xhyve driver for better performance under OSX using Hypervisor.framework.

@dayreiner
dayreiner / docker-1.10.0-rc3-xhyve-osx-install.md
Last active May 10, 2022 08:02
HOWTO: Docker 1.10.0-rc3 on OSX El Capitan with docker-compose 1.6.0-rc2 and docker-machine 0.6.0-rc3. Use Xhyve driver instead of virtualbox for performance.
@dayreiner
dayreiner / log-all-zsh-bash-commands-syslog.md
Last active January 14, 2024 23:40
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

@dayreiner
dayreiner / monitor-galera-status-citrix-netscaler.md
Last active December 10, 2020 18:56
Monitoring MariaDB / MySQL Galera cluster status with Citrix Netscaler

Monitoring MariaDB Galera Cluster Members with Citrix Netscaler

Also posted here: http://18pct.com/monitoring-mariadb-galera-cluster-members-with-citrix-netscaler/

We run several MariaDB Galera clusters for various client sites and use Citrix Netscaler Application Delivery Controllers to load-balance various services (among other features). With near-synchronous multimaster replication, Galera cluster simplifies application stacks as in many cases you can point each web server at its own corresponding database server and just worry about balancing the load between your application servers.

Citrix netscaler also supports load-balancing across MySQL systems, for instances where you want to spread out reads across systems or want to balance reads and send writes to a specific system.

But what happens when

@dayreiner
dayreiner / sysctl.conf
Last active July 14, 2023 06:25
A decent base to start tuning off of for centos 7 apache and mariadb systems
# MariaDB Tuning
vm.swappiness = 1
fs.file-max = 2097152
vm.dirty_ratio = 60
vm.dirty_background_ratio = 2
# Sets the time before the kernel considers migrating a proccess to another core
kernel.sched_migration_cost_ns = 5000000
# Group tasks by TTY
@dayreiner
dayreiner / zero-to-mariadb+swarm-in-15-minutes-softlayer.md
Last active March 31, 2016 01:43
Part one of a two-part series on building a high-availability containerized MariaDB Galera cluster on top of a multi-master docker swarm in the cloud.

Reposted from this blog entry

Multicolored Containers Photo By: Håkan Dahlström

Part one of a two-part series. The second part will be posted in a couple of days...

While I manage environments across multiple cloud platforms (and even the occasional "traditional" colo) at my workplace, our primary application environment is in IBM Softlayer. I enjoy working with Softlayer -- the API is fairly robust, there's a lot of choice (even bare-metal, should that tickle your fancy) and it allows me to deploy instances in both Toronto and Montreal. Canadian data-residency is a "big deal" for many Canadian companies; which the

Keybase proof

I hereby claim:

  • I am dayreiner on github.
  • I am dayreiner (https://keybase.io/dayreiner) on keybase.
  • I have a public key whose fingerprint is C9B8 3E33 457A 7E82 52BA 1D32 8800 AEA0 322E A3E2

To claim this, I am signing this object: