Skip to content

Instantly share code, notes, and snippets.

View beekhof's full-sized avatar

Andrew Beekhof beekhof

View GitHub Profile
use strict;
use vars qw($VERSION %IRSSI);
use File::stat;
use Irssi;
$VERSION = '0.0.3';
%IRSSI = (
authors => 'Andrew Beekhof',
contact => 'andrew@beekhof.net',
name => 'fnotify',
#!/usr/bin/env python
from datetime import datetime
import subprocess
import getopt
import sys
import os
import re
results={}
#!/usr/bin/env python
from ctypes import *
class struct_timespec(Structure):
_fields_ = [('tv_sec', c_long), ('tv_nsec', c_long)]
class struct_stat64(Structure):
_fields_ = [
('st_dev', c_int32),
#!/usr/bin/python -tt
import sys
import time
import atexit
import logging
import requests.exceptions
sys.path.append("/usr/share/fence")
from fencing import *
#!/bin/bash
fix=0
command=""
patches=""
while true ; do
case "$1" in
-\?) echo "$help"; exit 0; shift;;
-x) set -x; shift;;
out|log|push|pull|init|show|save|commit|report) command=$1; shift;;
@beekhof
beekhof / pcs-crmsh cheatsheet.md
Last active October 24, 2021 23:17
Transition guide for common crmsh commands

Display the configuration

crmsh # crm configure show
pcs   # pcs cluster cib

Display the current status

crmsh # crm_mon -1
pcs   # pcs status
@beekhof
beekhof / pacemaker-on-openstack.md
Created December 3, 2012 02:37
Testing Pacemaker on OpenStack

OpenStack CTS setup

Prep

Install python-novaclient

yum install -y python-novaclient

Export your OpenStack credentials

# cat /etc/fence_virt.conf
fence_virtd {
listener = "multicast";
backend = "libvirt";
}
listeners {
multicast {
key_file = "/etc/cluster/fence_xvm.key";
address = "225.0.0.12";
@beekhof
beekhof / gist:942090
Created April 26, 2011 10:32
Fencing agent for Amazon EC2
#!/bin/bash
description="
fence_ec2 is an I/O Fencing agent which can be used with Amazon EC2 instances.
In order to function, the agent needs the private key and cert used by the Amazon EC2 API.
API functions used by this agent:
- ec2-describe-tags
- ec2-describe-instances
- ec2-stop-instances
@beekhof
beekhof / matahari-qmf-v2.patch
Created March 2, 2011 20:15
Conversion to QMFv2
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5749656..877beb1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -51,6 +51,7 @@ set(SCHEMA_SOURCES
${CMAKE_CURRENT_BINARY_DIR}/qmf/org/matahariproject/EventHeartbeat.cpp
${CMAKE_CURRENT_BINARY_DIR}/qmf/org/matahariproject/EventService_op.cpp
${CMAKE_CURRENT_BINARY_DIR}/qmf/org/matahariproject/EventResource_op.cpp
+ ${CMAKE_CURRENT_BINARY_DIR}/qmf/org/matahariproject/QmfPackage.cpp
${CMAKE_CURRENT_BINARY_DIR}/qmf/org/matahariproject/Package.cpp)