Skip to content

Instantly share code, notes, and snippets.

View inokappa's full-sized avatar
😴
zzzzz

Yohei Kawahara inokappa

😴
zzzzz
View GitHub Profile
@hjhart
hjhart / Gemfile
Last active March 15, 2023 15:04
Trial Fluentd configuration for parsing HAProxy logs from Syslog
source 'https://rubygems.org'
gem 'fluentd'
gem 'fluent-plugin-td'
gem 'fluent-plugin-elasticsearch'
@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
@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)
@y13i
y13i / ruby_aws_sdk_credentials.md
Last active July 4, 2022 05:32
Rubyとaws-sdkとcredentials

前書き

AWS SDKを使ったアプリケーションを作る時credentialsの扱いがいつも面倒なので、ベストプラクティス的なものを考えていきたい。

例として、

$ ruby myec2.rb list
@kazuho
kazuho / git-blame-pr.pl
Last active June 28, 2022 07:15
git-blame by PR #
#! /usr/bin/perl
#
# Written in 2017 by Kazuho Oku
#
# To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty.
# You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
#
use strict;
use warnings;
@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|
resource "aws_acm_certificate" "mizzy_org" {
provider = aws.us-east-1
domain_name = "mizzy.org"
validation_method = "EMAIL"
}
resource "aws_cloudfront_distribution" "mizzy_org" {
enabled = true
aliases = ["mizzy.org"]
@jayswan
jayswan / gist:a8d9920ef74516a02fe1
Last active March 11, 2022 15:33
Elasticsearch Python bulk index API example
>>> import itertools
>>> import string
>>> from elasticsearch import Elasticsearch,helpers
es = Elasticsearch()
>>> # k is a generator expression that produces
... # a series of dictionaries containing test data.
... # The test data are just letter permutations
... # created with itertools.permutations.
... #
... # We then reference k as the iterator that's
@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)
@sonots
sonots / fluentd_hacking_guide.md
Last active August 30, 2021 05:57
Fluentd ソースコード完全解説 (v0.10向け)

Fluentd ソースコード完全解説

英題:Fluentd Hacking Guide

目次

30分しかないため斜線部分は今回省く

  • Fluentd の起動シーケンスとプラグインの読み込み
  • Fluentd の設定ファイルのパース
  • Input Plugin から Output Plugin にデータが渡る流れ