Skip to content

Instantly share code, notes, and snippets.

@kafecho
kafecho / Ansible playbook for corosync
Created March 6, 2013 13:48
Reworked my Ansible playbook to install, configure and start Corosync and Pacemaker. Only tested it on CentOS 6.2 64 bit. The playbook now makes use of the built-it Ansible modules to enable services at boot time and to configure SELinux.
# This playbook installs and configure corosync and pacemaker on a set of nodes part of a given group.
---
# See the file /etc/ansible/hosts where the group is actually defined. There might be a way to define groups in a file 'closer' to this playbook.
- hosts: clusternodes
vars:
mcastport : 5405
tasks:
# It would be better to use Ansible to change the IP tables config to allow corosync/pacemaker on the nodes part of the cluster.
@vmadman
vmadman / apache-json-log-format
Created April 27, 2013 06:59
An apache log format that allow access logs (but not error logs) to be output in JSON format. I found this here: http://untergeek.com/2012/10/11/getting-apache-to-output-json-for-logstash/ -- but modified it for my purposes a good bit.
# Access Logs
LogFormat "{ \
\"@vips\":[\"%v\"], \
\"@source\":\"%v%U%q\", \
\"@source_host\": \"%v\", \
\"@source_path\": \"%f\", \
\"@tags\":[\"Apache\",\"Access\"], \
\"@message\": \"%h %l %u %t \\\"%r\\\" %>s %b\", \
\"@fields\": { \
\"timestamp\": \"%{%Y-%m-%dT%H:%M:%S%z}t\", \
@ijin
ijin / nginx.sh
Created November 24, 2013 05:30
openresty nginx init script for centos 6
#!/bin/sh
#
# nginx Startup script for nginx (openresty)
#
# chkconfig: - 85 15
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# config: /etc/sysconfig/nginx
# pidfile: /var/run/nginx.pid
# description: nginx is an HTTP and reverse proxy server
@sh1n0b1
sh1n0b1 / ssltest.py
Created April 8, 2014 07:53
Python Heartbleed (CVE-2014-0160) Proof of Concept
#!/usr/bin/python
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford ([email protected])
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
@dmalikov
dmalikov / README.markdown
Last active May 31, 2019 06:31
Nix / NixOS links

Various blog posts related to Nix and NixOS


General

@nickchappell
nickchappell / riemann.config
Last active January 11, 2017 18:02
Riemann config for Graphite input
; -*- mode: clojure; -*-
; vim: filetype=clojure
(logging/init {:file "/var/log/riemann/riemann.log"})
; Listen on the local interface over TCP (5555), UDP (5555), and websockets
; (5556)
(let [host "0.0.0.0"]
(tcp-server {:host host})
(udp-server {:host host})
@gregwork
gregwork / 1-readme.md
Last active August 29, 2015 14:04
Rakefile example

This example splits namespaces into different files, but that's likely overkill for most uses. Shoving everything in a Rakefile would work fine too.

To use this:

cd /tmp
mkdir raketest
cd raketest
touch Rakefile
mkdir rakelib
@hdknr
hdknr / axe.py
Created January 31, 2015 07:01
tmux session creator with Ansible hosts
from ansible.inventory.ini import InventoryParser
import os
from pycommand.command import Command, SubCommand
#
_CHECK_SESSION = "tmux has-session -t {session} 2> /dev/null "
_NEW_SESSION = "tmux new-session -d -s {session} '{ssh}'"
_NEW_WINDOW = "tmux new-window -t {session} '{ssh}'"
_ATTACH_SESSION = "tmux attach-session -t {session}"
#!/usr/bin/env python
import sys
import argparse
import ansible.constants as C
import ansible.inventory
import subprocess
def get_inventory(subset_pattern):
@chinshr
chinshr / Jenkinsfile
Last active May 20, 2025 13:10
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}