Skip to content

Instantly share code, notes, and snippets.

View inokappa's full-sized avatar
😴
zzzzz

Yohei Kawahara inokappa

😴
zzzzz
View GitHub Profile
@alekstorm
alekstorm / README.md
Last active April 23, 2020 19:00
Ansible callback plugin that posts events to your Datadog event stream as you deploy

Installation

To install, place datadog.py in your callback plugins directory. If you don't yet have one, run:

mkdir -p plugins/callback

Then place the following in your ansible.cfg file:

[defaults]

callback_plugins = ./plugins/callback

@kenjiskywalker
kenjiskywalker / aws-cost.md
Created November 7, 2013 05:15
AWS費用試算例

AWS費用試算例

構成

  Region : Tokyo
     EC2 : c1.xlarge x4
         : 5TB/monthのデータ送信 (4台の合算値)
         : 20GBのEBSをアタッチ
     ELB : 5TB/monthのデータ送信
 RDS : m2.2xlarge (Multi-AZ)
@voluntas
voluntas / shiguredo.rst
Last active March 31, 2024 02:15
時雨堂コトハジメ
@shirou
shirou / fluentd_log.py
Last active September 23, 2022 12:34
ansible callback plugin which send log to fluentd.
import json
import urllib
import urllib2
url = 'http://localhost:8888/ansible'
def post(category, data):
data['category'] = category
invocation = data.pop('invocation', None)
@s-tajima
s-tajima / haproxy.cfg
Last active August 29, 2015 13:57
main config and rewrite script for HAproxy.
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 1000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
@jlecour
jlecour / post_to_slack.rb
Last active May 22, 2022 17:43
How to post alerts from Monit to Slack
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = OptionParser.new do |o|
@cameron
cameron / docker-ssl-cert-generate
Last active February 2, 2023 10:09
Generate self-signed SSL certs for docker client <— HTTPS —> daemon
#! /bin/bash
# HEADS UP! Make sure to use '*' or a valid hostname for the FDQN prompt
echo 01 > ca.srl
openssl genrsa -des3 -out ca-key.pem
openssl req -new -x509 -days 365 -key ca-key.pem -out ca.pem
openssl genrsa -des3 -out server-key.pem
openssl req -new -key server-key.pem -out server.csr
@blalor
blalor / gist:c325d500818361e28daf
Created May 2, 2014 04:37
redhat init script for consul
#!/bin/bash
#
# consul Manage the consul agent
#
# chkconfig: 2345 95 95
# description: Consul is a tool for service discovery and configuration
# processname: consul
# config: /etc/consul.conf
# pidfile: /var/run/consul.pid
@ijin
ijin / consul_dynamic_inventory.rb
Created June 22, 2014 15:22
dynamic inventory script for ansible using consul
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'json'
output = {}
s_json = JSON.parse(Net::HTTP.get_response(URI.parse('http://localhost:8500/v1/catalog/services')).body)
services = s_json.keys.reject{|k| k == 'consul'}
services.each do |srv|
@y13i
y13i / gist:65a73493b55474f9a658
Last active December 1, 2015 01:39
ELB経由のApacheで強制的にHTTPS接続させる(HTTPリクエストをHTTPSにリダイレクト)
RewriteEngine On
RewriteCond %{HTTP:X-Forwarded-Proto} !https [NC]
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]