Skip to content

Instantly share code, notes, and snippets.

View katzchang's full-sized avatar
🤯

Kazunori Otani katzchang

🤯
View GitHub Profile
# Default configuration file for the Linux (deb/rpm) and Windows MSI collector packages
# If the collector is installed without the Linux/Windows installer script, the following
# environment variables are required to be manually defined or configured below:
# - SPLUNK_ACCESS_TOKEN: The Splunk access token to authenticate requests
# - SPLUNK_API_URL: The Splunk API URL, e.g. https://api.us0.signalfx.com
# - SPLUNK_BUNDLE_DIR: The path to the Smart Agent bundle, e.g. /usr/lib/splunk-otel-collector/agent-bundle
# - SPLUNK_COLLECTD_DIR: The path to the collectd config directory for the Smart Agent, e.g. /usr/lib/splunk-otel-collector/agent-bundle/run/collectd
# - SPLUNK_HEC_TOKEN: The Splunk HEC authentication token
# - SPLUNK_HEC_URL: The Splunk HEC endpoint URL, e.g. https://ingest.us0.signalfx.com/v1/log
@katzchang
katzchang / README.md
Last active September 28, 2022 13:42
Steve Freeman氏とのペアプロ雑感 #tddbc

Steve Freeman氏とのペアプロ雑感

http://tddbc.doorkeeper.jp TDD Boot Camp 2013-07 -- TDDBC で、偶然にもロンドンから来日していたSteve Freeman氏を招くことができた。ちなみに本当に偶然の来日で、その日の夕方にご家族と隅田川の花火を見る予定だったらしい。貴重な時間である。

20分ほど講演していただき、さらに参加者と一緒にペアプロ課題に挑戦してもらった。しかもペアプロでっていう貴重な体験をさせてもらったので、そのことについてまとめたい。

Steve Freeman氏は書籍 "Growing Object-Oriented Software, Guided by Tests" (邦訳「実戦テスト駆動開発」)の共著者の一人で、Javaのモックフレームワーク "JMock"の開発者の一人。当然、自動販売機の課題にもJMockを駆使してモデリングしていただくことになった。

Start from the outside

# Default configuration file for the Linux (deb/rpm) and Windows MSI collector packages
# If the collector is installed without the Linux/Windows installer script, the following
# environment variables are required to be manually defined or configured below:
# - SPLUNK_ACCESS_TOKEN: The Splunk access token to authenticate requests
# - SPLUNK_API_URL: The Splunk API URL, e.g. https://api.us0.signalfx.com
# - SPLUNK_BUNDLE_DIR: The path to the Smart Agent bundle, e.g. /usr/lib/splunk-otel-collector/agent-bundle
# - SPLUNK_COLLECTD_DIR: The path to the collectd config directory for the Smart Agent, e.g. /usr/lib/splunk-otel-collector/agent-bundle/run/collectd
# - SPLUNK_HEC_TOKEN: The Splunk HEC authentication token
# - SPLUNK_HEC_URL: The Splunk HEC endpoint URL, e.g. https://ingest.us0.signalfx.com/v1/log
@katzchang
katzchang / sleep-well.md
Last active September 21, 2021 02:30
処理が成功するまで実行しつづける - @katzchang.gist

処理が成功するまで実行しつづける

インスタンスの起動スクリプトとかを書いてるときによく欲しいと思うやつです。

例えば、 service nginx start が実行されたあとに curl -i localhost | grep "200 OK" とかをすると、サービスがそれなりに動いていることが確認できてよかったりするのですが、あまりにも直後だとサーバの起動が間に合わず、curl が失敗してしまいます。nginxだとまだましだけど、アプリケーションサーバだとそれなりに時間がかかったりする。

古典的な解決方法は、 sleep 30 です。簡単だけど、アプリケーションが巨大になってくると30秒では起動しないこともある。じゃぁ sleep 60 が妥当か?でも、サーバインスタンスの起動スクリプト全体はできるだけ早く立ち上がってほしい。困った。

なので、curlが成功するまで叩き続ける、みたいなスクリプトに仕上げたくなるわけです。

@katzchang
katzchang / techass.md
Last active May 21, 2021 05:06
エンジニアの評価観点について - @katzchang.gist

エンジニアの評価観点について

こんにちは。 @katzchangです。

VOYAGE GROUPでは人事評価制度の一つとして技術力評価会というのが年に2回ほど開催されて、半年くらいの仕事から何かテーマをピックアップしつつ、別チームのエンジニア2名とお話をしつつ、なんと評価までされてしまうという、とても楽しい会があります。

評価する側のエンジニアも多様で、ある程度の評価軸はありつつも、それぞれの質問や評価はそれなりに個性が出るものだろうなーと眺めています。ということで、私なりの質問や評価のポイントをいくつか挙げてみます。

質問に対して明確に答えるための手段を知っているか?

@katzchang
katzchang / ergodash_mini_layout_katzchang.json
Last active October 26, 2020 00:45
ergodash_mini_layout_katzchang
{
"version":1,
"notes":"",
"documentation":"\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n",
"keyboard":"ergodash/mini",
"keymap":"ergodash_mini_layout_mine",
"layout":"LAYOUT",
"layers":[
[
"KC_ESC",

Web Auth講座 Treasure 2019

背景

@katzchang
katzchang / Makefile
Created July 26, 2019 05:03
make sbt-shell
#SBT:=docker run -p 8080:8080 -v ~/.ivy2:/root/.ivy2 -v ~/.sbt:/root/.sbt -v `pwd`:/workspace -w /workspace -it --rm hseeberger/scala-sbt sbt
SBT=./sbt
.PHONY: test-continuous sbt-shell sbt-assembly
test-continuous: sbt
$(SBT) ~test
sbt-shell: sbt
$(SBT)
@katzchang
katzchang / about-auto-scaling-termination-poricy.md
Last active January 13, 2019 23:54
EC2 Auto Scalingを使ったときのインスタンス破棄のポリシーについての覚書 @katzchang.gist

EC2 Auto Scalingを使ったときのインスタンス破棄のポリシーについての覚書

http://docs.aws.amazon.com/AutoScaling/latest/DeveloperGuide/us-termination-policy.html より。Auto Scalingがインスタンスを破棄(terminate)するとき、どのインスタンスを選ぶかのポリシーがある。無指定であればdefaultポリシーが適用されているが、選ぶこともできる。

どんなポリシーが用意されているか?

Default

  • Availability Zone毎にインスタンス数を取り、多いAZを特定する。
  • 同数ならランダムに選ぶ。
@katzchang
katzchang / surize-ad-2017.md
Last active November 24, 2017 04:22
今日から使えるアドテクサービス構築プラクティス

今日から使えるアドテクサービス構築プラクティス

(このドキュメントは Sunrise 2017 アドテクノロジーコース でのお話の内容です)

  • 仮実装で始める
  • 計測する
  • すばやくデプロイする

誰よ?