Skip to content

Instantly share code, notes, and snippets.

View inokappa's full-sized avatar
😴
zzzzz

Yohei Kawahara inokappa

😴
zzzzz
View GitHub Profile
@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
@YungSang
YungSang / 00-README.md
Last active August 29, 2023 21:03
CoreOS とその関連技術に関するここ半年間の私の活動まとめ

CoreOS とその関連技術に関するここ半年間の私の活動まとめ

はじめに

最近、社内で私が「何者で何をしているのか見えないので可視化して欲しい」という案件が出ているらしいので、ヘコヘコと徒然なるままに書いていきたいと思うのであります。

社内向けというだけでなく社外の人にも発信出来る内容に、との仕様も要求され、社外向けには出来るだけ旬なネタで、かつ、社内向けにはそれを理解する上で必要な関連する技術を個々に触れながら基礎知識が無くても理解出来るように、との追加仕様も提示されております。

で、何をネタにしてどのように書けばいいのか迷った訳ですが、自分が実際にやって来た内容である CoreOS であればそこそこ旬であるし、それをおさらいしつつ、関連技術も Docker、Omaha、systemd、BtrFS、Golang、etcd、Kubernetes 等々多岐にわたるので、それらに関して私見も含めてわかりやすく書ければいいかなぁと、とりあえず書き始めようとしている次第であります。

@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]
@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|
@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
@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
@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|
@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
@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)
@voluntas
voluntas / shiguredo.rst
Last active March 31, 2024 02:15
時雨堂コトハジメ