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
# 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 / 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 / surize-ad-2017.md
Last active November 24, 2017 04:22
今日から使えるアドテクサービス構築プラクティス

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

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

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

誰よ?

HANDLERS = Hello \
my.LogAggregator \
my.CountDaily \
my.CountHourly \
supecial.LogCollector
BRANCH=$(shell git rev-parse --abbrev-ref @)
JAR=$(BRANCH)/myproject-assembly-0.1.jar
all:
@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が成功するまで叩き続ける、みたいなスクリプトに仕上げたくなるわけです。

ガトーショコラ

  • 調理時間70分

材料 (18cm 丸形1台分)

  • チョコレート (製菓用でも板チョコでも) 150g
  • バター (無塩) 100g
  • 砂糖 70g
  • 卵 3個
import sbt._
import sbt.Keys._
import com.earldouglas.xwp.XwpPlugin._
import sbtassembly.Plugin._
import AssemblyKeys._
object BuildSettings {
val buildOrganization = "jp.zucks"
val buildVersion = "1.0.0-SNAPSHOT"
val buildScalaVersion = "2.11.6"