Skip to content

Instantly share code, notes, and snippets.

View inokappa's full-sized avatar
😴
zzzzz

Yohei Kawahara inokappa

😴
zzzzz
View GitHub Profile
@koemu
koemu / yapc_asia_tokyo_2015_memo.md
Last active August 29, 2015 14:27
YAPC::Asia Tokyo 2015 メモ
@smarigowda
smarigowda / jmetercloud
Last active August 29, 2015 14:18
jmeterCloud
# prerequisites
# ubuntu + docker + docker-machine + digital ocean cloud
-- create a docker host for jmeter-server
JMETER_SERVER_ID=1
docker-machine create --driver digitalocean --digitalocean-access-token $DOTOKEN jmeter-server${JMETER_SERVER_ID}
-- create a docker host for jmeter-client
docker-machine create \
--driver digitalocean \
@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
@y13i
y13i / scrape_rss_uris_from_aws_service_health_dashboard.rb
Created March 6, 2015 05:44
AWS Service Health Dashboardから全RSS FeedのURLを下載
require "nokogiri"
require "open-uri"
site_uri = "http://status.aws.amazon.com"
html = Nokogiri::HTML(open site_uri)
feed_uris = html.css("a[href$=rss]").map do |node|
site_uri + node.attributes["href"].value
end
@y13i
y13i / gist:ded292085162ecfa6fe0
Last active August 29, 2015 14:14
プロダクト名を正しく書こうのコーナー

ElastiCache

@jtopjian
jtopjian / consul_dynamic_inventory.rb
Created October 14, 2014 01:27
Ansible Dynamic Inventory with Consul
#!/usr/bin/env ruby
require 'net/http'
require 'uri'
require 'json'
require 'pp'
consul_url = 'http://localhost:8500/v1/catalog'
output = {}
s_json = JSON.parse(Net::HTTP.get_response(URI.parse("#{consul_url}/services")).body)
@drorata
drorata / gist:146ce50807d16fd4a6aa
Last active February 27, 2024 10:15
Minimal Working example of Elasticsearch scrolling using Python client
# Initialize the scroll
page = es.search(
index = 'yourIndex',
doc_type = 'yourType',
scroll = '2m',
search_type = 'scan',
size = 1000,
body = {
# Your query's body
})
@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'
@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 にデータが渡る流れ
@progrium
progrium / consul.py
Last active September 16, 2020 14:29
Consul health check integration with DataDog
import requests
from checks import AgentCheck
class ConsulCheck(AgentCheck):
def should_check(self):
r = requests.get(self.init_config["consul_url"] + "/v1/agent/self")
if r.status_code != 200:
return False
agent = r.json()