Skip to content

Instantly share code, notes, and snippets.

View tmtk75's full-sized avatar

Tomotaka Sakuma tmtk75

View GitHub Profile
#!/bin/bash
access_key_id=$1
access_key_secret=$2
instance_id=$3
dbname=$4
start_time=$5
end_time=$6
now=`date -u "+%Y-%m-%dT%H:%M:%SZ"`
signature_nonce=`openssl rand -hex 8`
@udzura
udzura / consul-workshop.md
Last active November 7, 2021 12:17
やわらか Consul

やわらか Consul

こわくないConsul

Setup

事前に、ワークショップ用のサンプルプロジェクトをチェックアウトし、VMの作成だけしておきましょう。 --no-provision でお願いします!

@mmcc
mmcc / b2dntp
Created September 11, 2014 16:49
boot2docker NTP update
#!/bin/sh
# Fix NTP/Time
# https://github.com/boot2docker/boot2docker/issues/290
boot2docker ssh -- sudo killall -9 ntpd
boot2docker ssh -- sudo ntpclient -s -h pool.ntp.org
boot2docker ssh -- sudo ntpd -p pool.ntp.org
@gmr
gmr / consul.lua
Created July 14, 2014 17:03
Dynamic Nginx upstream nodes using Consul
module("resty.consul", package.seeall)
_VERSION = '0.1.0'
function service_nodes(service)
local http = require "resty.http"
local json = require "cjson"
local hc = http:new()
local upstream = ""
@jdarling
jdarling / data.json
Last active November 6, 2023 16:03
D3 MindMap
{
"name": "Root",
"children": [
{
"name": "Branch 1",
"children": [
{"name": "Leaf 3"},
{"name": "Leaf 4"}
]
},
@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
@voluntas
voluntas / sentry_django.rst
Last active March 26, 2020 01:23
Sentry + Django コトハジメ
@j3tm0t0
j3tm0t0 / ec2ssherror.md
Last active September 30, 2021 07:40
EC2にsshでログインできなくなった場合の対処法

EC2にsshでログインできなくなった場合の対処法


##Connection Timeout または No route to host ###ヘルスチェックステータス1/2 OSレベルでの問題が起きています。
→ インスタンスをRebootしてみましょう。 ###ヘルスチェックステータスが0/2 物理ホスト障害の可能性があります。
→ インスタンスをStop/Startしてみましょう(別の物理ホストに移動させる事ができます)
※ Stoppingの状態で停止しない場合には、force stopを行います(Management Consoleから2回目のstop/ec2-stop-instances --force i-xxxxxxxx)

@reyjrar
reyjrar / elasticsearch.yml
Last active May 12, 2023 11:58
ElasticSearch config for a write-heavy cluster
##################################################################
# /etc/elasticsearch/elasticsearch.yml
#
# Base configuration for a write heavy cluster
#
# Cluster / Node Basics
cluster.name: logng
# Node can have abritrary attributes we can use for routing
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: